/* Portail IPTV Player : mobile d'abord, un seul accent (le bleu de l'écran TV). */
:root {
  --ground: #f3f5fa;
  --surface: #ffffff;
  --ink: #111a2e;
  --muted: #566077;
  --line: #d6dce8;
  --accent: #2447f0;
  --accent-ink: #ffffff;
  --accent-soft: #e7ecff;
  --ok: #0b7a55;
  --ok-soft: #dcf2e9;
  --warn: #8f5500;
  --warn-soft: #fff0d0;
  --bad: #b42318;
  --bad-soft: #fde2df;
  --tv: #1b2f9e;
  --tv-ink: #eaf0ff;
  --radius: 10px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0d1322;
    --surface: #151d31;
    --ink: #e9edf7;
    --muted: #9aa6bf;
    --line: #29344f;
    --accent: #7b95ff;
    --accent-ink: #0b1230;
    --accent-soft: #1d2a55;
    --ok: #4cd4a0;
    --ok-soft: #123a2d;
    --warn: #ffc14d;
    --warn-soft: #3b2a08;
    --bad: #ff8f84;
    --bad-soft: #421815;
    --tv: #1a2c8f;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 1rem/1.55 var(--font);
}
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible, .tile:focus-within {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 1.05rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.top a.help { font-size: 0.92rem; }

.wrap { max-width: 44rem; margin: 0 auto; padding: 24px 16px 56px; }
h1 { font-size: clamp(1.6rem, 5vw, 2.1rem); line-height: 1.15; margin: 8px 0 12px; letter-spacing: -0.02em; }
h2 { font-size: 1.25rem; margin: 0 0 4px; letter-spacing: -0.01em; }
p { margin: 0 0 12px; }
.lead { color: var(--muted); max-width: 36rem; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

section.block { padding: 28px 0 8px; border-top: 1px solid var(--line); margin-top: 28px; }
section.block > header p { color: var(--muted); margin-bottom: 16px; }

/* Résumé de l'appareil */
.device {
  display: grid; gap: 4px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius);
}
.device .id { font: 600 1.05rem var(--mono); overflow-wrap: anywhere; }
.device .row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.88rem; font-weight: 600; background: var(--accent-soft); color: var(--accent); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.subnav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 14px 0 0; font-size: 0.95rem; }

/* Formulaires */
form { display: grid; gap: 14px; }
label, .label { display: grid; gap: 6px; font-weight: 600; font-size: 0.95rem; }
label .hint, .hint { font-weight: 400; color: var(--muted); font-size: 0.88rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="tel"], input[type="search"] {
  width: 100%; min-height: 48px; padding: 10px 12px;
  font: inherit; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
input.mono { font-family: var(--mono); letter-spacing: 0.04em; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }

button, .btn {
  min-height: 48px; padding: 10px 18px;
  font: 600 1rem var(--font);
  color: var(--accent-ink); background: var(--accent);
  border: 0; border-radius: var(--radius);
  cursor: pointer; text-decoration: none; text-align: center;
  display: inline-flex; align-items: center; justify-content: center;
}
button:hover, .btn:hover { filter: brightness(1.08); }
button[disabled] { opacity: 0.55; cursor: not-allowed; filter: none; }
button.quiet, .btn.quiet { color: var(--ink); background: transparent; border: 1px solid var(--line); }
button.danger { background: var(--bad); color: #fff; }
button.link { min-height: 0; padding: 0; background: none; color: var(--accent); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

.msg { padding: 10px 12px; border-radius: var(--radius); font-size: 0.95rem; background: var(--accent-soft); }
.msg.ok { background: var(--ok-soft); color: var(--ok); }
.msg.bad { background: var(--bad-soft); color: var(--bad); }
.msg.warn { background: var(--warn-soft); color: var(--warn); }
.notice { border-left: 4px solid var(--warn); padding: 4px 0 4px 12px; color: var(--ink); margin: 0 0 16px; font-size: 0.95rem; }

/* Aperçu de l'écran « Mon compte » de la TV */
details.where { margin-top: 18px; }
details.where summary { cursor: pointer; font-weight: 600; }
.tvmock {
  margin-top: 12px; padding: 18px 20px; max-width: 24rem; aspect-ratio: 16 / 9;
  background: var(--tv); color: var(--tv-ink);
  border: 6px solid #0b1236; border-radius: 8px;
  font: 0.78rem/1.7 var(--font);
  display: flex; flex-direction: column; justify-content: center;
}
.tvmock strong { font-size: 1rem; margin-bottom: 4px; }
.tvmock mark { background: #ffd54a; color: #1b1b1b; padding: 0 4px; border-radius: 3px; font-family: var(--mono); }

/* Playlists */
.list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 12px 14px; }
.list li + li { border-top: 1px solid var(--line); }
.list .name { font-weight: 600; }
.list .meta { color: var(--muted); font-size: 0.88rem; overflow-wrap: anywhere; }
.list .tools { display: flex; gap: 14px; }
.empty { padding: 14px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); margin-bottom: 18px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.seg label { display: block; font-weight: 600; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 10px 16px; min-height: 44px; }
.seg input:checked + span { background: var(--accent); color: var(--accent-ink); }
.seg label:focus-within { outline: 3px solid var(--accent); outline-offset: -3px; }
.editbox { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }

/* Choix de la licence */
.plans { display: grid; gap: 12px; }
@media (min-width: 560px) { .plans { grid-template-columns: 1fr 1fr; } }
.tile { position: relative; display: grid; gap: 2px; padding: 16px; font-weight: 400; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.tile .t-name { font-weight: 700; }
.tile .t-price { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile .t-price small { font-size: 0.95rem; font-weight: 600; margin-left: 4px; color: var(--muted); }
.tile .t-note { color: var(--muted); font-size: 0.9rem; }
.history { margin-top: 22px; }
.history h3 { font-size: 1rem; margin: 0 0 8px; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 18px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }

footer.site { border-top: 1px solid var(--line); padding: 22px 16px 36px; text-align: center; color: var(--muted); font-size: 0.9rem; }
footer.site nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-bottom: 12px; }
footer.site p { max-width: 40rem; margin: 0 auto 8px; }

/* Pages de retour et de texte */
.center { max-width: 30rem; margin: 8vh auto 0; text-align: left; }
.status-mark { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; font-weight: 700; margin-bottom: 14px; background: var(--accent-soft); color: var(--accent); }
.status-mark.ok { background: var(--ok-soft); color: var(--ok); }
.status-mark.bad { background: var(--bad-soft); color: var(--bad); }
.status-mark.wait::after { content: ""; width: 22px; height: 22px; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .status-mark.wait::after { animation: none; border-right-color: currentColor; } }
code.ref { display: inline-block; font-family: var(--mono); font-size: 0.9rem; background: var(--accent-soft); padding: 2px 8px; border-radius: 6px; word-break: break-all; }
.prose h1 { margin-bottom: 4px; }
.prose h2 { margin-top: 28px; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.prose p, .prose li { max-width: 42rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.mt { margin-top: 12px; }
.form-title { margin: 0; font-size: 1.05rem; }
.stack { display: grid; gap: 14px; }
