/* =============================================================================
   boardroom-auth.css — BR1215
   Guest auth screens (white-label Sign In / Sign Up / create password).

   Design system: "sv2", the one introduced by BR1211 on Sales / Products /
   Advertising / Inventory / Customers. Every colour, radius, shadow and type
   value below is copied from those pages so a client moving from the login
   screen into the app sees one product, not two.

   Two deliberate deviations from sv2, both because this is a guest form and not
   a dense analytics grid:
     - controls are 44px tall instead of 36/38px (touch target),
     - inputs go to 16px font under 640px so iOS Safari does not zoom on focus.

   White-labelling hook: the only agency-specific values are the four custom
   properties --bra-primary / --bra-primary-hover / --bra-on-primary / --bra-ring,
   written into an inline <style> by the views from AuthBrandingComposer. Nothing
   here needs !important, so it does not fight the legacy .agency-color block in
   components/auth/layout.blade.php.

   Prefix: .bra-  (Boardroom Auth). Self-contained, cache-busted through
   ?v=getApplicationVersion() — bump version.txt on every front-end deploy.
   ========================================================================== */

:root {
    /* palette — sv2 */
    --bra-primary: #0B45A9;
    --bra-primary-hover: #0d51c4;
    --bra-on-primary: #ffffff;
    --bra-ring: 0 0 0 3px rgba(11, 69, 169, 0.12);

    --bra-ink: #0f1222;          /* titles */
    --bra-body: #1a1c26;         /* body copy, input text */
    --bra-label: #3f4756;        /* field labels */
    --bra-muted: #6b7280;        /* secondary copy */
    --bra-placeholder: #9ea1a9;

    --bra-page: #f6f8fb;         /* page ground */
    --bra-card: #ffffff;
    --bra-line: #e6eaf1;         /* card border */
    --bra-hair: #eef1f6;         /* dividers */
    --bra-control: #dfe3ec;      /* input border */
    --bra-control-hover: #aab3bf;
    --bra-soft: #fbfcfe;         /* inner surfaces */

    --bra-danger: #dc2626;
    --bra-danger-strong: #d92d20;
    --bra-danger-soft: #fdeeee;
    --bra-ok: #12a150;
    --bra-ok-soft: #e6f7ef;

    /* shape — sv2 */
    --bra-r-card: 14px;
    --bra-r-ctl: 9px;
    --bra-r-btn: 8px;
    --bra-shadow-card: 0 8px 24px rgba(15, 18, 34, 0.12);

    --bra-font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ---------------------------------------------------------------- page shell */

/* The legacy guest shell (#content.auth in app.scss) hard-codes 100px side
   margins and a 544px column. Redesigned screens opt out of it entirely by
   passing `bare` to <x-auth.layout>, which swaps .auth for .bra-shell. */
body.bra-body {
    background: var(--bra-page);
    margin: 0;
}

.bra-shell {
    margin: 0;
    padding: 0;
    background: var(--bra-page);
}

.bra-page {
    box-sizing: border-box;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 40px 16px 48px;
    background: var(--bra-page);
    font-family: var(--bra-font);
    color: var(--bra-body);
    -webkit-font-smoothing: antialiased;
}

.bra-page *,
.bra-page *::before,
.bra-page *::after {
    box-sizing: border-box;
}

/* --------------------------------------------------------------- brand mark */

.bra-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.bra-brand img {
    display: block;
    max-height: 40px;
    max-width: 220px;
    width: auto;
    height: auto;
}

/* --------------------------------------------------------------------- card */

.bra-card {
    width: 100%;
    max-width: 440px;
    background: var(--bra-card);
    border: 1px solid var(--bra-line);
    border-radius: var(--bra-r-card);
    box-shadow: var(--bra-shadow-card);
    padding: 28px;
}

/* Sign Up carries five fields plus consent copy, so it gets a wider column. */
.bra-card--wide {
    max-width: 520px;
}

.bra-title {
    margin: 0 0 6px;
    font-family: var(--bra-font);
    font-size: 26px;
    font-weight: 700;
    line-height: 34px;
    letter-spacing: -0.3px;
    color: var(--bra-ink);
}

.bra-sub {
    margin: 0 0 22px;
    font-size: 13.5px;
    font-weight: 400;
    line-height: 20px;
    color: var(--bra-muted);
}

.bra-link {
    color: var(--bra-primary);
    font-weight: 600;
    text-decoration: none;
}

.bra-link:hover,
.bra-link:focus-visible {
    color: var(--bra-primary-hover);
    text-decoration: underline;
}

.bra-link--sm {
    font-size: 12.5px;
}

/* -------------------------------------------------------------------- fields */

.bra-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bra-field {
    display: flex;
    flex-direction: column;
}

.bra-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 6px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 16px;
    color: var(--bra-label);
}

.bra-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.bra-label-row .bra-label {
    margin-bottom: 6px;
}

.bra-req {
    color: var(--bra-danger);
}

.bra-input,
.bra-select {
    width: 100%;
    height: 44px;
    border: 1px solid var(--bra-control);
    border-radius: var(--bra-r-ctl);
    padding: 0 12px;
    font-family: var(--bra-font);
    font-size: 14px;
    font-weight: 400;
    color: var(--bra-ink);
    background: var(--bra-card);
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none;
    -webkit-appearance: none;
}

.bra-input::placeholder {
    color: var(--bra-placeholder);
}

.bra-input:hover:not(:focus),
.bra-select:hover:not(:focus) {
    border-color: var(--bra-control-hover);
}

.bra-input:focus,
.bra-select:focus {
    outline: none;
    border-color: var(--bra-primary);
    box-shadow: var(--bra-ring);
}

