﻿:root {
    --bg: #f5f3ec;
    --surface: #ffffff;
    --surface-2: #faf8f2;
    --text: #1a2332;
    --text-muted: #6b7280;
    --text-soft: #9ca3af;
    --border: #e8e3d7;
    --primary: #1e3a5f;
    --primary-hover: #2c4a73;
    --primary-soft: #e7edf3;
    --accent: #b8924a;
    --accent-hover: #a07f3d;
    --accent-soft: #f4ead4;
    --success: #2d7a5f;
    --warning: #c97c2d;
    --danger: #b94c4c;
    --info: #4a7ba5;
    --navy-deep: #15233a;
    --navy-darker: #0d1828;
    --shadow-sm: 0 1px 2px rgba(15,23,42,0.04);
    --shadow: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
    --shadow-lg: 0 24px 60px -20px rgba(15,23,42,0.25);
    --shadow-gold: 0 12px 32px -8px rgba(184,146,74,0.45);
}

[data-theme="dark"] {
    --bg: #0d141f;
    --surface: #181f2e;
    --surface-2: #1f283a;
    --text: #e8eaed;
    --text-muted: #94a3b8;
    --text-soft: #64748b;
    --border: #2a3650;
    --primary: #c9a961;
    --primary-hover: #d4b878;
    --primary-soft: #2a2418;
    --accent: #c9a961;
    --accent-hover: #d4b878;
    --accent-soft: #2a2418;
    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #f87171;
    --info: #60a5fa;
    --navy-deep: #0a0f17;
    --navy-darker: #050810;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-lg: 0 24px 60px -20px rgba(0,0,0,0.6);
    --shadow-gold: 0 12px 32px -8px rgba(201,169,97,0.35);
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    transition: background-color 0.4s ease, color 0.4s ease;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.font-serif {
    font-family: 'Fraunces', Georgia, serif;
}

/* ===== LAYOUT ===== */
.auth-wrapper {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
}

@media (max-width: 991.98px) {
    .auth-wrapper {
        grid-template-columns: 1fr;
    }
}

/* ===== BRAND PANEL (LEFT) ===== */
.brand-panel {
    position: relative;
    background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy-darker) 100%);
    color: #fff;
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

    .brand-panel::before {
        content: '';
        position: absolute;
        inset: 0;
        background-image: radial-gradient(circle at 20% 20%, rgba(184,146,74,0.18), transparent 45%), radial-gradient(circle at 80% 80%, rgba(30,58,95,0.45), transparent 50%);
        pointer-events: none;
    }

    .brand-panel::after {
        content: '';
        position: absolute;
        inset: 0;
        background-image: repeating-linear-gradient(45deg, transparent, transparent 80px, rgba(184,146,74,0.025) 80px, rgba(184,146,74,0.025) 81px), repeating-linear-gradient(-45deg, transparent, transparent 80px, rgba(184,146,74,0.025) 80px, rgba(184,146,74,0.025) 81px);
        pointer-events: none;
    }

    .brand-panel > * {
        position: relative;
        z-index: 1;
    }

.brand-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-crest {
    width: 52px;
    height: 52px;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--accent), #8b6936);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: 'Fraunces', serif;
    font-weight: 900;
    font-size: 26px;
    box-shadow: var(--shadow-gold);
    position: relative;
}

    .brand-crest::after {
        content: '';
        position: absolute;
        inset: -4px;
        border: 1px solid rgba(184,146,74,0.3);
        border-radius: 16px;
        pointer-events: none;
    }

.brand-name h1 {
    font-family: 'Fraunces', serif;
    font-weight: 700;
    font-size: 22px;
    margin: 0;
    color: #fff;
    letter-spacing: -0.01em;
}

.brand-name small {
    font-size: 10.5px;
    color: rgba(255,255,255,0.55);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-weight: 600;
}

.brand-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 56px 0;
    max-width: 520px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 22px;
}

    .eyebrow::before {
        content: '';
        width: 28px;
        height: 1px;
        background: var(--accent);
    }

.brand-headline {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: clamp(34px, 4vw, 50px);
    line-height: 1.08;
    letter-spacing: -0.025em;
    color: #fff;
    margin: 0 0 22px;
}

    .brand-headline em {
        font-style: italic;
        font-weight: 400;
        color: var(--accent);
    }

