/* =====================================================
   AiVoice — Auth (login / register)
   Matches auth.login / auth.register markup (.auth-*)
   ===================================================== */

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

body.auth-page {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--color-text);
    background: var(--color-canvas);
    -webkit-font-smoothing: antialiased;
}

/* ── Split shell ── */
.auth-split {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

.auth-split__brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(2rem, 4vw, 3.25rem);
    color: var(--color-text-on-blue);
    background:
        radial-gradient(ellipse 80% 60% at 20% 15%, rgba(255, 255, 255, 0.12), transparent 55%),
        radial-gradient(ellipse 70% 50% at 90% 85%, rgba(37, 99, 235, 0.28), transparent 50%),
        var(--gradient-auth);
    overflow: hidden;
}

.auth-split__brand::after {
    content: "";
    position: absolute;
    inset: auto -20% -30% 20%;
    height: 55%;
    background:
        radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.08) 0 2px, transparent 3px),
        radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.06) 0 1.5px, transparent 2.5px);
    background-size: 48px 48px, 32px 32px;
    opacity: 0.55;
    pointer-events: none;
}

.auth-brand__logo {
    position: relative;
    z-index: 1;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    text-decoration: none;
    color: inherit;
}

.auth-brand__copy {
    position: relative;
    z-index: 1;
    max-width: 28rem;
}

.auth-brand__eyebrow {
    display: inline-block;
    margin-bottom: 0.85rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
}

.auth-brand__title {
    margin: 0 0 0.85rem;
    font-size: clamp(1.85rem, 3.2vw, 2.65rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.auth-brand__text {
    margin: 0;
    font-size: 1rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.78);
}

.auth-brand__foot {
    position: relative;
    z-index: 1;
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.55);
}

/* ── Form column ── */
.auth-split__form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 4vw, 3rem);
    background:
        linear-gradient(180deg, #f8fafd 0%, var(--color-canvas) 100%);
}

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

.auth-form__eyebrow {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-brand);
}

.auth-form__title {
    margin: 0 0 0.4rem;
    font-size: clamp(1.5rem, 2.5vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--color-text);
    line-height: 1.2;
}

.auth-form__sub {
    margin: 0 0 1.5rem;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    line-height: 1.5;
}

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

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

.auth-form__sub code {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    padding: 0.1em 0.4em;
    border-radius: var(--radius-sm);
    background: var(--color-surface-muted);
    color: var(--color-text);
}

.auth-form__hint {
    margin: 1.15rem 0 0;
    font-size: var(--font-size-xs);
    color: var(--color-text-light);
    text-align: center;
}

/* ── Fields (auth overrides) ── */
.auth-form .field {
    margin-bottom: 1rem;
}

.auth-form .field--inline {
    flex-direction: row;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 1.35rem;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-muted);
    cursor: pointer;
    user-select: none;
}

.auth-form .field--inline input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--color-brand);
    cursor: pointer;
}

.auth-form .btn--block,
.auth-form .btn.btn--primary {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-top: 0.15rem;
}

/* ── Alerts ── */
.auth-form .alert {
    margin: 0 0 1.15rem;
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    line-height: 1.45;
}

.auth-form .alert p {
    margin: 0;
}

.auth-form .alert p + p {
    margin-top: 0.25rem;
}

.auth-form .alert--error {
    background: var(--color-danger-light);
    border: 1px solid color-mix(in srgb, var(--color-danger) 25%, transparent);
    color: var(--color-danger);
}

/* ── Register tabs (reuse vx__tab pattern if ui-voices not loaded) ── */
.auth-form .vx__tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.25rem;
    padding: 0.25rem;
    background: var(--color-surface-muted);
    border-radius: var(--radius-md);
}

.auth-form .vx__tab {
    flex: 1;
    padding: 0.55rem 0.75rem;
    border: 0;
    border-radius: calc(var(--radius-md) - 2px);
    background: transparent;
    color: var(--color-text-muted);
    font-family: inherit;
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.auth-form .vx__tab:hover {
    color: var(--color-text);
}

.auth-form .vx__tab.is-active {
    background: var(--color-surface);
    color: var(--color-brand);
    box-shadow: var(--shadow-sm);
}

/* ── Legacy #login card (kept for any leftover markup) ── */
#login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-auth);
    padding: var(--space-6);
}

.login-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    padding: 34px;
}

/* ── Responsive ── */
@media (max-width: 860px) {
    .auth-split {
        grid-template-columns: 1fr;
    }

    .auth-split__brand {
        min-height: auto;
        padding: 1.5rem 1.35rem 1.25rem;
        gap: 1rem;
    }

    .auth-brand__copy {
        max-width: none;
    }

    .auth-brand__title {
        font-size: 1.45rem;
    }

    .auth-brand__text,
    .auth-brand__foot {
        display: none;
    }

    .auth-split__form {
        align-items: flex-start;
        padding: 1.25rem 1rem 2rem;
    }
}
