@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --auth-bg: #070a13;
    --auth-card-bg: rgba(15, 23, 42, 0.72);
    --auth-card-border: rgba(255, 255, 255, 0.1);
    --auth-card-border-hover: rgba(99, 102, 241, 0.4);
    --auth-input-bg: rgba(11, 17, 32, 0.85);
    --auth-input-border: rgba(255, 255, 255, 0.12);
    --auth-input-focus: #6366f1;
    --auth-primary: #4f46e5;
    --auth-primary-light: #6366f1;
    --auth-cyan: #06b6d4;
    --auth-emerald: #10b981;
    --auth-purple: #8b5cf6;
    --auth-text: #f8fafc;
    --auth-text-muted: #94a3b8;
    --auth-text-dim: #64748b;
    --auth-glow-primary: rgba(99, 102, 241, 0.35);
    --auth-glow-cyan: rgba(6, 182, 212, 0.25);
    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    box-sizing: border-box;
}

body.auth-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--auth-bg);
    color: var(--auth-text);
    position: relative;
    overflow-x: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
}

/* Grille futuriste de fond */
.auth-grid-pattern {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
        linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 32px 32px, 96px 96px, 96px 96px;
    pointer-events: none;
    z-index: 1;
}

/* Orbes lumineux en arrière-plan */
.auth-ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.65;
}

.glow-1 {
    top: -120px;
    left: -100px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.45) 0%, rgba(79, 70, 229, 0.15) 60%, transparent 80%);
    animation: pulseGlow1 14s ease-in-out infinite alternate;
}

.glow-2 {
    bottom: -150px;
    right: -100px;
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.35) 0%, rgba(14, 165, 233, 0.12) 60%, transparent 80%);
    animation: pulseGlow2 18s ease-in-out infinite alternate;
}

.glow-3 {
    top: 40%;
    left: 30%;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.25) 0%, transparent 70%);
    animation: pulseGlow3 22s ease-in-out infinite alternate;
}

@keyframes pulseGlow1 {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.18) translate(60px, 40px); }
}

@keyframes pulseGlow2 {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.15) translate(-50px, -50px); }
}

@keyframes pulseGlow3 {
    0% { transform: scale(0.9) translate(0, 0); }
    100% { transform: scale(1.2) translate(30px, -30px); }
}

/* Conteneur principal */
.auth-wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.25rem;
}

/* Carte Glassmorphism principale */
.auth-main-card {
    background: var(--auth-card-bg);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid var(--auth-card-border);
    border-radius: 24px;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.65),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 1px rgba(255, 255, 255, 0.15);
    overflow: hidden;
    transition: var(--transition);
}

/* Colonne Gauche - Vitrine & Identité */
.auth-hero-pane {
    padding: 3.5rem 3rem;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.45) 0%, rgba(15, 23, 42, 0.8) 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 1rem;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 9999px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #a5b4fc;
    letter-spacing: 0.02em;
    width: fit-content;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}

.auth-brand-badge .pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #34d399;
    box-shadow: 0 0 10px #34d399;
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.auth-hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.35rem;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, #ffffff 30%, #a5b4fc 70%, #38bdf8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-hero-desc {
    color: var(--auth-text-muted);
    font-size: 0.98rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Métriques dynamiques */
.auth-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2.2rem;
}

.auth-stat-box {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.1rem 0.9rem;
    text-align: center;
    transition: var(--transition);
}

.auth-stat-box:hover {
    transform: translateY(-3px);
    border-color: rgba(99, 102, 241, 0.35);
    background: rgba(30, 41, 59, 0.6);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3);
}

.auth-stat-num {
    font-family: 'Outfit', sans-serif;
    font-size: 1.55rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
    margin-bottom: 0.35rem;
}

.auth-stat-label {
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--auth-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Feature tags */
.auth-features-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.auth-feature-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.4rem 0.85rem;
    border-radius: 10px;
    transition: var(--transition);
}

.auth-feature-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.auth-feature-pill i {
    color: var(--auth-cyan);
}

