/* ╔══════════════════════════════════════════════════════════╗
   ║  LibExplorer — CSS Authentification                      ║
   ║  Layout split : panneau déco gauche + formulaire droit   ║
   ╚══════════════════════════════════════════════════════════╝ */

/* ── Layout principal ───────────────────────────────────────────────────────── */
.auth-body {
    background: var(--color-bg);
    min-height: 100vh;
}

.auth-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

@media (max-width: 900px) {
    .auth-layout {
        grid-template-columns: 1fr;
    }
}

/* ── Panneau gauche décoratif ───────────────────────────────────────────────── */
.auth-panel {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@media (max-width: 900px) {
    .auth-panel { display: none; }
}

.auth-panel__bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 120% 80% at 30% 20%, rgba(255,45,107,0.3) 0%, transparent 60%),
        radial-gradient(ellipse 80% 60% at 80% 80%, rgba(155,89,182,0.2) 0%, transparent 50%),
        linear-gradient(160deg, #0f0f1a 0%, #0A0A0A 100%);
}

/* Grille décorative */
.auth-panel__bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,45,107,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,45,107,0.06) 1px, transparent 1px);
    background-size: 50px 50px;
}

.auth-panel__content {
    position: relative;
    z-index: 1;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: center;
}

.auth-logo {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 900;
    color: white;
    text-decoration: none;
    margin-bottom: 3rem;
    display: inline-block;
}

.auth-logo span { color: var(--color-primary); }

.auth-panel__tagline h2 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 800;
    color: white;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.auth-panel__tagline p {
    color: var(--color-text-muted);
    font-size: 1rem;
    line-height: 1.7;
    max-width: 380px;
}

/* Stats */
.auth-panel__stats {
    display: flex;
    gap: 2rem;
    margin: 2.5rem 0;
    padding: 1.5rem;
    background: rgba(255,255,255,0.04);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    backdrop-filter: blur(10px);
}

.auth-stat__value {
    display: block;
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--color-primary);
    line-height: 1;
}

.auth-stat__label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

/* Features */
.auth-panel__features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.auth-feature i {
    color: var(--color-primary);
    width: 20px;
    font-size: 1rem;
}

/* ── Panneau droit (formulaire) ─────────────────────────────────────────────── */
.auth-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    min-height: 100vh;
    background: var(--color-bg);
    overflow-y: auto;
}

.auth-logo-mobile {
    display: none;
    margin-bottom: 2rem;
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 900;
}

.auth-logo-mobile a { color: white; text-decoration: none; }
.auth-logo-mobile span { color: var(--color-primary); }

@media (max-width: 900px) {
    .auth-logo-mobile { display: block; }
    .auth-main { justify-content: flex-start; padding-top: 2.5rem; }
}

/* ── Boîte du formulaire ────────────────────────────────────────────────────── */
.auth-box {
    width: 100%;
    max-width: 480px;
}

/* ── Titre auth ─────────────────────────────────────────────────────────────── */
.auth-title {
    font-family: var(--font-display);
    font-size: 1.875rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.5rem;
}

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

.auth-subtitle a {
    color: var(--color-primary);
    font-weight: 600;
}

.auth-subtitle a:hover { text-decoration: underline; }

/* ── Erreur globale ─────────────────────────────────────────────────────────── */
.auth-error-global {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(255,68,68,0.12);
    border: 1px solid rgba(255,68,68,0.35);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: #ff9090;
    line-height: 1.5;
}

.auth-error-global i { flex-shrink: 0; margin-top: 2px; }

/* ── Success box ────────────────────────────────────────────────────────────── */
.auth-success-box {
    text-align: center;
    padding: 2.5rem 1.5rem;
}

.auth-success-box .success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(74,222,128,0.1);
    border: 2px solid rgba(74,222,128,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: #4ade80;
}

.auth-success-box h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: white;
    margin-bottom: 0.75rem;
}

.auth-success-box p {
    color: var(--color-text-muted);
    line-height: 1.7;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* ── Divider ─────────────────────────────────────────────────────────────────── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--color-text-subtle);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

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

/* ── Strength meter mot de passe ────────────────────────────────────────────── */
.password-strength {
    margin-top: 0.5rem;
}

.password-strength__bar {
    height: 4px;
    background: var(--color-bg-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.password-strength__fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.3s ease, background 0.3s ease;
    width: 0%;
}

.strength-weak    .password-strength__fill { width: 25%; background: #ef4444; }
.strength-fair    .password-strength__fill { width: 50%; background: #f59e0b; }
.strength-good    .password-strength__fill { width: 75%; background: #3b82f6; }
.strength-strong  .password-strength__fill { width: 100%; background: #22c55e; }

.password-strength__label {
    font-size: 0.75rem;
    font-weight: 600;
}

.strength-weak   .password-strength__label { color: #ef4444; }
.strength-fair   .password-strength__label { color: #f59e0b; }
.strength-good   .password-strength__label { color: #3b82f6; }
.strength-strong .password-strength__label { color: #22c55e; }

/* ── Input avec icône ────────────────────────────────────────────────────────── */
.input-group {
    position: relative;
}

.input-group .form-control {
    padding-left: 2.75rem;
}

.input-group .input-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-subtle);
    font-size: 0.9rem;
    pointer-events: none;
    transition: color var(--transition-fast);
}

.input-group:focus-within .input-icon { color: var(--color-primary); }

.input-group .input-icon-right {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-subtle);
    font-size: 0.9rem;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.input-group .input-icon-right:hover { color: var(--color-text); }

/* ── reCAPTCHA notice ────────────────────────────────────────────────────────── */
.recaptcha-notice {
    font-size: 0.72rem;
    color: var(--color-text-subtle);
    text-align: center;
    margin-top: 1rem;
    line-height: 1.5;
}

.recaptcha-notice a { color: var(--color-text-muted); }

/* ── Footer liens ────────────────────────────────────────────────────────────── */
.auth-footer-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;
    font-size: 0.8rem;
    color: var(--color-text-subtle);
}

.auth-footer-links a {
    color: var(--color-text-subtle);
    transition: color var(--transition-fast);
}

.auth-footer-links a:hover { color: var(--color-text-muted); }

/* ── Flashes dans layout auth ────────────────────────────────────────────────── */
.auth-flashes {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
    max-width: 360px;
    width: calc(100% - 2rem);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ── Attempts warning ────────────────────────────────────────────────────────── */
.attempts-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: rgba(245,158,11,0.1);
    border: 1px solid rgba(245,158,11,0.3);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    color: #f59e0b;
    margin-top: 0.75rem;
}
