/**
 * Authentication journey
 * A calm, task-first split layout: the account value stays visible without
 * pushing the credential form below the fold.
 */

.auth-section {
    align-items: flex-start;
    min-height: calc(100vh - 4rem);
    padding: clamp(var(--space-6), 6vw, var(--space-12)) 0;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(17rem, 0.85fr) minmax(22rem, 1.15fr);
    width: min(100%, 66rem);
    overflow: hidden;
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.auth-shell--compact {
    width: min(100%, 58rem);
}

.auth-promise {
    --color-heading: var(--color-on-ink);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: clamp(var(--space-6), 5vw, var(--space-10));
    color: var(--color-on-ink);
    background: var(--gradient-ink);
}

.auth-promise__brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: clamp(var(--space-8), 8vw, var(--space-12));
    font-size: var(--text-lg);
    font-weight: var(--weight-bold);
    color: inherit;
    text-decoration: none;
}

.auth-promise__brand img {
    width: 2.625rem;
    height: 2.625rem;
    border-radius: var(--radius-md);
}

.auth-promise__brand:focus-visible,
.auth-guest-link:focus-visible,
.auth-password__toggle:focus-visible {
    outline: 3px solid var(--color-accent-400);
    outline-offset: 3px;
}

.auth-promise__eyebrow,
.auth-card__eyebrow {
    margin-bottom: var(--space-2);
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-promise__eyebrow {
    color: var(--color-accent-400);
}

.auth-promise h2 {
    max-width: 12ch;
    margin-bottom: var(--space-4);
    font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
    line-height: 1.08;
    color: inherit;
}

.auth-promise__copy {
    margin-bottom: var(--space-6);
    line-height: 1.65;
    color: var(--color-on-ink-muted);
}

.auth-benefits {
    display: grid;
    gap: var(--space-3);
    margin: 0 0 var(--space-8);
    padding: 0;
    list-style: none;
}

.auth-benefits li {
    position: relative;
    padding-left: 1.75rem;
    font-size: var(--text-sm);
    line-height: 1.45;
    color: var(--color-on-ink-muted);
}

.auth-benefits li::before {
    position: absolute;
    top: 0;
    left: 0;
    content: '✓';
    font-weight: var(--weight-bold);
    color: var(--color-accent-400);
}

.auth-progress-note {
    display: grid;
    gap: var(--space-1);
    margin-bottom: var(--space-6);
    padding: var(--space-4);
    background: hsla(0, 0%, 100%, 0.08);
    border: 1px solid hsla(0, 0%, 100%, 0.16);
    border-radius: var(--radius-lg);
}

.auth-progress-note strong {
    color: var(--color-accent-400);
}

.auth-progress-note span {
    font-size: var(--text-sm);
    line-height: 1.45;
    color: var(--color-on-ink-muted);
}

.auth-guest-link {
    margin-top: auto;
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--color-on-ink);
    text-underline-offset: 0.2em;
}

.auth-card {
    align-self: stretch;
    padding: clamp(var(--space-6), 5vw, var(--space-10));
    background: var(--color-surface);
}

.auth-card__header {
    margin-bottom: var(--space-6);
}

.auth-card__eyebrow {
    color: var(--color-primary-500);
}

.auth-card__header h1 {
    margin-bottom: var(--space-2);
    font-size: clamp(var(--text-2xl), 4vw, var(--text-3xl));
}

.auth-card__header > p:last-child {
    margin: 0;
    color: var(--color-text-secondary);
}

.auth-form .form__group {
    margin-bottom: var(--space-5);
}

.auth-oauth-form { margin-bottom: var(--space-5); }

