/* ANGI X : couleurs et composants. Mobile d'abord. Theme clair et sombre. */
:root {
  --bg: #f4f8f5; --card: #ffffff; --ink: #10241b; --muted: #43564c; --line: #dde8e1; --field: #b3c4b9;
  --brand: #11523a; --on-brand: #ffffff; --accent: #0c5a38; --accent-soft: #dcf3e6; --focus: #1f8f5f;
  --warn-bg: #fff6e0; --warn-line: #e3b24a; --warn-ink: #5e4100; --bad: #8c1d16; --bad-soft: #fbdcd9;
  --sel: #e7f4ec; --track: #cfdcd4; --side: #11523a; --side-ink: #ffffff; --side-soft: #cfe6da;
  --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", Inter, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1914; --card: #15251d; --ink: #e8f1ec; --muted: #a8bdb0; --line: #284236; --field: #4b6557;
    --brand: #2da36c; --on-brand: #04130b; --accent: #7fd6a9; --accent-soft: #1d3c2d; --focus: #7fd6a9;
    --warn-bg: #2d2410; --warn-line: #8a6a1f; --warn-ink: #f2d58c; --bad: #ffb4ab; --bad-soft: #3b1a17;
    --sel: #1d3c2d; --track: #2a4337; --side: #0a3526; --side-ink: #f2faf5; --side-soft: #b9d6c6;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.01em; text-wrap: balance; }
a { color: inherit; text-decoration: none; }
h1[tabindex="-1"]:focus { outline: none; } /* titre cible par programme apres chaque page (lecteurs d'ecran) : pas de cadre visible */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

#app { min-height: 100dvh; display: flex; justify-content: center; }
.screen, .panel { width: 100%; max-width: 480px; min-height: 100dvh; display: flex; flex-direction: column; gap: 18px;
  padding: max(20px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); }
.split { width: 100%; display: flex; justify-content: center; }
.brand-side, .only-desktop { display: none !important; }
/* En-tete du compte : l'e-mail garde sa largeur, les actions passent a la ligne si l'ecran est etroit */
.acc-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 16px; padding-top: 12px; }
.acc-who { flex: 1 1 240px; min-width: 0; }
.acc-who h1 { overflow-wrap: anywhere; }
.acc-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; }
.spacer { margin-top: auto; }

.logo { width: 48px; height: 48px; border-radius: 12px; background: var(--brand); color: var(--on-brand); font: 700 17px var(--display); display: flex; align-items: center; justify-content: center; }
.tag { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: .08em; text-transform: uppercase; }
.lead { font-size: 16px; line-height: 1.5; color: var(--muted); }
.sub { font-size: 15px; line-height: 1.5; color: var(--muted); }
.small { font-size: 13px; color: var(--muted); line-height: 1.4; }
.h1 { font-size: clamp(28px, 8vw, 36px); line-height: 1.1; }

.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 15px; font-weight: 600; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.steps { display: flex; gap: 6px; }
.steps i { flex: 1; height: 4px; border-radius: 99px; background: var(--track); }
.steps i.on { background: var(--brand); }

.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; border-radius: 12px; background: var(--brand); color: var(--on-brand);
  font: 600 16px var(--font); padding: 0 16px; border: 0; cursor: pointer; text-align: center; }