.brand-subtitle {
    font-size: 15.5px;
    line-height: 1.7;
    color: rgba(255,255,255,0.72);
    margin: 0 0 36px;
    max-width: 440px;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0 0 48px;
    display: grid;
    gap: 14px;
}

    .feature-list li {
        display: flex;
        align-items: center;
        gap: 14px;
        font-size: 14px;
        color: rgba(255,255,255,0.88);
        font-weight: 500;
    }

    .feature-list .feature-icon {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        background: rgba(184,146,74,0.15);
        border: 1px solid rgba(184,146,74,0.3);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--accent);
        font-size: 14px;
        flex-shrink: 0;
    }

.testimonial-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 22px 24px;
    backdrop-filter: blur(10px);
    max-width: 480px;
}

    .testimonial-card .quote-mark {
        font-family: 'Fraunces', serif;
        font-size: 42px;
        line-height: 0.6;
        color: var(--accent);
        margin-bottom: 8px;
        display: block;
        font-weight: 700;
    }

    .testimonial-card p {
        font-family: 'Fraunces', serif;
        font-style: italic;
        font-weight: 400;
        font-size: 15.5px;
        line-height: 1.55;
        color: rgba(255,255,255,0.92);
        margin: 0 0 16px;
    }

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

    .testimonial-author .avatar {
        width: 38px;
        height: 38px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--accent), #8b6936);
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-weight: 700;
        font-size: 13px;
        flex-shrink: 0;
    }

    .testimonial-author .info strong {
        display: block;
        font-size: 13.5px;
        color: #fff;
        font-weight: 600;
    }

    .testimonial-author .info small {
        font-size: 11.5px;
        color: rgba(255,255,255,0.55);
    }

.brand-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11.5px;
    color: rgba(255,255,255,0.45);
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

    .brand-footer .stats {
        display: flex;
        gap: 24px;
    }

    .brand-footer .stat strong {
        font-family: 'Fraunces', serif;
        font-weight: 700;
        color: var(--accent);
        font-size: 14px;
        margin-right: 4px;
    }

/* ===== FORM PANEL (RIGHT) ===== */
.form-panel {
    background: var(--bg);
    padding: 40px 56px;
    display: flex;
    flex-direction: column;
    position: relative;
}

    .form-panel::before {
        content: '';
        position: absolute;
        inset: 0;
        background-image: radial-gradient(circle at 80% 10%, rgba(184,146,74,0.05), transparent 40%), radial-gradient(circle at 20% 90%, rgba(30,58,95,0.04), transparent 40%);
        pointer-events: none;
    }

    .form-panel > * {
        position: relative;
        z-index: 1;
    }

.form-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.mobile-brand {
    display: none;
    align-items: center;
    gap: 10px;
}

    .mobile-brand .brand-crest {
        width: 38px;
        height: 38px;
        font-size: 19px;
        border-radius: 10px;
    }

        .mobile-brand .brand-crest::after {
            inset: -3px;
            border-radius: 13px;
        }

    .mobile-brand h1 {
        font-family: 'Fraunces', serif;
        font-weight: 700;
        font-size: 18px;
        margin: 0;
        color: var(--text);
    }

@media (max-width: 991.98px) {
    .mobile-brand {
        display: flex;
    }
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
}

.topbar-link {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

    .topbar-link:hover {
        color: var(--accent);
    }

.theme-toggle {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
    transition: all 0.25s ease;
    font-size: 16px;
}

    .theme-toggle:hover {
        background: var(--accent-soft);
        border-color: var(--accent);
        color: var(--accent);
        transform: translateY(-1px);
    }

    .theme-toggle i {
        transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .theme-toggle:hover i {
        transform: rotate(35deg);
    }

    .theme-toggle .moon-icon {
        display: none;
    }

[data-theme="dark"] .theme-toggle .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: block;
}

.form-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 0;
}