.auth-google-button {
    display: flex;
    width: 100%;
    min-height: 3rem;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: 0.7rem var(--space-4);
    color: var(--color-text);
    font: inherit;
    font-weight: var(--weight-semibold);
    cursor: pointer;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.auth-google-button:hover { background: var(--color-surface-alt); border-color: var(--color-primary-400); box-shadow: var(--shadow-sm); }
.auth-google-button:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.auth-google-button:disabled { cursor: wait; opacity: 0.7; }
.auth-google-button svg { flex: 0 0 auto; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: 0 0 var(--space-5);
    color: var(--color-text-tertiary);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.auth-divider::before,
.auth-divider::after { height: 1px; flex: 1; content: ''; background: var(--color-border-light); }

.auth-oauth-terms {
    margin: var(--space-2) auto 0;
    max-width: 34rem;
    color: var(--color-text-tertiary);
    font-size: var(--text-xs);
    line-height: 1.45;
    text-align: center;
}

.auth-oauth-terms a { color: var(--color-primary-600); }

.auth-form .form__input {
    min-height: 3rem;
}

.auth-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
}

.auth-label-row .form__label {
    margin-bottom: var(--space-1);
}

.auth-label-row .link {
    font-size: var(--text-sm);
}

.auth-password {
    position: relative;
}

.auth-password .form__input {
    padding-right: 4.5rem;
}

.auth-password__toggle {
    position: absolute;
    top: 50%;
    right: 0.25rem;
    min-width: 4rem;
    min-height: 2.5rem;
    padding: 0 var(--space-2);
    font: inherit;
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--color-primary-600);
    cursor: pointer;
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    transform: translateY(-50%);
}

.auth-password-rules {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-1) var(--space-3);
    margin: var(--space-3) 0 0;
    padding: 0;
    list-style: none;
}

.auth-password-rules li {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-xs);
    line-height: 1.4;
    color: var(--color-text-tertiary);
}

.auth-password-rules li > span {
    width: 1rem;
    font-weight: var(--weight-bold);
    text-align: center;
}

.auth-password-rules li.is-met {
    color: var(--color-success);
}

.auth-match-status:not(:empty) {
    margin-top: var(--space-2);
}

.auth-match-status.is-match {
    color: var(--color-success);
}

.auth-match-status.is-mismatch {
    color: var(--color-danger);
}

.auth-terms {
    line-height: 1.55;
}

.auth-submit {
    min-height: 3rem;
}

.auth-submit[disabled] {
    cursor: wait;
    opacity: 0.72;
}

.auth-card__footer {
    margin-top: var(--space-6);
    padding-top: var(--space-5);
    text-align: center;
    border-top: 1px solid var(--color-border-light);
}

.auth-card__footer p {
    margin: 0;
}

.auth-alert {
    display: grid;
    gap: var(--space-1);
    margin-bottom: var(--space-5);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    line-height: 1.45;
    border: 1px solid;
    border-radius: var(--radius-md);
}

.auth-alert--error {
    color: var(--color-danger);
    background: var(--color-danger-bg);
    border-color: var(--color-danger);
}

.auth-alert--success {
    color: var(--color-success);
    background: var(--color-success-bg);
    border-color: var(--color-success);
}

.auth-alert--warning {
    color: var(--color-text);
    background: var(--color-warning-bg);
    border-color: var(--color-warning);
}

.auth-next-steps {
    display: grid;
    gap: var(--space-4);
    color: var(--color-text-secondary);
}

@media (max-width: 800px) {
    .auth-shell {
        grid-template-columns: 1fr;
        width: min(100%, 36rem);
    }

    .auth-promise {
        padding: var(--space-6);
    }

    .auth-promise__brand {
        margin-bottom: var(--space-6);
    }

    .auth-promise h2 {
        max-width: 18ch;
        font-size: var(--text-2xl);
    }

    .auth-benefits {
        margin-bottom: var(--space-5);
    }

    .auth-guest-link {
        margin-top: 0;
    }
}

@media (max-width: 480px) {
    .auth-section {
        padding: var(--space-4) 0;
    }

    .auth-shell {
        border-radius: var(--radius-lg);
    }

    .auth-promise,
    .auth-card {
        padding: var(--space-5);
    }

    .auth-password-rules {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-form .form__input {
        transition: none;
    }
}

@media (forced-colors: active) {
    .auth-promise,
    .auth-card,
    .auth-alert,
    .auth-progress-note {
        border: 1px solid CanvasText;
    }

    .auth-password-rules li.is-met {
        color: LinkText;
    }
}
