/* ============================================================
   WWP / BBB — Login — "Backstage Pass"
   Carte à hauteur fixe — zéro reflow au focus
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300&display=swap');

/* ---- Tokens ---- */
:root {
    --lc-bg: #080808;
    --lc-card: #0f1012;
    --lc-left: #0a0a0c;
    --lc-right: #111316;
    --lc-accent: #ff3d00;
    --lc-accent-dim: rgba(255, 61, 0, 0.1);
    --lc-accent-glow: rgba(255, 61, 0, 0.28);
    --lc-text: #eaeaea;
    --lc-text-dim: #484854;
    --lc-text-mid: #888896;
    --lc-border: #1a1a22;
    --lc-input-line: #2a2a36;
    --lc-card-h: 520px;
    --lc-pad-h: 48px;
    --lc-font-mono: 'DM Mono', 'Courier New', monospace;
    --lc-font-display: 'Bebas Neue', Impact, sans-serif;
}

/* ============================================================
   PAGE
   ============================================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: var(--lc-bg);
    background-image:
        radial-gradient(ellipse 120% 60% at 50% 0%, rgba(255, 61, 0, 0.05) 0%, transparent 70%),
        repeating-linear-gradient(-45deg, transparent, transparent 40px, rgba(255, 255, 255, 0.008) 40px, rgba(255, 255, 255, 0.008) 41px);
    font-family: var(--lc-font-mono);
}

/* ============================================================
   CARD — hauteur fixe, jamais modifiée
   ============================================================ */
.login-card {
    display: flex;
    width: 860px;
    max-width: 100%;
    height: var(--lc-card-h);
    background: var(--lc-card);
    border: 1px solid var(--lc-border);
    border-radius: 3px;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.025),
        0 40px 80px rgba(0, 0, 0, 0.7),
        0 0 100px rgba(255, 61, 0, 0.03);
    animation: lc-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes lc-rise {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   PANNEAU GAUCHE — branding
   ============================================================ */
.image-section {
    width: 42%;
    min-width: 42%;
    background-color: var(--lc-left);
    background-image: url('../assets/images/app/white-weasel-w300.png');
    background-repeat: no-repeat;
    background-size: 72%;
    background-position: center;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 28px 28px;
}

/* Grain texture overlay */
.image-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    opacity: 0.6;
    pointer-events: none;
}

/* Trait diagonal accent — signature visuelle */
.image-section::after {
    content: '';
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 64px 64px;
    border-color: transparent transparent var(--lc-right) transparent;
}

/* Tag "BBB" en coin supérieur gauche */
.image-section .lc-badge {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--lc-font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.22em;
    color: var(--lc-text-dim);
    text-transform: uppercase;
}

.image-section .lc-badge::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--lc-accent);
    border-radius: 50%;
    animation: lc-pulse 2.4s ease-in-out infinite;
}

@keyframes lc-pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        transform: scale(0.7);
    }
}

/* Sous-titre en bas du panneau gauche */
.image-section .lc-tagline {
    position: relative;
    z-index: 2;
    font-family: var(--lc-font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    color: var(--lc-text-dim);
    text-transform: uppercase;
    line-height: 1.6;
    border-top: 1px solid var(--lc-border);
    padding-top: 14px;
}

/* ============================================================
   PANNEAU DROIT — formulaires
   ============================================================ */
.form-section {
    flex: 1;
    background: var(--lc-right);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 var(--lc-pad-h);
    position: relative;
    overflow: hidden;
}

/* Ligne accent verticale sur le bord gauche */
.form-section::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--lc-accent), transparent);
    opacity: 0.5;
}

.version {
    text-align: right;
    font-size: 0.6rem;
}

/* ============================================================
   EN-TÊTE MARQUE
   ============================================================ */
.brand-header {
    margin-top: 36px;
}

.brand-title {
    font-family: var(--lc-font-display);
    font-size: 2.4rem;
    letter-spacing: 0.12em;
    color: var(--lc-text);
    line-height: 1;
    margin: 0 0 4px 0;
}

