/*
 * auth.css  v8
 * v4 — Session 79: new logo SVG, form wider.
 * v5 — Session 79: horizontal lockup dark on login panel. Panel heading/points bigger. Check icons bigger.
 * v6 — Session 88: mobile — compact dark header strip with centered logo, form centered below. Light logo approach abandoned.
 */

/* ── Split layout ──────────────────────────────────────────────────────── */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    background: var(--m-bg);
}

.auth-shell {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    min-height: 100vh;
}

/* ── Brand panel (left — dark) ─────────────────────────────────────────── */

.auth-panel {
    background: var(--m-bg-dark);
    padding: clamp(2.5rem, 6vw, 4rem) clamp(2rem, 5vw, 3.5rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3rem;
    position: relative;
    overflow: hidden;
}

/* Indigo radial glow — matches marketing dark sections */
.auth-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 60% at 20% 80%, oklch(52% 0.22 265 / 0.22) 0%, transparent 65%);
    pointer-events: none;
}

/* ── Panel: logo ───────────────────────────────────────────────────────── */

.auth-panel__logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.auth-panel__logo-icon {
    width: 32px;
    height: 32px;
    background: var(--m-brand);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-panel__logo-text {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--m-text-on-dark);
    letter-spacing: -0.015em;
}

.auth-panel__logo-text em {
    color: oklch(70% 0.2 265);
    font-style: normal;
}

.auth-panel__logo-img {
    display: block;
    height: 100px;
    width: auto;
    margin-left: -12px;
    filter: drop-shadow(0 0 30px oklch(52% 0.22 265 / 0.8)) drop-shadow(0 0 80px oklch(52% 0.22 265 / 0.4));
}

/* ── Panel: body (tagline + heading + points) ──────────────────────────── */

.auth-panel__body {
    position: relative;
    z-index: 1;
    flex: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-block: 0;
}

.auth-panel__tagline {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: oklch(62% 0.2 265);
    margin-bottom: 1rem;
}

.auth-panel__heading {
    font-size: clamp(2rem, 3.5vw, 2.75rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--m-text-on-dark);
    margin-bottom: 2rem;
}

.auth-panel__points {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
}

.auth-panel__points li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 1rem;
    color: oklch(72% 0.012 265);
    line-height: 1.5;
}

.auth-panel__check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: oklch(52% 0.22 265 / 0.20);
    border: 1px solid oklch(52% 0.22 265 / 0.40);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.1rem;
}

.auth-panel__check svg {
    width: 11px;
    height: 11px;
}

/* ── Panel: footer note ────────────────────────────────────────────────── */

.auth-panel__footnote {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: oklch(42% 0.012 265);
}

.auth-panel__footnote::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: oklch(34% 0.015 265);
    flex-shrink: 0;
}

/* ── Form side (right — white) ─────────────────────────────────────────── */

.auth-form-side {
    background: var(--m-bg);
    padding: clamp(2.5rem, 6vw, 4rem) clamp(2rem, 5vw, 3.5rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.auth-form-inner {
    width: 100%;
    max-width: 400px;
}

/* ── Form header ───────────────────────────────────────────────────────── */

.auth-form__header {
    margin-bottom: 1.75rem;
}

.auth-form__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--m-text);
    letter-spacing: -0.02em;
    margin-bottom: 0.375rem;
    line-height: 1.2;
}

.auth-form__sub {
    font-size: 0.875rem;
    color: var(--m-text-2);
}

.auth-form__sub a {
    color: var(--m-brand);
    text-decoration: none;
    font-weight: 600;
}

.auth-form__sub a:hover {
    text-decoration: none;
}

/* ── Flash alerts ──────────────────────────────────────────────────────── */