.bra-input:disabled,
.bra-select:disabled {
    background: var(--bra-soft);
    color: var(--bra-muted);
    cursor: not-allowed;
}

/* invalid state is set by JS on blur / submit, never on an untouched field */
.bra-input.is-invalid,
.bra-select.is-invalid {
    border-color: var(--bra-danger);
}

.bra-input.is-invalid:focus,
.bra-select.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

/* native select needs its own chevron once appearance is stripped */
.bra-select {
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    cursor: pointer;
}

.bra-error {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    color: var(--bra-danger);
}

.bra-hint {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
    color: var(--bra-muted);
}

/* info icon next to a label; native title= tooltip, no JS tooltip library */
.bra-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 1px solid var(--bra-control-hover);
    color: var(--bra-muted);
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    cursor: help;
}

/* ------------------------------------------------------ password visibility */

.bra-input-wrap {
    position: relative;
    display: block;
}

.bra-input-wrap .bra-input {
    padding-right: 44px;
}

.bra-eye {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: var(--bra-r-btn);
    background: transparent;
    color: var(--bra-muted);
    cursor: pointer;
}

.bra-eye:hover {
    background: var(--bra-hair);
    color: var(--bra-label);
}

.bra-eye:focus-visible {
    outline: none;
    box-shadow: var(--bra-ring);
}

.bra-eye svg {
    display: block;
    width: 18px;
    height: 18px;
}

/* the crossed-out variant is toggled by the button's aria-pressed state */
.bra-eye .bra-eye-off {
    display: none;
}

.bra-eye[aria-pressed="true"] .bra-eye-on {
    display: none;
}

.bra-eye[aria-pressed="true"] .bra-eye-off {
    display: block;
}

/* ------------------------------------------------------------------ buttons */

.bra-btn {
    width: 100%;
    height: 44px;
    margin-top: 6px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--bra-primary);
    border-radius: var(--bra-r-btn);
    background: var(--bra-primary);
    color: var(--bra-on-primary);
    font-family: var(--bra-font);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, opacity 0.15s;
}

.bra-btn:hover:not(:disabled) {
    background: var(--bra-primary-hover);
    border-color: var(--bra-primary-hover);
    color: var(--bra-on-primary);
}

.bra-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.bra-btn:focus-visible {
    outline: none;
    box-shadow: var(--bra-ring);
}

.bra-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.bra-btn.is-busy {
    pointer-events: none;
    opacity: 0.8;
}

.bra-spinner {
    display: none;
    width: 15px;
    height: 15px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 999px;
    animation: bra-spin 0.6s linear infinite;
}

.bra-btn.is-busy .bra-spinner {
    display: inline-block;
}

@keyframes bra-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .bra-btn,
    .bra-input,
    .bra-select {
        transition: none;
    }

    .bra-spinner {
        animation-duration: 2s;
    }
}

/* ------------------------------------------------------------------- alerts */

.bra-alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 18px;
    padding: 10px 12px;
    border-radius: var(--bra-r-ctl);
    font-size: 13px;
    font-weight: 500;
    line-height: 18px;
}

.bra-alert[hidden] {
    display: none;
}

.bra-alert--error {
    background: var(--bra-danger-soft);
    color: var(--bra-danger-strong);
}

.bra-alert--ok {
    background: var(--bra-ok-soft);
    color: var(--bra-ok);
}

.bra-alert svg {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin-top: 1px;
}

/* --------------------------------------------------------- consent checkbox */

.bra-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12.5px;
    font-weight: 400;
    line-height: 18px;
    color: var(--bra-muted);
}

.bra-check input[type="checkbox"] {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 1px 0 0;
    accent-color: var(--bra-primary);
    cursor: pointer;
}

.bra-check input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: var(--bra-ring);
}

/* --------------------------------------------- password rules (create step) */

.bra-rules {
    margin: 2px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 5px;
}

.bra-rule {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    color: var(--bra-muted);
}

.bra-rule-dot {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 1px solid var(--bra-control);
    background: var(--bra-card);
    position: relative;
}

.bra-rule.is-met {
    color: var(--bra-ok);
}

.bra-rule.is-met .bra-rule-dot {
    border-color: var(--bra-ok);
    background: var(--bra-ok);
}

/* checkmark, drawn with borders so no extra asset is needed */
.bra-rule.is-met .bra-rule-dot::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 2px;
    width: 4px;
    height: 7px;
    border: solid #fff;
    border-width: 0 1.6px 1.6px 0;
    transform: rotate(45deg);
}

/* -------------------------------------------------------------------- footer */

.bra-foot {
    margin: 0;
    font-size: 12.5px;
    font-weight: 400;
    line-height: 18px;
    color: var(--bra-muted);
    text-align: center;
}

.bra-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --------------------------------------------------------------- responsive */

@media (max-width: 640px) {
    .bra-page {
        justify-content: flex-start;
        padding: 28px 16px 40px;
        gap: 16px;
    }

    .bra-card,
    .bra-card--wide {
        max-width: 100%;
        padding: 22px 18px;
        border-radius: 12px;
        box-shadow: 0 4px 14px rgba(15, 18, 34, 0.08);
    }

    .bra-title {
        font-size: 22px;
        line-height: 30px;
    }

    /* 16px keeps iOS Safari from zooming the viewport on focus */
    .bra-input,
    .bra-select {
        font-size: 16px;
        height: 46px;
    }

    .bra-btn {
        height: 46px;
    }

    .bra-brand img {
        max-height: 34px;
    }
}

@media (max-width: 380px) {
    .bra-card,
    .bra-card--wide {
        padding: 18px 14px;
    }

    .bra-label-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
}

/* very short viewports (landscape phones): stop vertical centering from clipping */
@media (max-height: 620px) {
    .bra-page {
        justify-content: flex-start;
    }
}