.btn.inline { width: auto; min-height: 44px; padding: 0 18px; font-size: 15px; }
.btn.o { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn:disabled { opacity: .6; cursor: progress; }
.linkbtn { display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; padding: 0 8px; min-height: 44px; font: 600 15px var(--font); color: var(--accent); cursor: pointer; text-decoration: underline; }

.f { display: flex; flex-direction: column; gap: 6px; }
.lbl { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.inp { height: 52px; width: 100%; border: 1.5px solid var(--field); border-radius: 12px; padding: 0 14px; font: inherit; font-size: 16px; background: var(--card); color: var(--ink); }
.inp[aria-invalid="true"] { border-color: var(--bad); }
.pw { position: relative; }
.pw .inp { padding-right: 84px; }
.pw button { position: absolute; right: 4px; top: 4px; height: 44px; min-width: 76px; border: 0; background: none; font: 600 14px var(--font); color: var(--accent); cursor: pointer; border-radius: 8px; }
.phone { display: flex; gap: 10px; }
.phone select { width: 46%; flex: none; text-overflow: ellipsis; }
.phone input { min-width: 0; }
.err { font-size: 13px; color: var(--bad); font-weight: 600; }
.ok-txt { color: var(--accent); }
.chk { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.45; color: var(--muted); }
.chk input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }

.alert { border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.45; }
.alert.bad { background: var(--bad-soft); color: var(--bad); font-weight: 600; }
.alert.warn { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.fact { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 500; }
.fact i { flex: none; width: 8px; height: 8px; border-radius: 99px; background: var(--brand); }
.pill { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .03em; white-space: nowrap; }
.pill.ok { background: var(--accent-soft); color: var(--accent); }
.pill.wait { background: var(--warn-bg); color: var(--warn-ink); }
.pill.mut { background: var(--track); color: var(--muted); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-child { border: 0; }
.kv span:first-child { color: var(--muted); }
.kv b { text-align: right; font-variant-numeric: tabular-nums; word-break: break-word; }
.bar { height: 10px; border-radius: 99px; background: var(--track); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.keybox { background: var(--card); border: 1.5px solid var(--brand); border-radius: 14px; padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; }
.keytext { font: 700 clamp(15px, 4.4vw, 20px)/1.5 ui-monospace, Consolas, "Courier New", monospace; letter-spacing: .04em; color: var(--ink); text-align: center; overflow-wrap: anywhere; user-select: all; }
.keytext .kg { display: inline-block; }
.inp.mono { font-family: ui-monospace, Consolas, "Courier New", monospace; letter-spacing: .04em; text-transform: uppercase; }
.opt { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 10px 14px; background: var(--card); border: 1.5px solid var(--field); border-radius: 12px; cursor: pointer; }
.opt.on { border-color: var(--brand); background: var(--sel); }
.opt input { width: 22px; height: 22px; margin: 0; accent-color: var(--brand); flex: none; }
.opt b { display: block; font-size: 15px; }
.opt small { font-size: 13px; color: var(--muted); }
.li { display: flex; gap: 10px; font-size: 14px; line-height: 1.4; color: var(--muted); }
.li i { flex: none; margin-top: 7px; width: 6px; height: 6px; border-radius: 99px; background: var(--brand); }
.shot { aspect-ratio: 3 / 2; border: 1.5px dashed var(--field); border-radius: 12px; background: var(--card); display: flex; align-items: center; justify-content: center; overflow: hidden; text-align: center; padding: 8px; }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot.round { aspect-ratio: 1; border-radius: 50%; max-width: 220px; width: 100%; margin: 0 auto; }
.cols2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.spin { width: 18px; height: 18px; border-radius: 99px; border: 3px solid currentColor; border-right-color: transparent; animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } }
.center { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
/* ---------- Tablette (600 a 1023 px) : bandeau de marque en haut, contenu centre et plus aere dessous ---------- */
@media (min-width: 600px) {
  .cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 700px) {
  .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .cols > .full { grid-column: 1 / -1; }
}
@media (min-width: 600px) and (max-width: 1023.98px) {
  body { font-size: 17px; }
  .split { flex-direction: column; align-items: stretch; justify-content: flex-start; }
  .brand-side { display: flex !important; flex-direction: column; gap: 14px; background: var(--side); color: var(--side-ink);
    padding: 44px max(32px, calc((100% - 560px) / 2)) 40px; }
  .brand-side .logo { background: var(--side-ink); color: var(--side); width: 52px; height: 52px; font-size: 18px; }
  .brand-side .tag { color: var(--side-soft); }
  .brand-side .headline { font: 700 clamp(34px, 5.4vw, 44px)/1.08 var(--display); letter-spacing: -.02em; text-wrap: balance; }
  .brand-side .lead { color: var(--side-soft); font-size: 18px; max-width: 46ch; }
  .brand-side .side-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; margin-top: 6px; }
  .brand-side .side-fact { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; font-weight: 500; }
  .brand-side .side-fact i { flex: none; margin-top: 8px; width: 7px; height: 7px; border-radius: 99px; background: var(--side-ink); opacity: .8; }
  /* pages interieures : bandeau reduit au logo et au nom */
  .brand-side.compact { flex-direction: row; align-items: center; gap: 14px; padding-top: 18px; padding-bottom: 18px; }
  .brand-side.compact .logo { width: 40px; height: 40px; font-size: 14px; }
  .brand-side.compact .headline, .brand-side.compact .lead, .brand-side.compact .side-facts { display: none; }
  .panel { max-width: 560px; width: 100%; margin: 0 auto; min-height: 0; justify-content: flex-start; padding: 40px 32px 72px; gap: 22px; }
  .panel .spacer { margin-top: 10px; }
  .hero-mobile { display: none !important; }
  .only-desktop { display: flex !important; }
  .screen:not(.wide) { max-width: 560px; margin: 0 auto; padding: 48px 32px; }
  .screen.wide { max-width: 880px; margin: 0 auto; padding: 48px 32px; }
  .h1 { font-size: 38px; }
  .sub, .lead { font-size: 17px; }
  .btn { min-height: 56px; font-size: 17px; }
  .btn.inline { min-height: 48px; }
  .inp { height: 56px; }
  .lbl { font-size: 14px; }
  .shot { aspect-ratio: 3 / 2; }
  .shot.round { max-width: 280px; }
}

/* ---------- Ordinateur (1024 px et plus) : deux panneaux, tableau de bord sur deux colonnes ---------- */
@media (min-width: 1024px) {
  #app { display: block; }
  .split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 100dvh; }
  .brand-side { display: flex !important; flex-direction: column; justify-content: center; gap: 22px; background: var(--side); color: var(--side-ink);
    padding: 72px clamp(40px, 7vw, 112px); position: sticky; top: 0; height: 100dvh; }
  .brand-side .logo { background: var(--side-ink); color: var(--side); width: 56px; height: 56px; font-size: 19px; }
  .brand-side .tag { color: var(--side-soft); }
  .brand-side .headline { font: 700 clamp(36px, 4vw, 56px)/1.05 var(--display); letter-spacing: -.02em; text-wrap: balance; }
  .brand-side .lead { color: var(--side-soft); font-size: 18px; max-width: 34ch; }
  .brand-side .side-facts { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
  .brand-side .side-fact { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 500; }
  .brand-side .side-fact i { flex: none; width: 8px; height: 8px; border-radius: 99px; background: var(--side-ink); opacity: .8; }
  .panel { max-width: 500px; width: 100%; margin: 0 auto; justify-content: center; padding: 56px 40px; min-height: 100dvh; }
  .panel .spacer { margin-top: 8px; }
  .hero-mobile { display: none !important; }
  .only-desktop { display: flex !important; }
  .screen.wide { max-width: 1040px; margin: 0 auto; padding: 48px 40px; }
  .cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .cols > .full { grid-column: 1 / -1; }
  #app > .screen { margin: 0 auto; }
}

/* ---------- Coque de l'application ---------- */
.appshell { width: 100%; min-height: 100dvh; display: flex; flex-direction: column; }
.page { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px;
  padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 20px max(20px, env(safe-area-inset-left)); }
.side { display: none; }
.bnav { position: sticky; bottom: 0; z-index: 5; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--card); border-top: 1px solid var(--line);
  padding: 6px max(6px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)); }
.bnavlink { position: relative; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); }
.bnavlink.on { color: var(--accent); }
.ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }
.badge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; }
.modal { position: fixed; inset: 0; z-index: 30; background: rgba(8, 20, 14, .6); display: flex; align-items: flex-end; justify-content: center; }
.modal .sheet { width: 100%; max-width: 480px; background: var(--card); border-radius: 22px 22px 0 0; padding: 22px 20px max(24px, env(safe-area-inset-bottom)); }
.ring { position: relative; width: 220px; height: 220px; margin: 0 auto; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .inside { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.big { font: 700 44px/1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.timer { font: 700 20px var(--display); font-variant-numeric: tabular-nums; }
.card.dark { background: var(--brand); color: var(--on-brand); border-color: transparent; }
.card.dark .small, .card.dark .lbl { color: inherit; opacity: .85; }
.card.dark .btn { background: var(--on-brand); color: var(--brand); }
.item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--track); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { min-height: 44px; border: 0; border-radius: 9px; background: transparent; font: 700 13px var(--font); color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--card); color: var(--accent); box-shadow: 0 1px 3px rgba(16, 36, 27, .15); }
.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.chips button { min-height: 44px; border: 1.5px solid var(--field); border-radius: 10px; background: var(--card); font: 600 14px var(--font); color: var(--ink); cursor: pointer; }
.chips button.on { border-color: var(--brand); background: var(--sel); }
.mono-addr { font: 14px ui-monospace, Consolas, monospace; background: var(--sel); border-radius: 10px; padding: 10px 12px; overflow-wrap: anywhere; user-select: all; }
@media (min-width: 600px) and (max-width: 1023.98px) {
  .page { max-width: 720px; padding-top: 40px; }
  .bnavlink { min-height: 64px; font-size: 12px; }
}
@media (min-width: 1024px) {
  .appshell { flex-direction: row; }
  .bnav { display: none; }
  .side { display: flex; flex-direction: column; gap: 22px; flex: 0 0 248px; position: sticky; top: 0; height: 100dvh; background: var(--side); color: var(--side-ink); padding: 28px 16px; }
  .logo-row { display: flex; align-items: center; gap: 12px; padding: 0 10px; font: 700 18px var(--display); }
  .logo-row .logo { background: var(--side-ink); color: var(--side); width: 40px; height: 40px; font-size: 15px; font-style: normal; }
  .sidelink { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px; font-size: 15px; font-weight: 600; color: var(--side-soft); position: relative; }
  .sidelink.on { background: rgba(255, 255, 255, .14); color: var(--side-ink); }
  .sidelink .badge { position: static; margin-left: auto; }
  .page { max-width: 1120px; padding: 40px clamp(24px, 4vw, 56px); }
}

.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; max-width: calc(100% - 32px); z-index: 20; }