.auth-alert {
    border-radius: var(--m-radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.auth-alert--error {
    background: oklch(97% 0.02 25);
    border: 1px solid oklch(88% 0.08 25);
    color: oklch(40% 0.2 25);
}

.auth-alert--success {
    background: oklch(97% 0.02 160);
    border: 1px solid oklch(88% 0.08 160);
    color: oklch(36% 0.18 160);
}

/* ── Form fields ───────────────────────────────────────────────────────── */

.auth-form__group {
    margin-bottom: 1rem;
}

.auth-form__split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

@media (max-width: 560px) {
    .auth-form__split {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .auth-plan-choice {
        grid-template-columns: 1fr;
    }
}

.auth-form__label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--m-text);
    margin-bottom: 0.375rem;
    letter-spacing: 0.01em;
}

.auth-form__input {
    width: 100%;
    height: 42px;
    border: 1px solid var(--m-border-strong);
    border-radius: var(--m-radius-sm);
    background: var(--m-bg);
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 0.9375rem;
    color: var(--m-text);
    padding: 0 0.875rem;
    outline: none;
    transition: border-color 140ms ease, box-shadow 140ms ease;
    appearance: none;
    -webkit-appearance: none;
}

select.auth-form__input {
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    background-size: 12px 12px;
}

.auth-form__input:focus {
    border-color: var(--m-brand);
    box-shadow: 0 0 0 3px var(--m-brand-dim);
}

.auth-form__input.is-invalid {
    border-color: oklch(58% 0.22 25);
    box-shadow: 0 0 0 3px oklch(58% 0.22 25 / 0.12);
}

.auth-locked-field {
    position: relative;
}

.auth-form__input--locked {
    padding-right: 5.75rem;
    background: oklch(96% 0.015 250);
    color: var(--m-text-muted);
    border-color: var(--m-border);
    cursor: not-allowed;
    opacity: 1;
}

.auth-locked-field__badge {
    position: absolute;
    top: 50%;
    right: 0.65rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.55rem;
    padding: 0 0.55rem;
    border-radius: 999px;
    background: oklch(91% 0.025 250);
    color: var(--m-text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}

/* ── Inline validation feedback ────────────────────────────────────────── */

.auth-form__feedback {
    font-size: 0.75rem;
    margin-top: 0.3rem;
    min-height: 1rem;
    line-height: 1.4;
}

.auth-form__feedback--error {
    color: oklch(48% 0.22 25);
}

.auth-form__feedback--valid {
    color: oklch(40% 0.18 160);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.auth-form__feedback--valid svg {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
}

.auth-form__hint,
.auth-form__match {
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--m-text-3);
}

.auth-form__hint {
    margin-top: 0.75rem;
}

.auth-onboarding-learn {
    margin: -0.25rem 0 1.15rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid oklch(88% 0.045 255);
    border-radius: var(--m-radius-sm);
    background: oklch(98% 0.018 255);
    color: var(--m-text);
}

.auth-onboarding-learn strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    font-weight: 800;
}

.auth-onboarding-learn p {
    margin: 0;
    color: var(--m-text-2);
    font-size: 0.8375rem;
    line-height: 1.45;
}

.auth-plan-choice {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    margin: 0 0 1rem;
    padding: 0;
    border: 0;
}

.auth-plan-choice legend {
    grid-column: 1 / -1;
    margin-bottom: 0.1rem;
    color: var(--m-text);
    font-size: 0.8125rem;
    font-weight: 700;
}

.auth-plan-choice__option {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.55rem;
    align-items: start;
    min-height: 92px;
    padding: 0.8rem;
    border: 1px solid var(--m-border-strong);
    border-radius: var(--m-radius-sm);
    background: var(--m-bg);
    cursor: pointer;
    transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.auth-plan-choice__option:has(input:checked) {
    border-color: var(--m-brand);
    background: var(--m-brand-dim);
    box-shadow: 0 0 0 3px color-mix(in oklch, var(--m-brand-dim), transparent 15%);
}

.auth-plan-choice__option input {
    margin-top: 0.2rem;
}

.auth-plan-choice__option strong,
.auth-plan-choice__option small {
    display: block;
}

.auth-plan-choice__option strong {
    color: var(--m-text);
    font-size: 0.9rem;
    line-height: 1.25;
}

.auth-plan-choice__option small {
    margin-top: 0.25rem;
    color: var(--m-text-3);
    font-size: 0.775rem;
    font-weight: 600;
    line-height: 1.35;
}

.auth-form__helper-action {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    margin-top: 0.45rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--m-brand);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
}

.auth-form__helper-action:hover {
    color: var(--m-brand-hover);
}

.auth-form__match {
    min-height: 1.1rem;
    margin-top: 0.375rem;
}

.auth-form__match--ok {
    color: oklch(40% 0.18 160);
}

.auth-form__match--error {
    color: oklch(48% 0.22 25);
}

/* ── Password field wrapper + toggle ───────────────────────────────────── */

.auth-form__password-wrap {
    position: relative;
}

.auth-form__password-wrap .auth-form__input {
    padding-right: 2.75rem;
}

.auth-form__eye {
    position: absolute;
    right: 0.625rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--m-text-3);
    display: flex;
    align-items: center;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 140ms;
}

