body.login-page {
    min-height: 100vh;
}

.login-container,
.register-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    padding: 48px 18px 72px;
}

/* The login page alone stacks the card and the benefits band, centered. */
.login-container {
    flex-direction: column;
    align-items: center;
    gap: 22px;
}

.login-box,
.register-box {
    width: min(100%, 440px);
    padding: 36px 32px 32px;
    border: 1px solid var(--line);
    background: var(--paper);
    box-shadow: none;
    border-radius: 12px;
}

.login-box .eyebrow {
    display: block;
    text-align: center;
    margin: 0 0 8px;
}

.login-box h2,
.register-box h2 {
    margin: 0 0 10px;
    text-align: center;
    font-size: clamp(1.85rem, 3vw, 2.25rem);
    font-family: var(--serif);
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--cream);
}

.login-box .lede,
.register-box .lede {
    margin: 0 0 22px;
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.55;
}

.login-box form,
.register-box form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#verify-code-form:not([hidden]) {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 14px;
}

#verify-code-form[hidden] {
    display: none !important;
}

#verify-code {
    letter-spacing: 0.28em;
    text-align: center;
    font-weight: 700;
}

.login-box input,
.register-box input {
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--paper-2);
    background: var(--input-bg);
    color: var(--input-text);
    font-size: 1rem;
    font-family: var(--font);
    caret-color: var(--input-text);
    transition: border-color 0.2s ease;
}

.login-box input::placeholder,
.register-box input::placeholder {
    color: var(--muted);
}

.login-box input:focus,
.register-box input:focus {
    outline: none;
    border-color: var(--gold);
}

.login-box input:-webkit-autofill,
.login-box input:-webkit-autofill:hover,
.login-box input:-webkit-autofill:focus,
.register-box input:-webkit-autofill,
.register-box input:-webkit-autofill:hover,
.register-box input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--cream);
    caret-color: var(--cream);
    box-shadow: 0 0 0 1000px var(--input-bg) inset;
    transition: background-color 9999s ease-out;
}

.google-auth-button {
    width: 100%;
    padding: 13px 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--cream);
    font-weight: 650;
    font-size: 0.95rem;
    font-family: var(--font);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease;
    margin-bottom: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-logo {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.google-auth-button:hover {
    border-color: var(--glow-line);
    background: var(--paper-2);
    transform: translateY(-1px);
    box-shadow: var(--panel-glow-hover);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0 18px;
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.login-button,
.register-button {
    width: 100%;
    padding: 14px 18px;
    border: none;
    border-radius: 10px;
    background: var(--gold);
    color: var(--on-gold);
    font-weight: 750;
    font-size: 0.98rem;
    font-family: var(--font);
    cursor: pointer;
    transition: transform 0.18s ease, filter 0.18s ease;
}

.login-button:hover,
.register-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.auth-status {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.92rem;
    line-height: 1.5;
    text-align: left;
    border: 1px solid var(--line);
    background: var(--paper-2);
    color: var(--cream);
}

.auth-status[data-kind="error"] {
    border-color: rgba(220, 80, 80, 0.45);
    background: rgba(220, 80, 80, 0.12);
}

.auth-status[data-kind="success"] {
    border-color: rgba(90, 180, 110, 0.4);
    background: rgba(90, 180, 110, 0.1);
}

.resend-verification {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 11px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: transparent;
    color: var(--gold);
    font-weight: 650;
    font-size: 0.9rem;
    font-family: var(--font);
    cursor: pointer;
}

.resend-verification[hidden] {
    display: none;
}

.resend-verification:hover {
    background: var(--paper-2);
}

.auth-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--muted);
}

.login-footer,
.register-footer {
    margin: 0;
    color: var(--muted);
}

.sign-up-button,
.forgot-password-link,
.register-footer a {
    color: var(--gold);
    text-decoration: none;
    font-weight: 600;
}

.sign-up-button:hover,
.forgot-password-link:hover,
.register-footer a:hover {
    text-decoration: underline;
}

/* ——— "What you get when you sign in": a full-width band beneath the card.
   Same tokens as .login-box so the two read as one page, not two widgets. ——— */
.login-benefits {
    width: min(100%, 760px);
    padding: 26px 28px 22px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
}

.login-benefits-head .eyebrow {
    margin: 0 0 6px;
}

/* The chameleon speaks the band's title: the coach sits on the left and the
   copy lives in a chat bubble whose tail points back at him. The head carries
   the title's old 20px bottom margin so the band's rhythm is unchanged. */
.login-benefits-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0 0 20px;
}

.login-benefits h3 {
    margin: 0 0 20px;
    font-family: var(--serif);
    font-size: clamp(1.35rem, 2.4vw, 1.7rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--cream);
}

.login-benefits-head h3 {
    margin: 0;
}

/* Speech bubble: a hairline-raised surface with a whisper of the coach's
   neon so the line reads as his voice without shouting the band's palette. */
.login-benefits-head-copy {
    position: relative;
    flex: 1;
    min-width: 0;
    padding: 14px 22px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: color-mix(in srgb, #00ff66 5%, var(--paper));
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Tail: a rotated square inheriting the bubble's surface, so only its
   left/bottom hairlines show as a pointer toward the avatar. */
.login-benefits-head-copy::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 50%;
    width: 12px;
    height: 12px;
    border-left: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    border-radius: 0 0 0 3px;
    background: inherit;
    transform: translateY(-50%) rotate(45deg);
}

/* The shared avatar ships at 56px (48px ≤480px) via coach_chameleon.css;
   the `body.login-page` prefix outranks that component rule so the login band
   can greet with a slightly larger mark without touching the other pages. */
body.login-page .login-benefits-head .coach-avatar-panel.login-coach-avatar {
    flex: 0 0 auto;
    width: 68px;
    height: 68px;
}

.login-benefits-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px 26px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.login-benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.login-benefit-tick {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--on-gold);
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 1;
}

.login-benefit-copy strong {
    display: block;
    margin-bottom: 3px;
    color: var(--cream);
    font-size: 0.96rem;
    font-weight: 700;
}

.login-benefit-desc {
    display: block;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.login-benefits-note {
    margin: 22px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.55;
}

.login-benefits-note a {
    color: var(--gold);
    font-weight: 600;
    text-decoration: none;
}

.login-benefits-note a:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .login-container,
    .register-container {
        padding: 24px 0 48px;
    }

    .login-benefits {
        padding: 22px 18px 20px;
    }

    .login-benefits-head {
        gap: 12px;
    }

    .login-benefits-head-copy {
        padding: 12px 16px;
    }

    body.login-page .login-benefits-head .coach-avatar-panel.login-coach-avatar {
        width: 56px;
        height: 56px;
    }

    .login-box,
    .register-box {
        padding: 24px 18px 28px;
        width: 100%;
    }

    .login-box input,
    .register-box input,
    .login-button,
    .register-button,
    .google-auth-button {
        min-height: 44px;
        font-size: 16px;
    }

    .auth-links {
        justify-content: center;
        text-align: center;
        flex-direction: column;
        gap: 10px;
    }
}

/* OpeningMatrix study login: no coach bubble — clean study benefits header. */
body.login-page--openingmatrix .login-benefits-head-copy {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

body.login-page--openingmatrix .login-benefits-head-copy::before {
    display: none;
}

body.login-page--openingmatrix .login-family-wrap {
    margin: 0 0 0.85rem;
}

body.login-page--openingmatrix .login-benefits-head-copy .om-family-line {
    margin-top: 0.45rem;
}
