/* ═══════════════════════════════════════════════════════════════════════════
   AUTH PAGES — Modern Split Layout
   Visual panel (left) + Form panel (right)
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --auth-primary: #004b89;
    --auth-primary-dark: #003262;
    --auth-accent: #31ce47;
    --auth-accent-soft: rgba(49, 206, 71, 0.15);
    --auth-bg: #f8fafc;
    --auth-card-bg: #ffffff;
    --auth-text: #1e293b;
    --auth-text-muted: #64748b;
    --auth-border: #e2e8f0;
    --auth-input-bg: #f1f5f9;
    --auth-input-focus-bg: #ffffff;
    --auth-radius: 12px;
    --auth-radius-lg: 16px;
    --auth-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --auth-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.08);
    --auth-transition: all 0.2s ease;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
.auth-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--auth-bg);
    font-family:
        'Inter',
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        Roboto,
        sans-serif;
    overflow-x: hidden;
}

/* ── Wrapper ────────────────────────────────────────────────────────────── */
.auth-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LEFT VISUAL PANEL
   ═══════════════════════════════════════════════════════════════════════════ */
.auth-visual {
    position: relative;
    width: 52%;
    min-height: 100vh;
    background: linear-gradient(
        135deg,
        var(--auth-primary-dark) 0%,
        var(--auth-primary) 50%,
        #0a6bab 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

/* Animated gradient overlay */
.auth-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(49, 206, 71, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(10, 107, 171, 0.3) 0%, transparent 50%);
    z-index: 1;
}

/* Decorative floating shapes */
.auth-visual-decoration {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.auth-visual-decoration::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    top: -80px;
    right: -60px;
    animation: float-slow 20s ease-in-out infinite;
}

.auth-visual-decoration::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(49, 206, 71, 0.06);
    bottom: 10%;
    left: -40px;
    animation: float-slow 15s ease-in-out infinite reverse;
}

@keyframes float-slow {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-30px) rotate(5deg);
    }
}

/* Dot pattern */
.auth-visual-dots {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0.04;
    background-image: radial-gradient(circle, #fff 1px, transparent 1px);
    background-size: 24px 24px;
}

/* Content */
.auth-visual-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 3rem;
    max-width: 440px;
}

.auth-visual-title-logo {
    height: 64px;
    margin-bottom: 1.5rem;
    opacity: 0.95;
    background: #ffffff;
    border-radius: 25px;
    padding: 8px 16px;
}

.auth-visual-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 3rem;
    line-height: 1.6;
    font-weight: 400;
}

/* Feature pills */
.auth-visual-features {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.auth-visual-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50px;
    padding: 0.5rem 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--auth-transition);
}

.auth-visual-feature i {
    font-size: 1rem;
    color: var(--auth-accent);
}

.auth-visual-feature:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-2px);
}

/* Bottom copyright */
.auth-visual-footer {
    position: absolute;
    bottom: 2rem;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 2;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.8rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RIGHT FORM PANEL
   ═══════════════════════════════════════════════════════════════════════════ */
.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--auth-bg);
    overflow-y: auto;
}

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

/* Logo (mobile / top of form) */
.auth-form-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-form-logo img {
    height: 36px;
}

/* Header */
.auth-form-header {
    margin-bottom: 2rem;
}

.auth-form-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--auth-text);
    margin-bottom: 0.5rem;
    letter-spacing: -0.3px;
}

.auth-form-header p {
    font-size: 0.95rem;
    color: var(--auth-text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Form card */
.auth-form-card {
    background: var(--auth-card-bg);
    border-radius: var(--auth-radius-lg);
    padding: 2.5rem;
    box-shadow: var(--auth-shadow-lg);
    border: 1px solid var(--auth-border);
}

/* ── Form elements ──────────────────────────────────────────────────────── */
.auth-field {
    margin-bottom: 1.25rem;
}

.auth-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--auth-text);
    margin-bottom: 0.4rem;
    letter-spacing: 0.01em;
}

.auth-field .form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    border: 1.5px solid var(--auth-border);
    border-radius: var(--auth-radius);
    background: var(--auth-input-bg);
    color: var(--auth-text);
    transition: var(--auth-transition);
    outline: none;
    box-shadow: none;
}

.auth-field .form-control::placeholder {
    color: #94a3b8;
}

.auth-field .form-control:focus {
    background: var(--auth-input-focus-bg);
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgba(0, 75, 137, 0.1);
}

