/* ==========================================================================
   Login Page — Cinematic Split-Screen Design
   Tokens (:root avec les couleurs de branding) injectés inline dans le template Twig.
   ========================================================================== */

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg-base, #060912);
    color: var(--text);
    overflow: hidden;
}

/* ===== LAYOUT ===== */
.login-root {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
}

/* ==========================================================================
   HERO PANEL (gauche)
   ========================================================================== */

.hero-panel {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

/* Animated mesh gradient */
.hero-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 30% 20%, color-mix(in srgb, var(--primary), transparent 30%) 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 80% 80%, color-mix(in srgb, var(--secondary), transparent 35%) 0%, transparent 55%),
        radial-gradient(ellipse 50% 50% at 60% 40%, color-mix(in srgb, var(--accent), transparent 50%) 0%, transparent 50%),
        linear-gradient(145deg, #060912 0%, #0c1220 40%, #060e1a 100%);
    animation: meshShift 12s ease-in-out infinite alternate;
}

@keyframes meshShift {
    0%   { filter: hue-rotate(0deg)  brightness(1); }
    50%  { filter: hue-rotate(12deg) brightness(1.08); }
    100% { filter: hue-rotate(-8deg) brightness(0.95); }
}

/* Grid overlay */
.hero-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, black 40%, transparent 100%);
}

/* ── Floating orbs ── */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    pointer-events: none;
}
.orb-1 {
    width: 420px; height: 420px;
    background: var(--primary);
    top: -80px; left: -80px;
    animation: floatOrb1 18s ease-in-out infinite;
}
.orb-2 {
    width: 300px; height: 300px;
    background: var(--secondary);
    bottom: -60px; right: 10%;
    animation: floatOrb2 22s ease-in-out infinite;
}
.orb-3 {
    width: 200px; height: 200px;
    background: var(--accent);
    top: 50%; left: 55%;
    animation: floatOrb3 16s ease-in-out infinite;
}

@keyframes floatOrb1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%       { transform: translate(60px, 40px) scale(1.1); }
    66%       { transform: translate(-30px, 70px) scale(0.9); }
}
@keyframes floatOrb2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    40%       { transform: translate(-50px, -60px) scale(1.15); }
    70%       { transform: translate(40px, -20px) scale(0.85); }
}
@keyframes floatOrb3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50%       { transform: translate(-50%, -50%) scale(1.3) rotate(30deg); }
}

/* ── Particles ── */
.particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.particle {
    position: absolute;
    width: 3px; height: 3px;
    background: rgba(255,255,255,0.6);
    border-radius: 50%;
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0%   { transform: translateY(100vh) scale(0); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 0.6; }
    100% { transform: translateY(-10vh) scale(1.5); opacity: 0; }
}

/* ── Hero content ── */
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 520px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    font-size: 0.73rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-toned);
    margin-bottom: 2rem;
    backdrop-filter: blur(8px);
    animation: fadeUp 0.8s ease both;
}
.hero-badge .dot {
    width: 6px; height: 6px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 8px var(--accent);  transform: scale(1); }
    50%       { box-shadow: 0 0 16px var(--accent); transform: scale(1.3); }
}

.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.2rem, 4vw, 3.2rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.25rem;
    animation: fadeUp 0.8s 0.1s ease both;
}
.hero-title .gradient-text {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-toned);
    line-height: 1.7;
    margin-bottom: 3rem;
    animation: fadeUp 0.8s 0.2s ease both;
}

/* ── Stats ── */
.hero-stats {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    animation: fadeUp 0.8s 0.35s ease both;
}
.stat-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 1.1rem 1.4rem;
    text-align: center;
    backdrop-filter: blur(12px);
    transition: transform 0.3s ease, background 0.3s ease;
}
.stat-card:hover {
    transform: translateY(-4px);
    background: rgba(255,255,255,0.09);
}
.stat-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.2rem;
    font-weight: 600;
}

/* ── Role pills ── */
.role-pills {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2.5rem;
    animation: fadeUp 0.8s 0.5s ease both;
}
.role-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: var(--text-toned);
}
.role-pill i { font-size: 0.65rem; }

/* ── Shimmer line ── */
.shimmer-line {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--primary) 30%, var(--secondary) 70%, transparent 100%);
    animation: shimmerLine 3s ease-in-out infinite;
}
@keyframes shimmerLine {
    0%, 100% { opacity: 0.3; transform: scaleX(0.6); }
    50%       { opacity: 1;   transform: scaleX(1); }
}