.brand-subtitle {
    font-family: var(--lc-font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.28em;
    color: var(--lc-accent);
    text-transform: uppercase;
    margin: 0;
}

/* ============================================================
   CONTENEUR FORMULAIRES — hauteur fixe, états absolus
   ============================================================ */
.forms-container {
    position: relative;
    flex: 1;
    /* Hauteur calculée : card - padding brand - brand header */
}

.form-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transform: translateX(16px);
    transition:
        opacity 0.28s ease,
        transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px; /* espace scrollbar */
}

.form-content.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

/* Scrollbar discrète pour les états longs */
.form-content::-webkit-scrollbar {
    width: 3px;
}
.form-content::-webkit-scrollbar-track {
    background: transparent;
}
.form-content::-webkit-scrollbar-thumb {
    background: var(--lc-border);
    border-radius: 2px;
}

/* ============================================================
   INPUTS CUSTOM — underline only, zéro reflow
   ============================================================ */
.wwp-field {
    position: relative;
    margin-bottom: 28px;
}

.wwp-label {
    display: block;
    font-family: var(--lc-font-mono);
    font-size: 0.58rem;
    letter-spacing: 0.24em;
    color: var(--lc-text-dim);
    text-transform: uppercase;
    margin-bottom: 9px;
    transition: color 0.2s ease;
}

.wwp-field:focus-within .wwp-label {
    color: var(--lc-accent);
}

.wwp-input {
    display: block;
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--lc-input-line);
    color: var(--lc-text);
    font-family: var(--lc-font-mono);
    font-size: 0.95rem;
    font-weight: 400;
    padding: 8px 32px 8px 0;
    outline: none;
    border-radius: 0;
    caret-color: var(--lc-accent);
    transition: border-color 0.2s ease;
    /* AUCUNE transition de hauteur ou de taille */
}

.wwp-input:focus {
    border-bottom-color: transparent; /* masqué par le pseudo */
}

.wwp-input:-webkit-autofill,
.wwp-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 40px var(--lc-right) inset !important;
    -webkit-text-fill-color: var(--lc-text) !important;
    transition: background-color 9999s;
}

/* Underline animée : croît horizontalement, zéro impact vertical */
.wwp-underline {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--lc-accent);
    transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.wwp-field:focus-within .wwp-underline {
    width: 100%;
}

/* Bouton toggle mot de passe */
.wwp-eye {
    position: absolute;
    right: 0;
    bottom: 8px;
    background: none;
    border: none;
    padding: 0;
    color: var(--lc-text-dim);
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    transition: color 0.2s;
}
.wwp-eye:hover {
    color: var(--lc-text);
}

/* ============================================================
   MESSAGE D'ERREUR — hauteur réservée, jamais de reflow
   ============================================================ */
.wwp-error {
    height: 32px; /* hauteur fixe : présent même quand vide */
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--lc-accent);
    opacity: 0;
    transition: opacity 0.2s ease;
    overflow: hidden;
}

.wwp-error.visible {
    opacity: 1;
}

/* ============================================================
   BOUTON PRINCIPAL
   ============================================================ */
.wwp-btn-primary {
    width: 100%;
    height: 46px;
    background: var(--lc-accent);
    color: #fff;
    border: none;
    border-radius: 2px;
    font-family: var(--lc-font-display);
    font-size: 1.05rem;
    letter-spacing: 0.18em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition:
        background 0.2s ease,
        box-shadow 0.2s ease;
    margin-top: 4px;
}

.wwp-btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.08) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.2s;
}

.wwp-btn-primary:hover {
    background: #e83400;
    box-shadow: 0 4px 24px var(--lc-accent-glow);
}
.wwp-btn-primary:hover::before {
    opacity: 1;
}

.wwp-btn-primary:active {
    transform: scale(0.985);
}

