:root {
    --text: rgba(255, 255, 255, 0.94);
    --text-2: rgba(255, 255, 255, 0.56);
    --text-3: rgba(255, 255, 255, 0.32);
    --border: rgba(255, 255, 255, 0.1);
    --surface: #0d1420;
    --amber: #e8a33d;
    --amber-2: #f0bd6e;
    --accent-dark: #d9902a;
    --accent-text: #1c1608;
    --ring: rgba(232, 163, 61, 0.22);
    --glow: rgba(232, 163, 61, 0.16);
    --g1: #0f4c4c;
    --g2: #16324f;
    --g3: #1b2a4a;
    --r: 13px;
    --r-lg: 20px;
    --t: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html,
body {
    height: 100%;
}

body {
    font-family: "Inter", sans-serif;
    color: var(--text);
    display: flex;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    transition: background 0.4s ease;
}

.panel-brand {
    flex: 1.05;
    position: relative;
    overflow: hidden;
    display: none;
    background: linear-gradient(
        160deg,
        var(--g1) 0%,
        var(--g2) 58%,
        var(--g3) 100%
    );
    padding: 3rem;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    transition: background 0.5s ease;
}

.panel-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at 80% 15%,
        var(--glow),
        transparent 55%
    );
    transition: background 0.5s ease;
}

.pb-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.pb-mark {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Manrope", sans-serif;
    font-weight: 800;
}

.pb-name {
    font-family: "Manrope", sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

.pb-sub {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
}

.pb-mid {
    position: relative;
    z-index: 1;
}

.pb-quote {
    font-family: "Manrope", sans-serif;
    font-weight: 700;
    font-size: 1.7rem;
    line-height: 1.35;
    letter-spacing: -0.015em;
    max-width: 26ch;
}

.pb-quote em {
    color: var(--amber-2);
    font-style: normal;
}

.pb-note {
    margin-top: 1rem;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.55);
    max-width: 34ch;
    line-height: 1.6;
}

.kpi-bars {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    height: 120px;
    margin-top: 2.25rem;
    position: relative;
    z-index: 1;
}

.kpi-bars .bar {
    flex: 1;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, var(--amber-2), var(--amber));
    height: 0;
    transform-origin: bottom center;
    animation-name: grow, sway;
    animation-duration: 0.6s, 1.8s;
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1), ease-in-out;
    animation-fill-mode: forwards, none;
    animation-iteration-count: 1, infinite;
    animation-delay: var(--delay-grow, 0s), var(--delay-sway, 0.6s);
    opacity: 0.9;
}

.kpi-bars .bar.is-peak {
    background: linear-gradient(180deg, #fff, var(--amber-2));
}

@keyframes grow {
    to {
        height: var(--h);
    }
}

@keyframes sway {
    0%,
    100% {
        transform: scaleY(1);
        opacity: 0.9;
    }

    50% {
        transform: scaleY(1.045);
        opacity: 1;
    }
}

.pb-foot {
    position: relative;
    z-index: 1;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.35);
}

.panel-form {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    padding: 2rem;
}

.card {
    width: 100%;
    max-width: 400px;
    animation: rise 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-brand {
    /*display: flex;*/
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 2rem;
    display: none;
}

.mobile-brand .pb-mark {
    background: linear-gradient(135deg, var(--g2), var(--g1));
    color: #fff;
    border: none;
    transition: background 0.5s ease;
}

h1 {
    font-family: "Manrope", sans-serif;
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: -0.02em;
    margin-bottom: 0.4rem;
    color: var(--text);
}

.lede {
    font-size: 0.85rem;
    color: var(--text-2);
    margin-bottom: 2rem;
    line-height: 1.55;
}

.field {
    margin-bottom: 1.15rem;
}

.field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-2);
    margin-bottom: 0.5rem;
}

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

.input-wrap .icon-l {
    position: absolute;
    left: 0.95rem;
    color: var(--text-3);
    font-size: 0.95rem;
    pointer-events: none;
}

