/* ================================================
   Znox — Auth / Guest Layout CSS
   Matches: deep navy + indigo + amber design system
   Fonts: Familjen Grotesk (display) + Plus Jakarta Sans (body)
   ================================================ */

/* ---- Auth Body ---- */
.auth-body {
    min-height: 100vh;
    background: var(--clr-bg);
    display: flex;
    flex-direction: column;
}

/* ---- Split Layout ---- */
.auth-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* ==============================
   LEFT PANEL — Brand/Marketing
   ============================== */
.auth-brand-panel {
    position: relative;
    background: var(--grad-hero);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-16) var(--sp-12);
    overflow: hidden;
}

/* Dot-grid texture */
.auth-brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}

/* Glow orbs */
.auth-brand-panel::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 91, 219, .30), transparent 65%);
    top: -120px;
    left: -100px;
    pointer-events: none;
    filter: blur(60px);
}

.auth-brand-orb {
    position: absolute;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 158, 11, .12), transparent 65%);
    bottom: -60px;
    right: -80px;
    filter: blur(70px);
    pointer-events: none;
}

.auth-brand-content {
    position: relative;
    z-index: 1;
    max-width: 440px;
}

/* Logo */
.auth-logo {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-10);
    text-decoration: none;
}

.logo-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--grad-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.2rem;
    color: #fff;
    box-shadow: 0 4px 20px rgba(59, 91, 219, .4);
    flex-shrink: 0;
}

.auth-logo-text {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
}

.auth-logo-text em {
    font-style: normal;
    color: #FBBF24;
}

/* Headline */
.auth-headline {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.12;
    letter-spacing: -0.03em;
    margin-bottom: var(--sp-5);
}

.auth-subheadline {
    font-size: .96rem;
    color: rgba(255, 255, 255, .58);
    line-height: 1.75;
    max-width: 380px;
    margin-bottom: var(--sp-10);
}

/* Feature list */
.auth-features {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}

.auth-feature {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-4);
    padding: var(--sp-4) var(--sp-5);
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: var(--r-md);
    backdrop-filter: blur(8px);
    transition: background var(--transition), border-color var(--transition);
}

.auth-feature:hover {
    background: rgba(59, 91, 219, .12);
    border-color: rgba(59, 91, 219, .3);
}

.auth-feature-icon {
    font-size: 1.3rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.auth-feature-title {
    font-family: var(--font-display);
    font-size: .9rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
}

.auth-feature-desc {
    font-size: .8rem;
    color: rgba(255, 255, 255, .48);
    line-height: 1.5;
}

/* Bottom tagline bar */
.auth-brand-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--sp-5) var(--sp-12);
    display: flex;
    align-items: center;
    gap: var(--sp-5);
    border-top: 1px solid rgba(255, 255, 255, .07);
    z-index: 1;
}

.auth-stat {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.auth-stat-num {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}

.auth-stat-label {
    font-size: .7rem;
    color: rgba(255, 255, 255, .4);
    font-weight: 500;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.auth-stat-divider {
    width: 1px;
    height: 32px;
    background: rgba(255, 255, 255, .1);
    flex-shrink: 0;
}

/* ==============================
   RIGHT PANEL — Form
   ============================== */
.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-12) var(--sp-8);
    background: var(--clr-bg);
    overflow-y: auto;
}

.auth-form-wrap {
    width: 100%;
    max-width: 420px;
}

/* Fade-in animation */
.fade-in {
    animation: authFadeIn 0.45s ease both;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-form-header {
    margin-bottom: var(--sp-8);
}

/* Small logo shown on mobile (right panel only) */
.auth-mobile-logo {
    display: none;
    align-items: center;
    gap: var(--sp-2);
    margin-bottom: var(--sp-8);
    text-decoration: none;
}

.auth-mobile-logo .logo-mark {
    width: 34px;
    height: 34px;
    font-size: 1rem;
    border-radius: 9px;
}

.auth-mobile-logo-text {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--clr-navy);
    letter-spacing: -0.02em;
}

.auth-mobile-logo-text em {
    font-style: normal;
    color: var(--clr-primary);
}

.auth-form-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 1.9rem);
    font-weight: 800;
    color: var(--clr-navy);
    letter-spacing: -0.03em;
    margin-bottom: var(--sp-2);
}

.auth-form-sub {
    font-size: .9rem;
    color: var(--clr-text-muted);
    line-height: 1.6;
}

/* ---- Auth Form Elements ---- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--sp-5);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.form-label {
    font-size: .84rem;
    font-weight: 700;
    color: var(--clr-text);
    letter-spacing: 0;
}

.form-label-optional {
    font-weight: 400;
    color: var(--clr-text-muted);
    font-size: .78rem;
}

.form-input {
    width: 100%;
    padding: .72rem var(--sp-4);
    background: var(--clr-surface);
    border: 1.5px solid var(--clr-border-2);
    border-radius: var(--r-md);
    color: var(--clr-text);
    font-family: var(--font-body);
    font-size: .92rem;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    appearance: none;
    outline: none;
}

.form-input::placeholder {
    color: var(--clr-text-dim);
}

.form-input:focus {
    border-color: var(--clr-primary);
    box-shadow: 0 0 0 3px rgba(59, 91, 219, .12);
    background: #fff;
}

.form-input.is-error {
    border-color: var(--clr-red);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .10);
}

.form-input.is-error:focus {
    border-color: var(--clr-red);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .15);
}

.form-error-text {
    font-size: .78rem;
    color: var(--clr-red);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--sp-1);
}

.form-error-text::before {
    content: '⚠';
    font-size: .7rem;
}

.form-link {
    color: var(--clr-primary);
    font-weight: 700;
    text-decoration: none;
    transition: opacity var(--transition);
}

.form-link:hover {
    opacity: .75;
    text-decoration: underline;
}

/* Two-column form row */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-4);
}