.auth-form__eye:hover {
    color: var(--m-text-2);
}

.auth-form__eye svg {
    width: 16px;
    height: 16px;
}

/* ── Password strength meter ───────────────────────────────────────────── */

.auth-strength {
    display: flex;
    gap: 4px;
    margin-top: 0.5rem;
}

.auth-strength__bar {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: var(--m-border);
    transition: background 200ms ease;
}

.auth-strength__bar--weak   { background: oklch(58% 0.22 25); }
.auth-strength__bar--fair   { background: var(--m-accent); }
.auth-strength__bar--strong { background: oklch(54% 0.18 160); }

.auth-strength__label {
    font-size: 0.6875rem;
    color: var(--m-text-3);
    margin-top: 0.25rem;
}

.auth-strength--weak,
.auth-strength--fair,
.auth-strength--good,
.auth-strength--strong {
    display: block;
    font-size: 0.75rem;
    line-height: 1.35;
    min-height: 1rem;
}

.auth-strength--weak {
    color: oklch(48% 0.22 25);
}

.auth-strength--fair,
.auth-strength--good {
    color: var(--m-accent);
}

.auth-strength--strong {
    color: oklch(40% 0.18 160);
}

/* ── Forgot password link ──────────────────────────────────────────────── */

.auth-form__forgot {
    display: flex;
    justify-content: flex-end;
    margin-top: -0.5rem;
    margin-bottom: 0.25rem;
}

.auth-form__forgot a {
    font-size: 0.8125rem;
    color: var(--m-brand);
    text-decoration: none;
    font-weight: 500;
}

.auth-form__forgot a:hover {
    text-decoration: none;
}

/* ── Submit button ─────────────────────────────────────────────────────── */

.auth-form__submit {
    width: 100%;
    height: 44px;
    background: var(--m-brand);
    color: var(--m-text-on-brand);
    border: none;
    border-radius: var(--m-radius-sm);
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
    letter-spacing: 0.01em;
    transition: background 140ms ease, transform 80ms ease;
}

.auth-form__submit:hover  { background: var(--m-brand-hover); }
.auth-form__submit:active { transform: translateY(1px); }

/* ── Sub-CTA note (no credit card etc.) ────────────────────────────────── */

.auth-form__note {
    text-align: center;
    font-size: 0.75rem;
    color: var(--m-text-3);
    margin-top: 0.625rem;
}

/* ── Switch link footer ────────────────────────────────────────────────── */

.auth-form__switch {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--m-border);
    text-align: center;
    font-size: 0.875rem;
    color: var(--m-text-2);
}

.auth-form__switch a,
.auth-form__switch-action {
    color: var(--m-brand);
    text-decoration: none;
    font-weight: 600;
}

.auth-form__switch-action {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    cursor: pointer;
}

.auth-form__switch a:hover,
.auth-form__switch-action:hover {
    text-decoration: none;
}

/* ── Mobile: single column ─────────────────────────────────────────────── */

/* Mobile: hide dark panel entirely, show light logo in form side instead */
.auth-mobile-logo {
    display: none;
}

