﻿/* ======================================================
   QBOX IDENTITY – FINAL STABLE AUTH SYSTEM
   Based on original Foundation version (improved)
====================================================== */


/* ======================================================
   BASE
====================================================== */

.auth-body {
    min-height: 100vh;
    background: var(--surface-1);
    color: var(--text-primary);
}

/* Prevent theme-level background graphics */
.auth-body {
    background-image: none !important;
}


/* ======================================================
   LAYOUT (Updated to auth-shell)
====================================================== */

.auth-shell {
    display: grid;
    grid-template-columns: 1.05fr 550px;
    min-height: 100vh;
}

    .auth-shell.compact {
        grid-template-columns: 1fr 480px;
    }


/* ======================================================
   LEFT – BRAND SPACE
====================================================== */

.auth-left {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6) var(--space-8);
    background: radial-gradient(circle at 15% 20%, rgba(99,102,241,.08), transparent 45%), radial-gradient(circle at 90% 70%, rgba(139,92,246,.06), transparent 40%), linear-gradient( 180deg, #ffffff, #f8fafc);
    position: relative;
    overflow: hidden;
}

    .auth-left::before {
        content: "";
        position: absolute;
        inset: 0;
        background-image: linear-gradient( rgba(99,102,241,.02) 1px, transparent 1px), linear-gradient( 90deg, rgba(99,102,241,.02) 1px, transparent 1px);
        background-size: 64px 64px;
        pointer-events: none;
    }

.auth-left-inner,
.left-inner {
    width: 100%;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

/* If hero not defined, center vertically */
.auth-left-inner {
    justify-content: space-between;
}

.hero-logo {
    animation: floatLogo 8s ease-in-out infinite;
}


.hero-logo img {
    width: var(--space-8);
    height: var(--space-8);
}

@keyframes floatLogo {

    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }

    100% {
        transform: translateY(0);
    }
}

.hero-title {
    color: var(--text-primary);
    font-size: clamp(54px,5vw,72px);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    margin: 0;
}

.hero-caption {
    margin-top: var(--space-3);
    font-size: var(--text-xl);
    font-weight: 500;
    color: var(--text-primary);
}

.hero-subtitle {
    margin-top: var(--space-5);
    max-width: 520px;
    font-size: var(--text-xl);
    line-height: 1.75;
    color: var(--text-secondary);
}


/* ======================================================
   RIGHT – AUTH PANEL
====================================================== */

.auth-right {
    background: linear-gradient(180deg, var(--surface-1), var(--surface-2));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    border-left: 1px solid var(--border-default);
}


/* ======================================================
   CARD – FOUNDATION ELEVATION (Original Density)
====================================================== */

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--surface-0);
    padding: var(--space-6) var(--space-7);
    border-radius: var(--radius-xl);
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(var(--space-3));
    box-shadow: var(--shadow-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

    .auth-card > * + * {
        margin-top: 0;
    }


/* ======================================================
   HEADER
====================================================== */

.auth-card-header h2 {
    margin-bottom: var(--space-2);
    font-size: var(--text-3xl);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.muted-text {
    margin-top: var(--space-1);
    font-size: var(--text-xs);
    letter-spacing: 0.02em;
    color: var(--text-secondary);
}


/* ======================================================
   SSO SECTION (RESTORED)
====================================================== */

.sso-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--surface-1);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
}


/* ======================================================
   FORM
====================================================== */

.form-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

    .form-field label {
        font-size: var(--text-xs);
        font-weight: 600;
        letter-spacing: 0.02em;
    }


/* ======================================================
   INPUTS
====================================================== */

.input {
    width: 100%;
    padding: var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-strong);
    background: var(--surface-0);
    font-size: var(--text-sm);
    transition: all var(--motion-fast);
}

    .input:hover {
        border-color: var(--brand-primary);
    }

    .input:focus {
        border-color: var(--brand-primary);
        box-shadow: 0 0 0 4px rgba(99,102,241,0.12);
        background: var(--surface-0);
    }


/* ======================================================
   BUTTONS
====================================================== */

.auth-card .btn {
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    padding: var(--space-3) var(--space-5);
}

.auth-card .btn-primary {
    background: var(--gradient-brand);
    color: var(--text-inverse);
    box-shadow: 0 12px 24px rgba(99,102,241,0.28);
}

    .auth-card .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 18px 32px rgba(99,102,241,0.32);
    }

.auth-card .btn-outline {
    background: var(--surface-0);
    border: 1px solid var(--brand-primary);
    color: var(--brand-primary);
}

    .auth-card .btn-outline:hover {
        background: var(--brand-overlay-light);
    }


/* ======================================================
   SSO BUTTON SYSTEM
====================================================== */

.btn-sso {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    font-weight: 600;
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-6);
    transition: all var(--motion-fast);
}

    .btn-sso:hover {
        transform: translateY(-1px);
        border-color: var(--brand-primary);
        box-shadow: 0 8px 18px rgba(15,23,42,.05);
    }

.sso-icon img {
    width: 18px;
    height: 18px;
}

.btn-google {
    background: #ffffff;
    border: 1px solid #dadce0;
    color: #3c4043;
}

    .btn-google:hover {
        background: #f7f8f8;
        border-color: #c6c6c6;
    }

.btn-microsoft {
    background: #ffffff;
    border: 1px solid #d1d5db;
    color: #1f2937;
}

    .btn-microsoft:hover {
        background: #f3f4f6;
    }

.btn-enterprise {
    background: var(--surface-0);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
}

    .btn-enterprise:hover {
        background: var(--surface-1);
        border-color: var(--brand-primary);
    }


/* ======================================================
   DIVIDER
====================================================== */

.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin: var(--space-2) 0;
}

    .auth-divider::before,
    .auth-divider::after {
        content: "";
        flex: 1;
        height: 1px;
        background: var(--border-default);
    }


/* ======================================================
   LINKS
====================================================== */

.auth-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    justify-content: center;
    margin-top: var(--space-5);
}

    .auth-links a {
        color: var(--brand-primary);
        text-decoration: none;
        font-weight: 500;
        transition: color var(--motion-fast);
        opacity: 0.85;
    }

        .auth-links a:hover {
            color: var(--brand-secondary);
            text-decoration: underline;
        }


/* ======================================================
   STEPS
====================================================== */

.auth-step {
    display: none;
    flex-direction: column;
}

    .auth-step.active {
        display: flex;
        gap: var(--space-3);
    }


/* ======================================================
   VALIDATION
====================================================== */

.validation-summary {
    font-size: var(--text-xs);
    color: var(--color-danger);
}

.validation-error {
    background: rgba(220,38,38,0.08);
    padding: var(--space-2);
    border-radius: var(--radius-sm);
}


/* ======================================================
   FOOTER
====================================================== */

.auth-footer {
    margin-top: var(--space-8);
    text-align: center;
}

.auth-footer-links {
    display: flex;
    justify-content: center;
    gap: var(--space-6);
    font-size: var(--text-sm);
}

    .auth-footer-links a {
        color: var(--text-secondary);
        text-decoration: none;
    }

        .auth-footer-links a:hover {
            color: var(--text-primary);
            text-decoration: underline;
        }


/* ======================================================
   RESPONSIVE
====================================================== */

@media (max-width: 1200px) {

    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-left {
        display: none;
    }

    .auth-right {
        padding: var(--space-8) var(--space-4);
        border-left: none;
    }
}