.form-heading {
    margin-bottom: 32px;
}

    .form-heading h2 {
        font-family: 'Fraunces', serif;
        font-weight: 600;
        font-size: 34px;
        letter-spacing: -0.025em;
        margin: 0 0 8px;
        color: var(--text);
    }

    .form-heading p {
        font-size: 14.5px;
        color: var(--text-muted);
        margin: 0;
        line-height: 1.55;
    }

        .form-heading p a {
            color: var(--accent);
            font-weight: 600;
            text-decoration: none;
            border-bottom: 1px dashed var(--accent);
            padding-bottom: 1px;
        }

            .form-heading p a:hover {
                color: var(--accent-hover);
            }

/* ===== FORM FIELDS ===== */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

    .form-label .label-link {
        font-size: 12px;
        color: var(--text-muted);
        text-transform: none;
        letter-spacing: 0;
        font-weight: 500;
        text-decoration: none;
        transition: color 0.2s ease;
    }

        .form-label .label-link:hover {
            color: var(--accent);
        }

.input-wrapper {
    position: relative;
}

    .input-wrapper .input-icon {
        position: absolute;
        left: 16px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-soft);
        font-size: 16px;
        pointer-events: none;
        transition: color 0.2s ease;
        z-index: 2;
    }

.form-control-classic {
    width: 100%;
    height: 52px;
    padding: 0 48px 0 46px;
    border: 1.5px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
    color: var(--text);
    font-size: 14.5px;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.2s ease;
}

    .form-control-classic::placeholder {
        color: var(--text-soft);
        font-weight: 400;
    }

    .form-control-classic:focus {
        outline: none;
        border-color: var(--accent);
        background: var(--surface);
        box-shadow: 0 0 0 4px var(--accent-soft);
    }

        .form-control-classic:focus + .input-icon,
        .input-wrapper:focus-within .input-icon {
            color: var(--accent);
        }

.input-wrapper .input-action {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-soft);
    cursor: pointer;
    padding: 8px;
    border-radius: 7px;
    font-size: 16px;
    transition: all 0.2s ease;
    z-index: 2;
}

    .input-wrapper .input-action:hover {
        color: var(--accent);
        background: var(--accent-soft);
    }

.form-group.has-error .form-control-classic {
    border-color: var(--danger);
}

.form-group.has-error .input-icon {
    color: var(--danger);
}

.field-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.2s ease;
    height: 0;
    overflow: hidden;
}

.form-group.has-error .field-error {
    opacity: 1;
    transform: translateY(0);
    height: auto;
    margin-top: 6px;
}

/* ===== FORM OPTIONS ===== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-classic {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 13.5px;
    color: var(--text);
    font-weight: 500;
}

    .checkbox-classic input {
        display: none;
    }

    .checkbox-classic .check-box {
        width: 20px;
        height: 20px;
        border: 1.5px solid var(--border);
        border-radius: 6px;
        background: var(--surface);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
        flex-shrink: 0;
        position: relative;
    }

    .checkbox-classic:hover .check-box {
        border-color: var(--accent);
    }

    .checkbox-classic input:checked + .check-box {
        background: var(--accent);
        border-color: var(--accent);
    }

        .checkbox-classic input:checked + .check-box::after {
            content: '';
            width: 6px;
            height: 10px;
            border: solid #fff;
            border-width: 0 2px 2px 0;
            transform: rotate(45deg) translate(-1px, -1px);
        }

.form-options .forgot-link {
    font-size: 13.5px;
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

    .form-options .forgot-link:hover {
        color: var(--accent-hover);
    }

/* ===== SUBMIT BUTTON ===== */
.btn-signin {
    width: 100%;
    height: 52px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;
    border: none;
    border-radius: 11px;
    font-size: 14.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
    box-shadow: 0 8px 20px -6px rgba(30,58,95,0.4);
}

[data-theme="dark"] .btn-signin {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: var(--navy-darker);
    box-shadow: var(--shadow-gold);
}

.btn-signin::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
}

.btn-signin:hover::before {
    left: 100%;
}

.btn-signin:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px -8px rgba(30,58,95,0.5);
}

[data-theme="dark"] .btn-signin:hover {
    box-shadow: 0 14px 28px -8px rgba(201,169,97,0.5);
}

.btn-signin:active {
    transform: translateY(0);
}

.btn-signin.loading {
    pointer-events: none;
    opacity: 0.85;
}

.btn-signin .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
}

[data-theme="dark"] .btn-signin .spinner {
    border-color: rgba(13,20,31,0.3);
    border-top-color: var(--navy-darker);
}