/* ==========================================================================
   FORM PANEL (droite)
   ========================================================================== */

.form-panel {
    width: 480px;
    min-width: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    z-index: 10;
    background: rgba(6, 9, 18, 0.75);
    border-left: 1px solid var(--border);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    overflow-y: auto;
}

.login-card {
    width: 100%;
    max-width: 400px;
    animation: fadeUp 0.6s 0.15s ease both;
}

/* ── Brand header ── */
.brand-header {
    text-align: center;
    margin-bottom: 2.5rem;
}
.brand-logo {
    width: 72px; height: 72px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 22px;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.25rem;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.1), 0 12px 40px var(--primary-glow);
    animation: logoPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    position: relative;
}
.brand-logo::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 25px;
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    z-index: -1;
    opacity: 0.4;
    filter: blur(8px);
}
@keyframes logoPop {
    0%   { transform: scale(0.5) rotate(-15deg); opacity: 0; }
    70%  { transform: scale(1.05) rotate(2deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.brand-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.brand-tagline {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* ── Separator ── */
.separator {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    color: var(--text-muted);
    font-size: 0.78rem;
}
.separator::before,
.separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Form elements ── */
.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-toned);
    margin-bottom: 0.55rem;
    letter-spacing: 0.01em;
}
.form-label i {
    color: var(--primary-light);
    font-size: 0.75rem;
}

.form-field-wrap { position: relative; }

.form-control {
    width: 100%;
    padding: 0.85rem 1rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 0.92rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:focus {
    border-color: var(--primary);
    background: rgba(255,255,255,0.07);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Glow sous le champ au focus */
.input-glow {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    pointer-events: none;
    background: radial-gradient(ellipse at 50% 100%, var(--primary-glow), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.form-control:focus ~ .input-glow { opacity: 1; }

.password-toggle {
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem;
    font-size: 0.9rem;
    transition: color 0.2s;
}
.password-toggle:hover { color: var(--text-toned); }

/* ── Alert erreur ── */
.alert-error {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    color: #fca5a5;
    animation: shakeIn 0.4s ease;
}
.alert-error i {
    color: #f87171;
    margin-top: 0.05rem;
    flex-shrink: 0;
}

@keyframes shakeIn {
    0%   { transform: translateX(-8px); opacity: 0; }
    30%  { transform: translateX(6px); }
    60%  { transform: translateX(-4px); }
    100% { transform: translateX(0);   opacity: 1; }
}

/* ── Bouton connexion ── */
.btn-login {
    width: 100%;
    padding: 0.95rem;
    margin-top: 1.75rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    color: #fff;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 20px var(--primary-glow);
}
.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px var(--primary-glow);
}
.btn-login:active { transform: translateY(0); }

/* Shimmer sweep */
.btn-login::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    animation: shimmerBtn 2.5s ease-in-out infinite;
}
@keyframes shimmerBtn {
    0%   { left: -100%; }
    50%  { left:  100%; }
    100% { left:  100%; }
}

.btn-login span {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

/* ── Footer sécurité ── */
.form-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
}
.security-badges {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}
.security-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}
.security-badge i {
    color: var(--accent);
    font-size: 0.65rem;
}

/* Spinner Rotation Fix */
@keyframes fa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spin, i.fa-spin {
    display: inline-block !important;
    animation: fa-spin 0.8s linear infinite !important;
    transform-origin: center center !important;
    will-change: transform;
}

/* ── Stagger animations ── */
.form-group--email  { animation: fadeUp 0.6s 0.30s ease both; opacity: 0; animation-fill-mode: forwards; }
.form-group--pass   { animation: fadeUp 0.6s 0.42s ease both; opacity: 0; animation-fill-mode: forwards; }
.form-footer        { animation: fadeUp 0.6s 0.66s ease both; opacity: 0; animation-fill-mode: forwards; }

/* Password input avec padding pour le bouton toggle */
.form-control--password { padding-right: 3rem; }

/* ── Keyframe global ── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 900px) {
    body { overflow: auto; }

    .login-root {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    .hero-panel {
        min-height: 40vh;
        padding: 2.5rem 1.5rem;
    }
    .form-panel {
        width: 100%;
        min-width: 0;
        border-left: none;
        border-top: 1px solid var(--border);
    }
    .hero-stats { gap: 1rem; }
    .stat-card  { padding: 0.85rem 1rem; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 1.9rem; }
    .hero-stats { flex-direction: column; align-items: center; gap: 0.75rem; }
}