.wwp-btn-primary:disabled,
.wwp-btn-primary[disabled] {
    background: #2a1a14;
    color: #5a3028;
    cursor: not-allowed;
    box-shadow: none;
}

/* ============================================================
   BOUTON SECONDAIRE
   ============================================================ */
.wwp-btn-ghost {
    background: transparent;
    border: 1px solid var(--lc-border);
    color: var(--lc-text-mid);
    padding: 9px 18px;
    border-radius: 2px;
    font-family: var(--lc-font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    transition:
        border-color 0.2s,
        color 0.2s;
}
.wwp-btn-ghost:hover {
    border-color: var(--lc-text-mid);
    color: var(--lc-text);
}

/* ============================================================
   ÉTATS ALTERNATIFS (succès, reset, etc.)
   ============================================================ */
.wwp-state-icon {
    font-size: 2rem;
    margin-bottom: 16px;
    display: block;
}

.wwp-state-title {
    font-family: var(--lc-font-display);
    font-size: 1.6rem;
    letter-spacing: 0.08em;
    color: var(--lc-text);
    margin: 0 0 8px 0;
}

.wwp-state-body {
    font-size: 0.78rem;
    color: var(--lc-text-mid);
    line-height: 1.7;
    margin-bottom: 28px;
}

.wwp-state-info {
    display: flex;
    gap: 10px;
    background: rgba(255, 61, 0, 0.05);
    border: 1px solid rgba(255, 61, 0, 0.12);
    border-radius: 2px;
    padding: 12px 14px;
    margin-bottom: 24px;
    font-size: 0.72rem;
    color: var(--lc-text-mid);
    line-height: 1.6;
}
.wwp-state-info i {
    color: var(--lc-accent);
    flex-shrink: 0;
    margin-top: 2px;
}

/* ============================================================
   INDICATEUR FORCE MOT DE PASSE
   ============================================================ */
.wwp-strength {
    margin-top: 14px;
    margin-bottom: 20px;
}

.wwp-strength-bar {
    height: 2px;
    background: var(--lc-border);
    border-radius: 1px;
    overflow: hidden;
    margin-bottom: 10px;
}

.wwp-strength-fill {
    height: 100%;
    border-radius: 1px;
    transition:
        width 0.3s ease,
        background 0.3s ease;
}

.strength-weak {
    width: 25%;
    background: #cc2200;
}
.strength-fair {
    width: 50%;
    background: #cc7700;
}
.strength-good {
    width: 75%;
    background: #5588cc;
}
.strength-strong {
    width: 100%;
    background: #33aa66;
}

.wwp-criteria {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.wwp-criteria-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.65rem;
    color: var(--lc-text-dim);
    letter-spacing: 0.05em;
    transition: color 0.2s;
}
.wwp-criteria-item.valid {
    color: #33aa66;
}
.wwp-criteria-item i {
    width: 10px;
    font-size: 0.6rem;
}

/* Reset pass — intro text */
.wwp-reset-intro {
    font-size: 0.72rem;
    color: var(--lc-text-dim);
    letter-spacing: 0.06em;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--lc-border);
}
.wwp-reset-intro strong {
    color: var(--lc-text);
    display: block;
    margin-top: 4px;
    font-size: 0.88rem;
}

.wwp-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--lc-text-dim);
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}
.wwp-divider::before,
.wwp-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--lc-border);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
    :root {
        --lc-card-h: auto;
        --lc-pad-h: 28px;
    }
    .login-card {
        flex-direction: column;
        height: auto;
    }
    .image-section {
        width: 100%;
        min-width: 0;
        height: 120px;
    }
    .image-section::after {
        display: none;
    }
    .form-section {
        padding: 32px var(--lc-pad-h);
    }
    .forms-container {
        position: static;
    }
    .form-content {
        position: static;
        opacity: 0;
        pointer-events: none;
        transform: none;
        display: none;
    }
    .form-content.active {
        display: flex;
        opacity: 1;
        pointer-events: auto;
    }
}