.field input {
    width: 100%;
    height: 46px;
    padding: 0 2.7rem 0 2.6rem;
    border: 1.5px solid var(--border);
    border-radius: var(--r);
    font-family: "Inter", sans-serif;
    font-size: 0.88rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    outline: none;
    transition:
        border-color var(--t),
        box-shadow var(--t),
        background var(--t);
}

.field input::placeholder {
    color: var(--text-3);
}

.field input:focus {
    border-color: var(--amber);
    box-shadow: 0 0 0 4px var(--ring);
    background: rgba(255, 255, 255, 0.06);
}

.pwd-toggle {
    position: absolute;
    right: 0.55rem;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--t);
}

.pwd-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1.1rem 0 1.65rem;
}

.remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-2);
    cursor: pointer;
    user-select: none;
}

.remember input {
    width: 16px;
    height: 16px;
    border-radius: 5px;
    accent-color: var(--amber);
    cursor: pointer;
}

.lien {
    font-size: 0.82rem;
    color: var(--amber-2);
    text-decoration: none;
    font-weight: 700;
}

.lien:hover {
    text-decoration: underline;
}

.btn-submit {
    width: 100%;
    height: 47px;
    border: none;
    border-radius: var(--r);
    background: linear-gradient(135deg, var(--amber), var(--accent-dark));
    color: var(--accent-text);
    font-family: "Inter", sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    box-shadow: 0 14px 28px -10px var(--ring);
    transition:
        transform var(--t),
        box-shadow var(--t),
        opacity var(--t),
        background 0.4s ease;
}

.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 30px -10px var(--ring);
}

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

.btn-submit:disabled {
    opacity: 0.75;
    cursor: default;
}

.spinner {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.25);
    border-top-color: var(--accent-text);
    display: none;
    animation: spin 0.7s linear infinite;
}

.btn-submit.is-loading .spinner {
    display: inline-block;
}

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

.foot-link {
    text-align: center;
    font-size: 0.84rem;
    color: var(--text-2);
    margin-top: 1.75rem;
}

.foot-link a {
    color: var(--amber-2);
    font-weight: 700;
    text-decoration: none;
}

.foot-link a:hover {
    text-decoration: underline;
}

@media (min-width: 900px) {
    .panel-brand {
        display: flex;
    }
}

@media (max-width: 700px) {
    .mobile-brand {
        display: flex;
    }

}


/* ═══════════════════════════════════════════════════════
   ILLUSTRATION « smartphone » (2026-10-04, v2)
   buildSmartphoneIllustration(), auth.js — PANEL_ILLUSTRATION = 'smartphone'.
   4 vrais calques (écran, châssis, circuit, dos) : vue éclatée → assemblage → rotation
   90° (paysage → portrait) → flottement → désassemblage → retour, en boucle continue
   (une seule @keyframes par propriété animée, aucune pause au survol). Couleurs reprises
   des variables du thème (--g1/--g2/--g3/--amber/--glow/--ring) : suit le thème de couleur
   tiré au hasard par applyTheme(), comme le reste de la page.
   Uniquement des ajouts : aucune règle existante modifiée.
═══════════════════════════════════════════════════════ */
.phone3d-scene {
    position: relative;
    height: 240px;
    margin-top: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 900px;
    perspective-origin: 50% 35%;
}

.phone3d {
    position: relative;
    width: 196px;
    height: 100px;
    transform-style: preserve-3d;
    animation: phone3d-cycle 8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.phone3d .layer {
    position: absolute;
    inset: 0;
    border-radius: 22px;
    transform-style: preserve-3d;
    animation: phone3d-depth 8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

/* ── Calque 1 : écran (dessus) ── */
.phone3d .layer.screen {
    --z-in: 10px;
    --z-out: 72px;
    --x-out: -16px;
    background: var(--surface);
    border: 1px solid var(--ring);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 0 26px var(--glow);
    overflow: hidden;
}

.phone3d .layer.screen::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, var(--glow), transparent 70%);
}

.phone3d-notch {
    position: absolute;
    top: 50%;
    right: 7px;
    transform: translateY(-50%);
    width: 9px;
    height: 28px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.16);
}

