/* ===================== Passe UX / UI v2 ===================== */
html, body { overflow-x: clip; }
:root { --font-display: 'Inter Tight', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; --ease: cubic-bezier(.2, .7, .2, 1); }
h1, h2, h3, .lcard .city, .stats b, .price-box .big, .kpi .v { font-family: var(--font-display); }
::selection { background: var(--blue-soft); color: var(--blue-ink); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--black); color: var(--on-dark); padding: 10px 14px; border-radius: 10px; }
.skip:focus { top: 12px; }

/* Hero */
.hero { position: relative; isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: 0 0 auto; height: 520px; z-index: -1;
  background: radial-gradient(55% 60% at 50% 0%, color-mix(in srgb, var(--blue) 14%, transparent), transparent 70%); pointer-events: none; }
.hero h1 { max-width: 13ch; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 560px; margin-inline: auto; }
.stats > div { padding: 4px 12px; min-width: 0; }
.stats span { display: block; }
@media (max-width: 560px) {
  .hero { padding-block: 40px 44px; }
  .hero .lead { font-size: .98rem; }
  .ticks { gap: 6px 14px; }
  .stats { margin-top: 32px; }
  .stats > div { padding: 2px 6px; }
  .stats b { font-size: 1.7rem; }
  .stats span { font-size: .72rem; line-height: 1.3; }
}

/* Header mobile */
.top-cta { display: none; }
@media (max-width: 860px) {
  .top-cta { display: inline-flex; margin-left: auto; }
  .nav-toggle { margin-left: 8px; }
  .nav { gap: 2px; padding-top: 6px; box-shadow: 0 20px 40px -20px rgba(0,0,0,.25); }
  .nav a { padding: 13px 12px; font-size: 1rem; border-radius: 12px; }
  .nav .btn, .nav form, .nav form .btn { width: 100%; }
  .nav .btn { padding: 13px; margin: 6px 0 0; font-size: .95rem; }
  .nav .theme-toggle { width: 100%; border-radius: 12px; height: 46px; margin-top: 6px; }
}

/* Filtres collants, défilants sur mobile */
.filterbar { position: sticky; top: calc(60px + env(safe-area-inset-top, 0px)); z-index: 5; padding-block: 10px;
  background: color-mix(in srgb, var(--bg-soft) 92%, transparent); backdrop-filter: blur(8px); }
@media (max-width: 640px) {
  .filterbar { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; margin-inline: -20px; padding-inline: 20px; }
  .filterbar::-webkit-scrollbar { display: none; }
  .filterbar a, .filterbar select { flex: none; }
}