.btn-signin.loading .spinner {
    display: block;
}

.btn-signin.loading .btn-text,
.btn-signin.loading .btn-arrow {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== DIVIDER ===== */
.divider-or {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 28px 0;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

    .divider-or::before,
    .divider-or::after {
        content: '';
        flex: 1;
        height: 1px;
        background: var(--border);
    }

/* ===== SSO BUTTONS ===== */
.sso-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 28px;
}

.btn-sso {
    height: 48px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text);
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
}

    .btn-sso:hover {
        border-color: var(--accent);
        background: var(--surface-2);
        transform: translateY(-2px);
        box-shadow: var(--shadow);
    }

    .btn-sso svg {
        width: 18px;
        height: 18px;
    }

    .btn-sso .sso-label {
        font-size: 13px;
    }

@media (max-width: 380px) {
    .btn-sso .sso-label {
        display: none;
    }
}

/* ===== SIGNUP LINK ===== */
.signup-prompt {
    text-align: center;
    font-size: 13.5px;
    color: var(--text-muted);
    margin: 0;
}

    .signup-prompt a {
        color: var(--accent);
        font-weight: 600;
        text-decoration: none;
        margin-left: 4px;
        position: relative;
    }

        .signup-prompt a::after {
            content: '';
            position: absolute;
            left: 0;
            bottom: -2px;
            width: 0;
            height: 1px;
            background: var(--accent);
            transition: width 0.25s ease;
        }

        .signup-prompt a:hover::after {
            width: 100%;
        }

/* ===== FORM FOOTER ===== */
.form-footer {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 12px;
}

    .form-footer a {
        color: var(--text-muted);
        text-decoration: none;
        transition: color 0.2s ease;
    }

        .form-footer a:hover {
            color: var(--accent);
        }

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-classic {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 10px;
    padding: 13px 18px;
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    max-width: 360px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

    .toast-classic.success {
        border-left-color: var(--success);
    }

    .toast-classic.error {
        border-left-color: var(--danger);
    }

    .toast-classic .toast-icon {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        font-size: 15px;
    }

    .toast-classic.success .toast-icon {
        background: rgba(45,122,95,0.13);
        color: var(--success);
    }

    .toast-classic.error .toast-icon {
        background: rgba(185,76,76,0.13);
        color: var(--danger);
    }

    .toast-classic .toast-icon {
        background: var(--accent-soft);
        color: var(--accent);
    }

    .toast-classic .toast-content strong {
        display: block;
        font-size: 13.5px;
        color: var(--text);
        font-weight: 600;
    }

    .toast-classic .toast-content small {
        font-size: 12px;
        color: var(--text-muted);
    }

@keyframes slideInRight {
    from {
        transform: translateX(110%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    to {
        transform: translateX(110%);
        opacity: 0;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.6s ease backwards;
}

    .animate-in:nth-child(1) {
        animation-delay: 0.05s;
    }

    .animate-in:nth-child(2) {
        animation-delay: 0.15s;
    }

    .animate-in:nth-child(3) {
        animation-delay: 0.25s;
    }

    .animate-in:nth-child(4) {
        animation-delay: 0.35s;
    }

    .animate-in:nth-child(5) {
        animation-delay: 0.45s;
    }

/* ===== RESPONSIVE ===== */
@media (max-width: 991.98px) {
    .brand-panel {
        padding: 32px 32px;
        min-height: auto;
    }

    .brand-hero {
        padding: 32px 0;
        max-width: 100%;
    }

    .form-panel {
        padding: 32px;
    }
}

@media (max-width: 767.98px) {
    .brand-panel {
        padding: 28px 24px;
    }

    .brand-hero {
        display: none;
    }

    .brand-footer {
        display: none;
    }

    .form-panel {
        padding: 28px 24px;
        min-height: 100vh;
    }

    .form-container {
        padding: 12px 0;
    }

    .form-heading h2 {
        font-size: 28px;
    }

    .testimonial-card {
        display: none;
    }
}

@media (max-width: 480px) {
    .brand-panel {
        padding: 24px 20px;
    }

    .form-panel {
        padding: 24px 20px;
    }

    .sso-grid {
        grid-template-columns: 1fr;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