/* Password toggle */
.input-password-wrap {
    position: relative;
}

.input-password-wrap .form-input {
    padding-right: 2.8rem;
}

.password-toggle {
    position: absolute;
    right: .85rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--clr-text-dim);
    padding: .2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-sm);
    transition: color var(--transition);
}

.password-toggle:hover {
    color: var(--clr-text-muted);
}

.password-toggle:focus-visible {
    outline: 2px solid var(--clr-primary);
    outline-offset: 2px;
}

/* Checkbox */
.checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--clr-primary);
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 4px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: .7rem 1.6rem;
    border-radius: var(--r-full);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: .92rem;
    letter-spacing: .01em;
    cursor: pointer;
    transition: all var(--transition-md);
    white-space: nowrap;
    border: 2px solid transparent;
    text-decoration: none;
}

.btn:focus-visible {
    outline: 2px solid var(--clr-primary);
    outline-offset: 3px;
}

.btn-primary {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: 0 4px 16px rgba(59, 91, 219, .28);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(59, 91, 219, .38);
    filter: brightness(1.06);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    border-color: var(--clr-border-2);
    color: var(--clr-text);
}

.btn-outline:hover {
    border-color: var(--clr-primary);
    color: var(--clr-primary);
    background: var(--clr-primary-lt);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-lg {
    padding: .85rem 2rem;
    font-size: .97rem;
}

.btn svg {
    flex-shrink: 0;
    transition: transform var(--transition-md);
}

.btn:hover svg {
    transform: translateX(3px);
}

/* ---- Alerts ---- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--r-md);
    font-size: .88rem;
    font-weight: 500;
    line-height: 1.55;
    border: 1.5px solid transparent;
}

.alert-icon {
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-error {
    background: rgba(239, 68, 68, .07);
    border-color: rgba(239, 68, 68, .2);
    color: #B91C1C;
}

.alert-success {
    background: rgba(16, 185, 129, .07);
    border-color: rgba(16, 185, 129, .2);
    color: #065F46;
}

.alert-info {
    background: rgba(59, 91, 219, .07);
    border-color: rgba(59, 91, 219, .18);
    color: var(--clr-primary);
}

/* ---- Form Footer ---- */
.auth-form-footer {
    margin-top: var(--sp-6);
    text-align: center;
    font-size: .88rem;
    color: var(--clr-text-muted);
}

.auth-form-footer a {
    color: var(--clr-primary);
    font-weight: 700;
    transition: opacity var(--transition);
}

.auth-form-footer a:hover {
    opacity: .75;
    text-decoration: underline;
}

/* ---- Divider ---- */
.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    font-size: .75rem;
    font-weight: 700;
    color: var(--clr-text-dim);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--clr-border-2);
}

/* ---- OTP / Code Input ---- */
.otp-inputs {
    display: flex;
    gap: var(--sp-3);
    justify-content: center;
}

.otp-input {
    width: 52px;
    height: 56px;
    text-align: center;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0;
    border: 1.5px solid var(--clr-border-2);
    border-radius: var(--r-md);
    background: var(--clr-surface);
    color: var(--clr-navy);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.otp-input:focus {
    border-color: var(--clr-primary);
    box-shadow: 0 0 0 3px rgba(59, 91, 219, .12);
}

.otp-input.filled {
    border-color: var(--clr-primary);
    background: var(--clr-primary-lt);
}

/* ---- Password Strength ---- */
.strength-meter {
    margin-top: var(--sp-2);
}

.strength-track {
    height: 4px;
    background: var(--clr-surface-3);
    border-radius: var(--r-full);
    overflow: hidden;
    margin-bottom: var(--sp-1);
}

.strength-fill {
    height: 100%;
    width: 0;
    border-radius: var(--r-full);
    transition: width .3s ease, background .3s ease;
}

.strength-label {
    font-size: .73rem;
    color: var(--clr-text-dim);
    font-weight: 600;
}

/* ---- Forgot / Reset specific ---- */
.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: .84rem;
    color: var(--clr-text-muted);
    font-weight: 600;
    margin-bottom: var(--sp-8);
    transition: color var(--transition);
    text-decoration: none;
}

.auth-back-link:hover {
    color: var(--clr-primary);
}

.auth-back-link svg {
    transition: transform var(--transition-md);
}

.auth-back-link:hover svg {
    transform: translateX(-3px);
}

.auth-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: var(--r-lg);
    background: var(--clr-primary-lt);
    border: 1.5px solid rgba(59, 91, 219, .2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: var(--sp-5);
}

.auth-email-sent {
    text-align: center;
    padding: var(--sp-8) 0;
}

.auth-email-sent .auth-icon-wrap {
    margin: 0 auto var(--sp-5);
    background: rgba(16, 185, 129, .08);
    border-color: rgba(16, 185, 129, .2);
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .auth-split {
        grid-template-columns: 1fr;
    }

    .auth-brand-panel {
        display: none;
    }

    .auth-form-panel {
        min-height: 100vh;
        padding: var(--sp-10) var(--sp-6);
    }

    .auth-mobile-logo {
        display: flex;
    }
}

@media (max-width: 480px) {
    .auth-form-panel {
        padding: var(--sp-8) var(--sp-4);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .otp-inputs {
        gap: var(--sp-2);
    }

    .otp-input {
        width: 44px;
        height: 50px;
        font-size: 1.2rem;
    }
}