/* Design system des pages d'authentification (extrait de login.php) */
/* ════════════════════════════════════════════════════════════
   FX - Design system de la page de connexion (self-contained)
   ════════════════════════════════════════════════════════════ */
:root {
    --fx-font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --fx-font-display: 'Sora', 'Inter', system-ui, sans-serif;

    --fx-bg: var(--body-bg);
    --fx-bg-soft: var(--bg-light);
    --fx-panel: var(--card-bg);
    --fx-panel-border: var(--border-color);
    --fx-surface: var(--bg-light);
    --fx-surface-hover: var(--bg-hover);
    --fx-text: var(--text-primary);
    --fx-text-2: var(--text-secondary);
    --fx-text-3: var(--text-muted);
    --fx-accent: var(--primary-color);
    --fx-accent-2: var(--accent-2);
    --fx-accent-strong: var(--button-primary);
    --fx-accent-glow: var(--primary-light);
    --fx-input-bg: var(--input-bg);
    --fx-input-border: var(--input-border);
    --fx-input-text: var(--text-primary);
    --fx-danger: var(--danger-color);
    --fx-danger-bg: var(--danger-bg);
    --fx-danger-border: var(--border-color);
    --fx-warn: var(--warning-color);
    --fx-warn-bg: var(--warning-bg);
    --fx-warn-border: var(--border-color);
    --fx-info: var(--info-color);
    --fx-info-bg: var(--info-bg);
    --fx-info-border: var(--border-color);
    --fx-ring: var(--primary-color);
    --fx-shadow-card: var(--shadow-lg);
    --fx-grid-line: var(--border-color);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body.fx-login {
    margin: 0;
    font-family: var(--fx-font-body);
    background: var(--fx-bg);
    color: var(--fx-text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* ── Arrière-plan global : grille + halos ── */
.fx-bg {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background:
        linear-gradient(var(--fx-grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--fx-grid-line) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, #000 30%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, #000 30%, transparent 100%);
}
.fx-bg::before, .fx-bg::after {
    content: ""; position: absolute; border-radius: 50%;
    filter: blur(90px); opacity: .5;
    animation: fx-drift 24s ease-in-out infinite alternate;
}
.fx-bg::before {
    width: 620px; height: 620px; top: -220px; left: -160px;
    background: radial-gradient(circle, var(--fx-accent-glow), transparent 70%);
}
.fx-bg::after {
    width: 540px; height: 540px; bottom: -200px; right: -140px;
    background: radial-gradient(circle, rgba(129, 140, 248, .22), transparent 70%);
    animation-delay: -12s;
}
@keyframes fx-drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(60px, 40px, 0) scale(1.12); }
}

/* ── Layout split-screen ── */
.fx-shell {
    position: relative; z-index: 1;
    display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    min-height: 100vh; min-height: 100dvh;
}

/* ════════ Panneau brand (gauche) ════════ */
.fx-brand {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; justify-content: space-between;
    padding: clamp(2rem, 4vw, 3.5rem);
    background:
        radial-gradient(120% 90% at 0% 0%, rgba(56, 189, 248, .10), transparent 55%),
        radial-gradient(110% 100% at 100% 100%, rgba(129, 140, 248, .10), transparent 55%),
        var(--fx-bg-soft);
    border-right: 1px solid var(--fx-panel-border);
    animation: fx-rise .7s cubic-bezier(.22, 1, .36, 1) both;
}
.fx-brand-logo img { height: 46px; width: auto; display: block; }

/* Réseau fibre animé (SVG) */
.fx-net {
    position: absolute; inset: 0; width: 100%; height: 100%;
    pointer-events: none; opacity: .9;
}
.fx-net .fx-link {
    fill: none; stroke: url(#fxLine); stroke-width: 1.2;
    stroke-dasharray: 6 10; animation: fx-flow 6s linear infinite;
}
.fx-net .fx-link.slow { animation-duration: 10s; opacity: .6; }
.fx-net .fx-node { fill: var(--fx-accent); }
.fx-net .fx-node-halo {
    fill: none; stroke: var(--fx-accent); stroke-width: 1; opacity: .35;
    transform-origin: center; transform-box: fill-box;
    animation: fx-pulse 3.2s ease-out infinite;
}
.fx-net .fx-node-halo.d1 { animation-delay: 1.1s; }
.fx-net .fx-node-halo.d2 { animation-delay: 2.2s; }
@keyframes fx-flow { to { stroke-dashoffset: -160; } }
@keyframes fx-pulse {
    0%   { transform: scale(.4); opacity: .55; }
    80%  { transform: scale(2.6); opacity: 0; }
    100% { transform: scale(2.6); opacity: 0; }
}

.fx-brand-main { position: relative; max-width: 34rem; }
.fx-eyebrow {
    display: inline-flex; align-items: center; gap: .5rem;
    font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
    color: var(--fx-accent); padding: .38rem .8rem; border-radius: 999px;
    border: 1px solid var(--fx-info-border); background: var(--fx-info-bg);
    margin-bottom: 1.4rem;
}
.fx-eyebrow .fx-dot {
    width: 7px; height: 7px; border-radius: 50%; background: var(--fx-accent);
    box-shadow: 0 0 10px var(--fx-accent); animation: fx-blink 2.4s ease-in-out infinite;
}
@keyframes fx-blink { 50% { opacity: .35; } }
.fx-brand-title {
    font-family: var(--fx-font-display);
    font-size: clamp(1.9rem, 3.2vw, 2.7rem); font-weight: 800;
    line-height: 1.12; letter-spacing: -.02em; margin: 0 0 1rem;
}
.fx-brand-title .fx-grad {
    background: linear-gradient(92deg, var(--fx-accent) 0%, var(--fx-accent-2) 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.fx-brand-sub {
    color: var(--fx-text-2); font-size: .98rem; line-height: 1.65;
    margin: 0 0 2.2rem; max-width: 30rem;
}

/* ════════ Roadmap fibre TGV (gares) ════════ */
.fx-roadmap { position: relative; margin: .2rem 0 0; padding-left: .1rem; }
.fx-roadmap .fx-fiber {
    position: absolute; left: 18px; top: 20px; bottom: 20px; width: 3px; border-radius: 3px;
    background: linear-gradient(180deg, transparent 0%, var(--fx-accent) 12%, var(--fx-accent-2) 88%, transparent 100%);
    opacity: .55; box-shadow: 0 0 12px var(--fx-accent);
}
.fx-roadmap .fx-tgv {
    position: absolute; left: 13px; width: 13px; height: 13px; border-radius: 50%;
    background: var(--card-bg); box-shadow: 0 0 16px 5px var(--fx-accent), 0 0 5px 1px var(--card-bg);
    animation: fx-tgv 6.5s cubic-bezier(.55,0,.45,1) infinite; z-index: 3;
}
@keyframes fx-tgv {
    0%   { top: 14px; opacity: 0; }
    6%   { opacity: 1; }
    94%  { opacity: 1; }
    100% { top: calc(100% - 24px); opacity: 0; }
}
.fx-station {
    position: relative; z-index: 1; display: grid; grid-template-columns: 38px 1fr;
    gap: .9rem; align-items: start; padding: .3rem 0;
    opacity: 0; transform: translateX(8px); animation: fx-station-in .5s ease forwards;
}
.fx-station:nth-child(3) { animation-delay: .05s; }
.fx-station:nth-child(4) { animation-delay: .12s; }
.fx-station:nth-child(5) { animation-delay: .19s; }
.fx-station:nth-child(6) { animation-delay: .26s; }
.fx-station:nth-child(7) { animation-delay: .33s; }
.fx-station:nth-child(8) { animation-delay: .40s; }
.fx-station:nth-child(9) { animation-delay: .47s; }
.fx-station:nth-child(10) { animation-delay: .54s; }
@keyframes fx-station-in { to { opacity: 1; transform: none; } }
.fx-station .fx-gare {
    position: relative; z-index: 2; width: 38px; height: 38px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1rem;
    color: var(--fx-accent); background: var(--fx-info-bg); border: 1px solid var(--fx-info-border);
    box-shadow: 0 0 0 4px var(--fx-bg, transparent); transition: transform .25s, box-shadow .25s, border-color .25s;
}
.fx-station:hover .fx-gare {
    transform: scale(1.08); border-color: var(--fx-accent);
    box-shadow: 0 0 0 4px var(--fx-bg, transparent), 0 0 14px var(--fx-accent);
}
.fx-station-body { padding-top: .15rem; }
.fx-station-body strong { display: block; font-size: .86rem; font-weight: 600; margin-bottom: .12rem; }
.fx-station-body .fx-num {
    display: inline-block; font-family: var(--fx-font-display); font-size: .72rem;
    font-weight: 700; color: var(--fx-accent); margin-right: .35rem; letter-spacing: .03em;
}
.fx-station-body span { display: block; font-size: .74rem; color: var(--fx-text-3); line-height: 1.45; }

.fx-brand-foot {
    position: relative; display: flex; align-items: center; gap: 1rem;
    color: var(--fx-text-3); font-size: .78rem; margin-top: 2.5rem;
}
.fx-brand-foot .fx-quote { font-style: italic; color: var(--fx-text-2); }
.fx-brand-foot .fx-sep { width: 4px; height: 4px; border-radius: 50%; background: var(--fx-text-3); flex: 0 0 auto; }

/* ════════ Panneau formulaire (droite) ════════ */
.fx-form-pane {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: clamp(1.5rem, 4vw, 3rem) clamp(1.25rem, 5vw, 4rem);
    position: relative;
}
.fx-card {
    width: 100%; max-width: 26.5rem;
    background: var(--fx-panel);
    border: 1px solid var(--fx-panel-border);
    border-radius: 22px;
    padding: clamp(1.75rem, 3vw, 2.5rem);
    box-shadow: var(--fx-shadow-card);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    animation: fx-rise .7s cubic-bezier(.22, 1, .36, 1) .08s both;
}
@keyframes fx-rise {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fx-card-logo { display: none; text-align: center; margin-bottom: 1.4rem; }
.fx-card-logo img { height: 54px; width: auto; }
.fx-card-head { margin-bottom: 1.75rem; }
.fx-card-title {
    font-family: var(--fx-font-display);
    font-size: 1.45rem; font-weight: 700; letter-spacing: -.015em;
    margin: 0 0 .4rem;
}
.fx-card-sub { margin: 0; color: var(--fx-text-2); font-size: .87rem; line-height: 1.5; }

/* ── Alertes ── */
.fx-alert {
    display: flex; gap: .65rem; align-items: flex-start;
    padding: .85rem 1rem; border-radius: 12px;
    font-size: .84rem; line-height: 1.45; margin-bottom: 1.3rem;
    animation: fx-rise .45s cubic-bezier(.22, 1, .36, 1) both;
}
.fx-alert i { font-size: .95rem; margin-top: .05rem; }
.fx-alert.danger { background: var(--fx-danger-bg); border: 1px solid var(--fx-danger-border); color: var(--fx-danger); }
.fx-alert.warn   { background: var(--fx-warn-bg);   border: 1px solid var(--fx-warn-border);   color: var(--fx-warn); }
.fx-alert.info   { background: var(--fx-info-bg);   border: 1px solid var(--fx-info-border);   color: var(--fx-info); }
.lg-countdown { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ── Champs ── */
.fx-group { margin-bottom: 1.15rem; }
.fx-label {
    display: block; font-size: .78rem; font-weight: 600;
    letter-spacing: .02em; color: var(--fx-text-2); margin-bottom: .45rem;
}
.fx-input-wrap { position: relative; }
.fx-input-wrap > .fx-input-icon {
    position: absolute; left: .95rem; top: 50%; transform: translateY(-50%);
    color: var(--fx-text-3); font-size: .95rem; pointer-events: none;
    transition: color .2s;
}
.fx-input {
    width: 100%; height: 48px;
    padding: 0 2.9rem 0 2.7rem;
    font: 500 .92rem/1 var(--fx-font-body);
    color: var(--fx-input-text);
    background: var(--fx-input-bg);
    border: 1px solid var(--fx-input-border);
    border-radius: 12px;
    outline: none; appearance: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.fx-input::placeholder { color: var(--fx-text-3); font-weight: 400; }
.fx-input:hover { border-color: var(--fx-ring); }
.fx-input:focus {
    border-color: var(--fx-accent);
    box-shadow: 0 0 0 4px var(--fx-accent-glow);
    background: var(--fx-surface-hover);
}
.fx-input:focus ~ .fx-input-icon,
.fx-input-wrap:focus-within > .fx-input-icon { color: var(--fx-accent); }
.fx-input.is-invalid { border-color: var(--fx-danger); }
.fx-input.is-invalid:focus { box-shadow: 0 0 0 4px var(--fx-danger-bg); }
/* Autofill */
.fx-input:-webkit-autofill {
    -webkit-text-fill-color: var(--fx-input-text);
    -webkit-box-shadow: 0 0 0 1000px var(--fx-bg-soft) inset;
    transition: background-color 99999s ease-in-out 0s;
}

.password-toggle {
    position: absolute; right: .55rem; top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px; border-radius: 9px;
    border: none; background: transparent; color: var(--fx-text-3);
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    font-size: .95rem; transition: color .2s, background .2s;
}
.password-toggle:hover { color: var(--fx-accent); background: var(--fx-surface-hover); }
.password-toggle:focus-visible { outline: 2px solid var(--fx-ring); outline-offset: 1px; }

.lg-field-err { display: none; font-size: .74rem; color: var(--fx-danger); margin-top: .35rem; }
.lg-field-err.show { display: block; }
.lg-capslock { display: none; font-size: .74rem; color: var(--fx-warn); margin-top: .35rem; }
.lg-capslock.show { display: flex; align-items: center; gap: .35rem; }

/* ── Se souvenir ── */
.lg-remember {
    display: flex; align-items: center; gap: .55rem;
    margin: .2rem 0 0; font-size: .82rem; color: var(--fx-text-2);
    cursor: pointer; user-select: none;
}
.lg-remember input {
    width: 16px; height: 16px; accent-color: var(--fx-accent-strong);
    cursor: pointer; border-radius: 4px;
}
.lg-remember input:focus-visible { outline: 2px solid var(--fx-ring); outline-offset: 2px; }

/* ── Bouton ── */
.fx-btn {
    position: relative; width: 100%; height: 50px; margin-top: 1.4rem;
    display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
    font: 600 .95rem/1 var(--fx-font-body); letter-spacing: .01em;
    color: #fff; border: none; border-radius: 12px; cursor: pointer;
    background: var(--button-primary);
    box-shadow: 0 10px 28px -10px var(--fx-accent-glow), inset 0 1px 0 rgba(255,255,255,.18);
    transition: transform .15s, box-shadow .2s, filter .2s, opacity .2s;
    overflow: hidden;
}
.fx-btn::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(115deg, transparent 30%, color-mix(in srgb, var(--card-bg) 22%, transparent) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform .6s ease;
}
.fx-btn:hover { filter: brightness(1.08); box-shadow: 0 14px 34px -10px var(--fx-accent-glow), inset 0 1px 0 rgba(255,255,255,.18); }
.fx-btn:hover::after { transform: translateX(120%); }
.fx-btn:active { transform: translateY(1px) scale(.995); }
.fx-btn:focus-visible { outline: 2px solid var(--fx-ring); outline-offset: 3px; }
.fx-btn:disabled { opacity: .55; cursor: not-allowed; filter: none; }
.btn-login-spinner {
    display: none; width: 16px; height: 16px;
    border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff;
    border-radius: 50%; animation: fx-spin .7s linear infinite;
}
@keyframes fx-spin { to { transform: rotate(360deg); } }
.fx-btn.loading .btn-login-spinner { display: inline-block; }
.fx-btn.loading .btn-login-icon { display: none; }
.fx-btn.loading::after { display: none; }

/* ── Pied de carte ── */
.fx-card-foot {
    margin-top: 1.75rem; padding-top: 1.2rem;
    border-top: 1px solid var(--fx-panel-border);
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    color: var(--fx-text-3); font-size: .72rem;
}
.fx-secure { display: inline-flex; align-items: center; gap: .35rem; }
.fx-secure i { color: var(--fx-accent); }
.fx-version-badge {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .2rem .55rem; border-radius: 999px;
    background: var(--fx-surface); border: 1px solid var(--fx-panel-border);
    font-weight: 600; letter-spacing: .03em;
}

/* ── Bascule de thème ── */
.fx-theme-toggle {
    position: fixed; top: 16px; right: 16px; z-index: 20;
    width: 40px; height: 40px; border-radius: 12px;
    border: 1px solid var(--fx-panel-border);
    background: var(--fx-panel); color: var(--fx-text-2);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem;
    transition: color .2s, border-color .2s, transform .15s, box-shadow .2s;
}
.fx-theme-toggle:hover {
    color: var(--fx-accent); border-color: var(--fx-info-border);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px -8px var(--fx-accent-glow);
}
.fx-theme-toggle:focus-visible { outline: 2px solid var(--fx-ring); outline-offset: 2px; }

/* ── Responsive ── */
@media (max-width: 991.98px) {
    .fx-shell { grid-template-columns: 1fr; }
    .fx-brand { display: none; }
    .fx-card-logo { display: block; }
    .fx-form-pane { min-height: 100vh; min-height: 100dvh; }
}
@media (max-width: 480px) {
    .fx-card { border-radius: 18px; }
    .fx-card-foot { flex-direction: column; align-items: flex-start; gap: .5rem; }
}

/* ── Accessibilité : mouvement réduit ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .btn-login-spinner { animation-duration: .7s !important; animation-iteration-count: infinite !important; }
}

/* ── Pages compte : demande d'accès, mot de passe oublié, réinitialisation ── */
.fx-alert.success { background: var(--success-bg, rgba(16,185,129,.12)); border: 1px solid var(--fx-info-border); color: var(--success-color, #10b981); }
.fx-links {
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem;
    margin-top: 1.1rem; font-size: .84rem;
}
.fx-links a { color: var(--fx-accent); text-decoration: none; font-weight: 600; }
.fx-links a:hover { text-decoration: underline; }
.fx-links.center { justify-content: center; }
.fx-link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--fx-accent); font-weight: 600; cursor: pointer; }
.fx-link-btn:hover { text-decoration: underline; }
.fx-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .85rem; }
@media (max-width: 520px) { .fx-grid2 { grid-template-columns: 1fr; } }
select.fx-input { cursor: pointer; background-image: none; }
textarea.fx-input { height: auto; min-height: 90px; padding: .8rem 1rem .8rem 2.7rem; line-height: 1.45; resize: vertical; }
.fx-hint { font-size: .75rem; color: var(--fx-text-3); margin-top: .35rem; line-height: 1.4; }
.fx-req { color: var(--fx-danger); }
.fx-pw-meter { height: 5px; border-radius: 4px; background: var(--fx-surface); margin-top: .5rem; overflow: hidden; }
.fx-pw-meter > span { display: block; height: 100%; width: 0; transition: width .25s, background .25s; }
.fx-pw-rules { list-style: none; padding: 0; margin: .55rem 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: .2rem .8rem; font-size: .74rem; color: var(--fx-text-3); }
.fx-pw-rules li::before { content: '\2022'; margin-right: .35rem; }
.fx-pw-rules li.ok { color: var(--success-color, #10b981); }
.fx-pw-rules li.ok::before { content: '\2713'; }
.fx-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