/* Colonne Droite - Formulaire d'authentification */
.auth-form-pane {
    padding: 3.5rem 3.2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
}

.auth-card-header {
    margin-bottom: 2.2rem;
}

.auth-logo-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #ffffff;
    margin-bottom: 1.4rem;
    box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.5);
}

.auth-form-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.85rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 0.4rem 0;
    letter-spacing: -0.01em;
}

.auth-form-subtitle {
    color: var(--auth-text-muted);
    font-size: 0.92rem;
    margin: 0;
}

/* Alertes stylisées */
.auth-alert {
    padding: 0.9rem 1.1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: shakeAlert 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.auth-alert-danger {
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.35);
    color: #fca5a5;
}

@keyframes shakeAlert {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Groupes d'inputs */
.auth-input-group {
    margin-bottom: 1.4rem;
}

.auth-label {
    display: block;
    font-size: 0.84rem;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 0.55rem;
    letter-spacing: 0.01em;
}

.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 1.1rem;
    color: var(--auth-text-dim);
    font-size: 1.15rem;
    pointer-events: none;
    transition: var(--transition);
}

.auth-input {
    width: 100%;
    background-color: var(--auth-input-bg);
    border: 1px solid var(--auth-input-border);
    border-radius: 14px;
    padding: 0.88rem 1.1rem 0.88rem 3rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: #ffffff;
    transition: var(--transition);
    outline: none;
}

.auth-input::placeholder {
    color: #475569;
}

.auth-input:hover {
    border-color: rgba(255, 255, 255, 0.22);
}

.auth-input:focus {
    background-color: rgba(15, 23, 42, 0.95);
    border-color: var(--auth-primary-light);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.auth-input-wrapper:focus-within .auth-input-icon {
    color: var(--auth-primary-light);
}

/* Bouton toggle password */
.auth-toggle-pwd {
    position: absolute;
    right: 0.85rem;
    background: transparent;
    border: none;
    color: var(--auth-text-dim);
    font-size: 1.15rem;
    cursor: pointer;
    padding: 0.4rem 0.5rem;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-toggle-pwd:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

/* Actions sous inputs */
.auth-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.8rem;
    font-size: 0.85rem;
}

.auth-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--auth-text-muted);
    cursor: pointer;
    user-select: none;
}

.auth-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.6);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.auth-checkbox:checked {
    background-color: var(--auth-primary);
    border-color: var(--auth-primary);
}

.auth-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.auth-forgot-link {
    color: #a5b4fc;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.auth-forgot-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Bouton de connexion lumineux */
.auth-submit-btn {
    width: 100%;
    padding: 0.95rem 1.5rem;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 50%, #0284c7 100%);
    background-size: 200% 200%;
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 
        0 10px 25px -5px rgba(79, 70, 229, 0.5),
        inset 0 1px 1px rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
}

.auth-submit-btn:hover {
    background-position: right center;
    transform: translateY(-2px);
    box-shadow: 
        0 15px 30px -5px rgba(79, 70, 229, 0.65),
        0 0 20px rgba(6, 182, 212, 0.35);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

.auth-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.auth-security-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--auth-text-dim);
    font-size: 0.78rem;
    text-align: center;
}

.auth-security-footer i {
    color: #34d399;
}

/* Spinner de chargement */
.auth-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .auth-hero-pane {
        padding: 2.5rem 2rem;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    .auth-hero-title {
        font-size: 1.95rem;
    }
    .auth-form-pane {
        padding: 2.5rem 2rem;
    }
    .auth-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 575.98px) {
    .auth-wrapper {
        padding: 1rem 0.75rem;
    }
    .auth-main-card {
        border-radius: 18px;
    }
    .auth-hero-pane {
        padding: 2rem 1.5rem;
    }
    .auth-form-pane {
        padding: 2rem 1.5rem;
    }
    .auth-stats-grid {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }
    .auth-stat-box {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.8rem 1.2rem;
        text-align: left;
    }
    .auth-stat-num {
        margin-bottom: 0;
        font-size: 1.35rem;
    }
}