@media (max-width: 720px) {
    /* Body is dark so black fills everywhere naturally */
    .auth-page {
        background: var(--m-bg-dark);
    }

    /* Full viewport, centered as one visual unit */
    .auth-shell {
        grid-template-columns: 1fr;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: stretch;
        background: transparent;
    }

    /* Dark panel: natural height, logo centered */
    .auth-panel {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 2.5rem var(--m-gutter) 1.75rem;
        min-height: unset;
        flex: 0 0 auto;
        background: transparent;
        gap: 0;
    }

    .auth-panel__body,
    .auth-panel__footnote {
        display: none;
    }

    .auth-panel__logo-img {
        height: 96px;
        margin-left: 0;
    }

    /* White form: natural height, white bg covers below the logo */
    .auth-form-side {
        padding: 2rem var(--m-gutter) 2.5rem;
        justify-content: flex-start;
        flex: 0 0 auto;
        background: var(--m-bg);
        /* Extend white to bottom of viewport */
        box-shadow: 0 100vh 0 100vh var(--m-bg);
    }

    .auth-mobile-logo {
        display: none;
    }
}

/* ── 2FA: code input ──────────────────────────────────────────────── */

.auth-2fa .auth-form-inner {
    max-width: 440px;
}

.auth-2fa .auth-form__header {
    padding-bottom: 1.125rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--m-border);
}

.auth-2fa .auth-form__sub {
    line-height: 1.55;
}

.auth-2fa #totpForm,
.auth-2fa .auth-backup-section {
    padding: 1.125rem;
    border: 1px solid var(--m-border);
    border-radius: var(--m-radius);
    background: var(--m-bg-subtle);
}

.auth-code-input {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.auth-code-input--backup {
    font-size: 1.125rem;
    letter-spacing: 0.1em;
}

/* ── 2FA: or divider ──────────────────────────────────────────────── */

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
    font-size: 0.75rem;
    color: var(--m-text-3);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.auth-divider__line {
    flex: 1;
    height: 1px;
    background: var(--m-border);
}

/* ── 2FA: backup toggle + section ─────────────────────────────────── */

.auth-backup-toggle {
    width: 100%;
    height: 42px;
    background: transparent;
    border: 1px solid var(--m-border-strong);
    border-radius: var(--m-radius-sm);
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 0.9rem;
    color: var(--m-text-2);
    cursor: pointer;
    transition: border-color 140ms, color 140ms, background 140ms;
}

.auth-backup-toggle:hover {
    border-color: var(--m-border-strong);
    background: var(--m-bg-subtle);
    color: var(--m-text);
}

.auth-backup-section {
    margin-top: 1.25rem;
}

.auth-backup-hint {
    font-size: 0.8125rem;
    color: var(--m-text-2);
    line-height: 1.55;
    margin-bottom: 0.875rem;
}

.auth-backup-hint strong {
    color: var(--m-text);
    font-weight: 600;
}

@media (max-width: 720px) {
    .auth-2fa .auth-form-side {
        padding-top: 1.5rem;
    }

    .auth-2fa #totpForm,
    .auth-2fa .auth-backup-section {
        padding: 1rem;
    }
}

/* ── Warning alert variant (Tier 2 disclaimer) ────────────────────────── */

.auth-alert--warning {
    background: oklch(98% 0.02 75);
    border: 1px solid oklch(88% 0.08 75);
    color: oklch(38% 0.15 60);
}

/* Block variant — Tier 3 honest wall. Contains paragraphs + longer copy. */
.auth-alert--block {
    line-height: 1.55;
}

.auth-alert--block p {
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.auth-alert--block strong {
    display: block;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

/* ── Checkbox row (Tier 2 acknowledgement) ─────────────────────────────── */

.auth-form__checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: inherit;
    cursor: pointer;
    line-height: 1.45;
}

.auth-form__checkbox-row input[type="checkbox"] {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 0.1rem;
    cursor: pointer;
    accent-color: var(--m-brand);
}

/* ── Google OAuth button ──────────────────────────────────────────── */

.auth-form__divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
    color: var(--m-text-3);
    font-size: 0.8125rem;
}

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

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.6875rem 1rem;
    background: #fff;
    border: 1px solid var(--m-border-strong);
    border-radius: 8px;
    color: var(--m-text);
    font-size: 0.9375rem;
    font-weight: 500;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

.btn-google:hover {
    background: oklch(98.5% 0 0);
    border-color: oklch(72% 0 0);
    box-shadow: 0 2px 6px rgba(0,0,0,.1);
}

.btn-google:active {
    background: oklch(96% 0 0);
    box-shadow: none;
}

.btn-google__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