/* Cartes leads entièrement cliquables */
.lcard { position: relative; transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.lcard:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(17,18,22,.04), 0 18px 40px -12px rgba(17,18,22,.14); }
.lcard .foot a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.lcard .buy, .lcard .chips { position: relative; z-index: 1; }
.lcard .buy .btn-primary { box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--blue) 60%, transparent); }
.lcard .price-tag { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.lcard .price-tag b { font-family: var(--font-display); font-size: 1.15rem; letter-spacing: -.02em; }
@media (prefers-reduced-motion: reduce) { .lcard, .lcard:hover { transition: none; transform: none; } }

/* Bandeau final */
.step .n { color: var(--blue-ink); }
.cta-final { text-align: center; background: #111216; color: #fff; border-radius: 28px; padding: 56px 24px; position: relative; overflow: hidden; isolation: isolate; }
.cta-final::before { content: ""; position: absolute; inset: -40% 10% auto; height: 120%; z-index: -1; background: radial-gradient(50% 50% at 50% 50%, rgba(11,108,240,.45), transparent 70%); }
.cta-final h2 { color: #fff; margin-bottom: 10px; }
.cta-final p { color: rgba(255,255,255,.7); margin: 0 auto 24px; max-width: 520px; }
.cta-final .btn-light { background: #fff; color: #111216; }
.cta-final .btn-light:hover { background: #e9ebef; }

/* Notifications */
.toasts { position: fixed; z-index: 90; top: calc(72px + env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 8px; width: min(400px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 13px 14px; border-radius: 14px; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  box-shadow: 0 16px 40px -12px rgba(0,0,0,.25); font-size: .9rem; font-weight: 500; animation: toast-in .35s var(--ease); }
.toast .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--green); }
.toast.error .dot { background: var(--red); } .toast.info .dot { background: var(--blue); }
.toast p { margin: 0; flex: 1; }
.toast button { background: none; border: 0; color: var(--ink-3); font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 0 2px; }
.toast.hide { opacity: 0; transform: translateY(-6px); transition: .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
@media (max-width: 960px) { .toasts { top: auto; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); left: 16px; right: 16px; width: auto; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* Bouton en cours d'envoi */
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid; border-color: rgba(255,255,255,.95) rgba(255,255,255,.95) transparent transparent; animation: spin .7s linear infinite; }
.btn-ghost.is-loading::after, .btn-outline.is-loading::after { border-color: var(--ink) var(--ink) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Espace connecté : onglets en bas + menu en feuille (mobile) */
.tabbar, .sheet-backdrop { display: none; }
@media (max-width: 960px) {
  .app-shell { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .sidebar { display: none; }
  .app-shell.menu-open .sidebar { display: flex; flex-direction: column; position: fixed; z-index: 80; left: 0; right: 0; bottom: 0; top: auto; height: auto; max-height: 82vh; overflow-y: auto;
    border-radius: 22px 22px 0 0; padding: 10px 14px calc(90px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -20px 50px rgba(0,0,0,.25); animation: sheet-up .3s var(--ease); background: var(--bg); border: 0; }
  .app-shell.menu-open .sidebar::before { content: ""; width: 40px; height: 5px; border-radius: 9px; background: var(--line-strong); margin: 2px auto 10px; flex: none; }
  .app-shell.menu-open .sidebar a { white-space: normal; padding: 12px; font-size: .95rem; }
  .app-shell.menu-open .sidebar .grp, .app-shell.menu-open .wallet { display: block; }
  .app-shell.menu-open .sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.35); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 85; left: 0; right: 0; bottom: 0;
    padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
    background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(180%) blur(14px); border-top: 1px solid var(--line); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font: inherit; font-size: .68rem; font-weight: 500; color: var(--ink-3); background: none; border: 0; cursor: pointer; border-radius: 12px; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar .ico { width: 22px; height: 22px; }
  .tabbar .on { color: var(--blue-ink); }
  .tabbar .tab-cta { color: var(--ink); }
  .tabbar .tab-cta .ic { width: 42px; height: 30px; border-radius: 11px; display: grid; place-items: center; background: var(--blue); color: #fff; box-shadow: 0 8px 18px -8px var(--blue); }
  .tabbar .tab-cta .ico { width: 19px; height: 19px; stroke-width: 2.3; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: .5; } }

@media (max-width: 640px) {
  .page-head { margin-bottom: 16px; }
  .page-head h1 { font-size: 1.55rem; }
  .page-head > .row, .page-head > .btn, .page-head > form { width: 100%; }
  .page-head > .row .btn, .page-head > .btn { flex: 1; }
  .card { padding: 18px; border-radius: 16px; }
  .kpi { padding: 14px; }
  .kpi .v { font-size: 1.35rem; }
  .grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid.g3 { gap: 10px; }
}

/* Tableaux en cartes sur mobile (étiquettes posées en JS) */
@media (max-width: 640px) {
  .table-wrap.cards { border: 0; background: transparent; overflow: visible; }
  .table-wrap.cards table, .table-wrap.cards tbody, .table-wrap.cards tr, .table-wrap.cards td { display: block; width: 100%; }
  .table-wrap.cards thead { display: none; }
  .table-wrap.cards tr { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 6px 14px; margin-bottom: 10px; }
  .table-wrap.cards td { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); text-align: right; }
  .table-wrap.cards td:last-child { border-bottom: 0; }
  .table-wrap.cards td::before { content: attr(data-label); color: var(--ink-3); font-size: .78rem; text-align: left; flex: none; max-width: 45%; }
  .table-wrap.cards td[data-label=""]::before { display: none; }
  .table-wrap.cards td[data-label=""] { justify-content: flex-end; }
  .table-wrap.cards tbody tr:hover td { background: transparent; }
}

/* Pipeline : défilement colonne par colonne */
@media (max-width: 760px) {
  .kanban { grid-template-columns: repeat(6, 82%); scroll-snap-type: x mandatory; margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; }
  .col { scroll-snap-align: start; }
}

/* Barre d'achat fixe (fiche lead, mobile) */
.buybar { display: none; }
@media (max-width: 960px) {
  .buybar { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: fixed; z-index: 84; left: 0; right: 0;
    bottom: calc(66px + env(safe-area-inset-bottom, 0px)); padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
    background: var(--bg); border-top: 1px solid var(--line); box-shadow: 0 -10px 30px -18px rgba(0,0,0,.3); }
  .buybar b { font-size: 1.25rem; letter-spacing: -.03em; display: block; font-family: var(--font-display); }
  .has-buybar { padding-bottom: 84px; }
}

/* Vente : étapes + aperçu en direct */
.sell-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.sell-preview { position: sticky; top: calc(80px + env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; gap: 12px; }
.sell-preview .lcard:hover { transform: none; border-color: var(--line); box-shadow: none; }
.lbl-up { display: block; margin: 0 0 2px 4px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; font-size: .7rem; color: var(--ink-3); }
@media (max-width: 1100px) { .sell-layout { grid-template-columns: 1fr; } .sell-preview { position: static; max-width: 420px; } }

/* Aperçu : la carte du marché, telle que les acheteurs la verront */
.pv-head { display: flex; justify-content: space-between; align-items: center; padding: 0 2px; }
.pv-head .lbl-up { margin: 0; }
.pv-live { display: inline-flex; align-items: center; gap: 6px; font-size: .7rem; font-weight: 600; color: var(--green-ink); text-transform: uppercase; letter-spacing: .06em; }
.pv-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 50%, transparent); animation: pv-pulse 2s infinite; }
@keyframes pv-pulse { 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .pv-live i { animation: none; } }
.pv-card { border-color: var(--ink); box-shadow: 0 10px 0 -6px var(--sun); }
.pv-card .tk-body { min-height: 0; }
.pv-card .tk-specs dd { white-space: normal; overflow: visible; line-height: 1.25; }
.pv-card .pv-empty { color: var(--ink-3); font-weight: 600; }
.pv-card .tk-city .pv-empty { font-weight: 800; opacity: .55; }
.pv-card .tk-bar i { transition: width .35s ease; }
.pv-btn { pointer-events: none; }

.pv-meter { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); display: grid; gap: 8px; }
.pv-track { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.pv-track i { display: block; height: 100%; width: 0; background: var(--sun); border-radius: 6px; transition: width .3s ease, background-color .3s; }
.pv-meter.complete .pv-track i { background: var(--green); }
.pv-meter.complete [data-pv="pct"] { color: var(--green-ink); font-weight: 700; }

.pv-net { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 10px; padding: 12px 14px; border-radius: var(--r-card); background: var(--green-soft); color: var(--green-ink); }
.pv-net b { font-family: var(--mono); font-size: 1.15rem; grid-row: span 2; align-self: center; }
.pv-net .tiny { grid-column: 1; color: var(--green-ink); opacity: .8; }

.pv-privacy { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pv-privacy li { display: flex; gap: 10px; align-items: flex-start; font-size: .8rem; color: var(--ink-2); line-height: 1.35; }
.pv-privacy li b { display: block; color: var(--ink); font-size: .8rem; }
.pv-privacy .ico { flex: none; width: 16px; height: 16px; margin-top: 1px; }
.pv-privacy .seen .ico { color: var(--green-ink); }
.pv-privacy .hidden-info .ico { color: var(--ink-3); }
.stepper { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.stepper button { all: unset; cursor: pointer; display: flex; flex-direction: column; gap: 8px; font-size: .8rem; color: var(--ink-3); font-weight: 500; }
.stepper button::before { content: ""; height: 4px; border-radius: 9px; background: var(--line); transition: background-color .3s; }
.stepper button.done::before, .stepper button.on::before { background: var(--blue); }
.stepper button.on { color: var(--ink); font-weight: 600; }
.stepper button:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 4px; }
.js-steps .fieldset { border-top: 0; padding-top: 0; margin-top: 0; }
.js-steps .fieldset[hidden] { display: none !important; }
.step-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.step-nav .btn { min-width: 120px; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.field.invalid .choice span { border-color: var(--red); }
.field-err { color: var(--red); font-size: .78rem; margin-top: 5px; }

/* Prix proposé */
.pricing { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: var(--surface); }
.pricing .big { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.pricing .factors { display: grid; gap: 6px; margin: 14px 0; font-size: .82rem; }
.pricing .factors div { display: flex; justify-content: space-between; gap: 10px; color: var(--ink-2); }
.pricing .factors .up { color: var(--green-ink); } .pricing .factors .down { color: var(--orange-ink); }
.adjust { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.adjust input[type=range] { flex: 1; accent-color: var(--blue); }
.adjust output { min-width: 56px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Carte bancaire illustrée */
.paycard { aspect-ratio: 1.586; max-width: 100%; border-radius: 16px; padding: 18px 20px; color: #fff; margin-bottom: 18px; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(135deg, #1b2a4a 0%, #0b6cf0 120%); box-shadow: 0 20px 40px -18px rgba(11,108,240,.6); font-variant-numeric: tabular-nums; position: relative; overflow: hidden; }
.paycard::after { content: ""; position: absolute; right: -30%; top: -40%; width: 80%; aspect-ratio: 1; border-radius: 50%; background: rgba(255,255,255,.07); }
.paycard .chipc { width: 38px; height: 28px; border-radius: 6px; background: linear-gradient(135deg, #e9d7a0, #b9934a); }
.paycard .pnum { font-size: 1.2rem; letter-spacing: .12em; font-weight: 500; }
.paycard .prow { display: flex; justify-content: space-between; align-items: flex-end; font-size: .72rem; opacity: .9; text-transform: uppercase; letter-spacing: .06em; }
.paycard .brand { font-weight: 800; font-style: italic; font-size: 1.05rem; text-transform: none; letter-spacing: 0; }
.secure { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: .78rem; color: var(--ink-3); margin-top: 12px; }
.secure .ico { width: 14px; height: 14px; }

.calc .row + .row { margin-top: 4px; }
.footer { background: var(--bg); }
@media (max-width: 640px) { .footer .cols { flex-direction: column; } .footer nav { gap: 10px 18px; } }

/* Connexion : icône des écrans d'authentification, champ de code */
.auth-ico { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--blue-soft); color: var(--blue-ink); margin-bottom: 12px; }
.auth-ico .ico { width: 22px; height: 22px; }
.otp-input { font-family: var(--mono); font-size: 1.15rem; letter-spacing: .18em; text-align: center; }

/* Double authentification (paramètres) */
.twofa-steps { margin: 12px 0 14px; padding-left: 20px; color: var(--ink-2); display: grid; gap: 4px; }
.twofa-setup { display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 18px; align-items: start; }
.twofa-qr { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px; line-height: 0; }
.twofa-qr svg { width: 100%; height: auto; display: block; }
.twofa-secret { display: block; font-family: var(--mono); font-size: .85rem; padding: 8px 10px; background: var(--surface-2); border-radius: 6px; word-break: break-all; user-select: all; }
.twofa-codes { margin: 14px 0; padding: 14px; border: 1.5px dashed var(--ink); border-radius: var(--r-card); background: var(--sun-soft); }
.twofa-codes ol { margin: 0; padding-left: 22px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 18px; }
.twofa-codes code { font-family: var(--mono); font-size: .9rem; font-weight: 700; color: var(--ink); }
.twofa-more { margin-top: 12px; }
.twofa-more summary, .payout-lock summary { cursor: pointer; color: var(--ink-2); }
@media (max-width: 560px) { .twofa-setup { grid-template-columns: 1fr; } .twofa-qr { max-width: 200px; } .twofa-codes ol { grid-template-columns: 1fr; } }