/* ── Calque 2 : châssis / bordure métallique ── */
.phone3d .layer.frame {
    --z-in: 4px;
    --z-out: 36px;
    --x-out: -7px;
    background: transparent;
    border: 4px solid rgba(255, 255, 255, 0.16);
    border-radius: 26px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.phone3d .layer.frame::before,
.phone3d .layer.frame::after {
    content: "";
    position: absolute;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 10px;
}

.phone3d .layer.frame::before {
    top: 22px;
    right: -7px;
    width: 26px;
    height: 3px;
}

.phone3d .layer.frame::after {
    bottom: 22px;
    left: -7px;
    width: 18px;
    height: 3px;
}

/* ── Calque 3 : circuit imprimé ── */
.phone3d .layer.circuit {
    --z-in: -2px;
    --z-out: -36px;
    --x-out: 7px;
    background: linear-gradient(160deg, var(--g2) 0%, var(--g1) 100%);
    overflow: hidden;
}

.phone3d .layer.circuit::before {
    content: "";
    position: absolute;
    inset: 10px;
    background-image:
        linear-gradient(90deg, var(--ring) 1px, transparent 1px),
        linear-gradient(0deg, var(--ring) 1px, transparent 1px);
    background-size: 14px 14px;
    border-radius: 14px;
    opacity: 0.6;
}

.phone3d .layer.circuit::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.25);
    border: 1.5px solid var(--amber);
    box-shadow: 0 0 14px var(--glow);
}

/* ── Calque 4 : dos (coque + module caméra) ── */
.phone3d .layer.back {
    --z-in: -8px;
    --z-out: -72px;
    --x-out: 16px;
    background: radial-gradient(circle at 30% 20%, var(--g3), #05070c);
    box-shadow: 0 16px 26px -10px rgba(0, 0, 0, 0.65);
    overflow: hidden;
}

.phone3d .layer.back::before {
    content: "";
    position: absolute;
    top: 14px;
    left: 14px;
    width: 26px;
    height: 26px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.phone3d .layer.back::after {
    content: "";
    position: absolute;
    top: 20px;
    left: 20px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #05070c;
    box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.18), 0 0 10px var(--glow);
}

/* ── Calques : écartement (vue éclatée) ↔ rapprochement (assemblé) ──
     0-8% et 90-100% = éclaté (début/fin de boucle identiques, pour une reprise sans à-coup) ;
     30-72% = assemblé (le temps de la tenue, de la rotation et du flottement du conteneur). ── */
@keyframes phone3d-depth {
    0%,
    8% {
        transform: translateZ(var(--z-out)) translateX(var(--x-out));
    }

    30%,
    72% {
        transform: translateZ(var(--z-in)) translateX(0);
    }

    90%,
    100% {
        transform: translateZ(var(--z-out)) translateX(var(--x-out));
    }
}

/* ── Conteneur : bascule paysage (0°) ↔ portrait (-90°), flottement pendant la tenue
     portrait (58-72%) ; de 72% à 90%, la rotation retour (portrait → paysage) et le
     désassemblage des calques se font ensemble (90-100% = palier éclaté/paysage, point de
     reprise identique au 0-8% de départ, pour une boucle sans à-coup). ── */
@keyframes phone3d-cycle {
    0%,
    8% {
        transform: rotateX(62deg) rotateZ(0deg) scale(0.88) translateY(0);
    }

    30%,
    38% {
        transform: rotateX(62deg) rotateZ(0deg) scale(1) translateY(0);
    }

    50% {
        transform: rotateX(20deg) rotateZ(-90deg) scale(1) translateY(0);
    }

    65% {
        transform: rotateX(18deg) rotateZ(-90deg) scale(1) translateY(-8px);
    }

    72% {
        transform: rotateX(20deg) rotateZ(-90deg) scale(1) translateY(0);
    }

    90%,
    100% {
        transform: rotateX(62deg) rotateZ(0deg) scale(0.88) translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .phone3d,
    .phone3d .layer {
        animation: none;
    }
}