/* Submit button */
.auth-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-primary-dark) 100%);
    border: none;
    border-radius: var(--auth-radius);
    cursor: pointer;
    transition: var(--auth-transition);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
}

.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 75, 137, 0.35);
}

.auth-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 75, 137, 0.25);
}

.auth-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Links */
.auth-link {
    display: inline-block;
    font-size: 0.88rem;
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--auth-transition);
}

.auth-link:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
}

.auth-form-footer {
    text-align: right;
    margin-top: 1rem;
}

/* Alerts */
.auth-form-card .alert {
    border-radius: var(--auth-radius);
    font-size: 0.9rem;
    border: none;
    padding: 0.75rem 1rem;
}

.auth-form-card .alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border-left: 3px solid #ef4444;
}

.auth-form-card .alert-success {
    background: #f0fdf4;
    color: #166534;
    border-left: 3px solid #22c55e;
}

.auth-form-card .alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-left: 3px solid #f59e0b;
}

/* Separator */
.auth-separator {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--auth-text-muted);
    font-size: 0.85rem;
}

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

/* ── 2FA specific ───────────────────────────────────────────────────────── */
.auth-2fa-qr {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-2fa-qr img {
    width: 200px;
    height: 200px;
    border-radius: var(--auth-radius);
    border: 2px solid var(--auth-border);
    padding: 8px;
    background: #fff;
}

.auth-2fa-secret {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-2fa-secret h6 {
    font-size: 0.85rem;
    color: var(--auth-text-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.auth-2fa-secret code {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    background: var(--auth-input-bg);
    border-radius: var(--auth-radius);
    font-size: 0.95rem;
    color: var(--auth-primary);
    font-weight: 600;
    letter-spacing: 1px;
    border: 1px solid var(--auth-border);
}

.auth-2fa-input .form-control {
    max-width: 220px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 8px;
    padding: 0.8rem 1rem;
    color: var(--auth-primary);
    border: 2px solid var(--auth-border);
}

.auth-2fa-input .form-control:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgba(0, 75, 137, 0.1);
}

.auth-2fa-input label {
    display: block;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--auth-text-muted);
    margin-bottom: 0.5rem;
}

/* Provider selector */
.auth-2fa-providers {
    margin-bottom: 1.5rem;
}

/* Cancel link */
.auth-cancel {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--auth-border);
}

.auth-cancel a {
    font-size: 0.88rem;
    color: var(--auth-text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: var(--auth-transition);
}

.auth-cancel a:hover {
    color: #ef4444;
}

/* Password error box */
.auth-password-error {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.auth-password-error ul {
    margin: 0;
    padding-left: 1.2rem;
}

.auth-password-error li {
    color: #dc2626;
    margin-bottom: 0.15rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 991.98px) {
    .auth-wrapper {
        flex-direction: column;
    }

    .auth-visual {
        width: 100%;
        min-height: 280px;
        padding: 2rem 1.5rem;
    }

    .auth-visual-title {
        font-size: 1.8rem;
    }

    .auth-visual-subtitle {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .auth-visual-features {
        gap: 0.5rem;
    }

    .auth-visual-feature {
        padding: 0.4rem 0.8rem;
        font-size: 0.78rem;
    }

    .auth-visual-footer {
        display: none;
    }

    .auth-form-panel {
        padding: 1.5rem;
    }

    .auth-form-card {
        padding: 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .auth-visual {
        min-height: 200px;
        padding: 1.5rem 1rem;
    }

    .auth-visual-content {
        padding: 1rem;
    }

    .auth-visual-title {
        font-size: 1.5rem;
    }

    .auth-visual-logo {
        height: 32px;
        margin-bottom: 1rem;
    }

    .auth-form-panel {
        padding: 1rem;
    }

    .auth-form-card {
        padding: 1.25rem;
        border-radius: var(--auth-radius);
    }

    .auth-form-header h2 {
        font-size: 1.3rem;
    }
}

/* ── Dark mode support (optional) ───────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
    /* Keep light mode for auth pages for now — uncomment to enable dark */
    /*
    :root {
        --auth-bg: #0f172a;
        --auth-card-bg: #1e293b;
        --auth-text: #f1f5f9;
        --auth-text-muted: #94a3b8;
        --auth-border: #334155;
        --auth-input-bg: #0f172a;
        --auth-input-focus-bg: #1e293b;
    }
    */
}
