/*
 * TAONSA Player — page d'association d'une télé (/player.php), 24/10/2026,
 * un seul formulaire depuis le 14/11/2026
 * Charte : teal #008C95 (accents), teal foncé #00747C (boutons, texte blanc
 * 5,5:1), bleu pétrole #0F2E2C, ivoire #F5F1E6. Contrastes vérifiés AA.
 */

@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/Inter-Regular.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/Inter-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/Inter-Bold.ttf") format("truetype"); }

:root {
  --teal: #008C95;
  --teal-dark: #00747C;
  --teal-deeper: #005D63;
  --petrol: #0F2E2C;
  --turquoise: #14B8A6;
  --bg: #F5F1E6;
  --surface: #FFFEF8;
  --text: #173235;
  --muted: #526563;
  --border: #E0E5DA;
  --field-border: #7C8E8B;   /* 3,4:1 sur la surface : contour de champ visible (WCAG 1.4.11) */
  --teal-soft: #E7F3F1;
  --error: #B42318;
  --error-soft: #FDF0EE;
  --success: #087F5B;
  --success-soft: #E8F5EF;
  --warn-text: #7A4A00;
  --warn-soft: #FFF5E1;
  --warn-line: #F3D6A0;
  --radius-card: 16px;
  --radius-btn: 12px;
  --radius-field: 10px;
  --shadow: 0 1px 2px rgba(15, 46, 44, .05), 0 8px 24px rgba(15, 46, 44, .06);
  --focus: 0 0 0 3px var(--surface), 0 0 0 6px var(--teal);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
[hidden] { display: none !important; }
a { color: var(--teal-dark); text-underline-offset: 2px; }
a:hover { color: var(--teal-deeper); }
:focus { outline: none; }
:focus-visible { box-shadow: var(--focus); border-radius: 6px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic, svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .04em; }

.skip { position: absolute; left: 16px; top: -60px; z-index: 20; background: var(--petrol); color: #fff; padding: 10px 14px; border-radius: 10px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

/* --------------------------------------------------------- en-tête / pied */
.site { position: sticky; top: 0; z-index: 10; background: rgba(245, 241, 230, .94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.site-in { max-width: 1240px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 19px; white-space: nowrap; }
.brand img { border-radius: 9px; }
.pill { display: inline-block; background: var(--teal-dark); color: #fff; border-radius: 5px; padding: 0 6px; font-size: 12px; font-weight: 700; line-height: 20px; }
.site nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.site nav::-webkit-scrollbar { display: none; }
.site nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; padding: 9px 12px; border-radius: 9px; white-space: nowrap; }
.site nav a:hover { color: var(--text); background: rgba(15, 46, 44, .06); }
.site nav a.cta { background: var(--teal-dark); color: #fff; }
.site nav a.cta:hover { background: var(--teal-deeper); }
@media (max-width: 599px) {
  /* Comme l'accueil : la navigation passe sous la marque, défilable, sans jamais cacher « Envoyer ma liste ». */
  .site-in { flex-wrap: wrap; padding-top: 10px; padding-bottom: 8px; min-height: 0; }
  .site nav { width: 100%; margin: 0 -4px; }
  .site nav a { padding: 8px 10px; font-size: 14px; }
}
@media (max-width: 429px) {
  .site nav a.hide-sm { display: none; }
}
.site-foot { margin-top: auto; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }
.site-foot .site-in { flex-wrap: wrap; padding-top: 18px; padding-bottom: 24px; }
.site-foot .links { display: flex; gap: 16px; flex-wrap: wrap; }
.site-foot a { color: var(--muted); }

/* ------------------------------------------------------------- mise en page */
.page { width: 100%; max-width: 1240px; margin: 0 auto; padding: 24px 16px 48px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow); padding: 24px 20px 28px; min-width: 0; }
.card.solo, .nojs { max-width: 760px; margin: 0 auto; }

h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.01em; margin: 0 0 8px; font-weight: 700; color: var(--text); }
h1:focus-visible { box-shadow: none; text-decoration: underline; text-decoration-color: var(--teal); text-underline-offset: 6px; }
.lead { color: var(--muted); margin: 0 0 22px; }

/* ------------------------------------------- groupes : télé, puis liste */
.group { border: 1px solid var(--border); border-radius: 14px; background: #fff; margin: 0 0 18px; padding: 16px 16px 2px; min-width: 0; }
.group legend { display: flex; align-items: center; gap: 8px; padding: 0 8px; margin-left: -8px; font-weight: 700; font-size: 17px; }
.group legend .ic { color: var(--teal-dark); }
.tv-chip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin: 0 0 14px; border-radius: 12px; background: var(--success-soft); color: var(--success); font-size: 15px; font-weight: 600; }
.tv-chip > .ic { stroke-width: 2.4; }
.tv-chip span { flex: 1; min-width: 0; }
.tv-chip strong { display: block; color: var(--text); white-space: nowrap; }
.linkbtn { border: 0; background: transparent; color: var(--teal-dark); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; min-height: 44px; padding: 0 6px; margin: -10px -6px -10px 0; }
.linkbtn:hover { color: var(--teal-deeper); }

/* ---------------------------------------------------------------- champs */
.field { margin: 0 0 18px; }
.field label { display: block; font-weight: 600; margin: 0 0 7px; font-size: 15px; }
.field .opt { font-weight: 400; color: var(--muted); }
.control { position: relative; display: flex; align-items: center; }
.control .lead-ic { position: absolute; left: 14px; color: var(--teal-dark); pointer-events: none; }
.control input { width: 100%; min-height: 52px; padding: 12px 14px 12px 46px; border: 1.5px solid var(--field-border); border-radius: var(--radius-field); background: #fff; color: var(--text); font: inherit; font-size: 16px; transition: border-color .15s, box-shadow .15s; }
.control input::placeholder { color: #6B7B79; opacity: 1; }
.control input:hover { border-color: var(--muted); }
.control input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0, 140, 149, .25); }
.control input:has(+ .reveal) { padding-right: 54px; }
.reveal { position: absolute; right: 4px; width: 46px; height: 44px; border: 0; background: transparent; color: var(--muted); border-radius: 8px; display: grid; place-items: center; cursor: pointer; }
.reveal:hover { color: var(--text); background: rgba(15, 46, 44, .06); }
.reveal[aria-pressed="true"] { color: var(--teal-dark); }
.hint { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.err { margin: 6px 0 0; font-size: 14px; color: var(--error); font-weight: 600; display: none; }
.err:not(:empty) { display: flex; gap: 6px; }
.err:not(:empty)::before { content: "!"; flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--error); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; margin-top: 1px; }
.field.invalid input { border-color: var(--error); background: #FFFCFB; }
.field.invalid input:focus { box-shadow: 0 0 0 3px rgba(180, 35, 24, .2); }
.field.invalid .lead-ic { color: var(--error); }
.field.invalid .hint { display: none; }
.row2 { display: grid; gap: 0 16px; grid-template-columns: minmax(0, 1fr); }

/* --------------------------------------------------------------- boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 12px 22px; border-radius: var(--radius-btn); border: 1.5px solid transparent; font: inherit; font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--teal-dark); color: #fff; }
.btn.primary:hover { background: var(--teal-deeper); color: #fff; }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--field-border); }
.btn.ghost:hover { background: #fff; border-color: var(--text); color: var(--text); }
.btn.block { width: 100%; }
.btn.sm { min-height: 40px; padding: 8px 14px; font-size: 15px; }
.btn[disabled], .btn[aria-disabled="true"] { cursor: not-allowed; opacity: .7; transform: none; }
.btn.is-busy .ic { display: none; }
.btn.is-busy::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: spin .8s linear infinite; }
.btn.ghost.is-busy::before { border-color: rgba(23, 50, 53, .25); border-top-color: var(--text); }
@keyframes spin { to { transform: rotate(360deg); } }
.actions { display: flex; flex-direction: column-reverse; gap: 12px; margin-top: 24px; }
.actions .btn { width: 100%; }
.fine { text-align: center; color: var(--muted); font-size: 14px; margin: 12px 0 0; }

/* ---------------------------------------------------------- notes et aide */
.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; margin: 0 0 20px; background: var(--error-soft); border: 1px solid #F3C7C1; color: var(--text); }
.notice > .ic { color: var(--error); margin-top: 2px; }
.notice strong { display: block; color: var(--error); }
.notice p { margin: 2px 0 0; font-size: 15px; }
.notice.warning { background: var(--warn-soft); border-color: var(--warn-line); }
.notice.warning > .ic, .notice.warning strong { color: var(--warn-text); }
.notice.info { background: var(--teal-soft); border-color: #BFE0DC; }
.notice.info > .ic, .notice.info strong { color: var(--teal-deeper); }
.notice-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.notice-actions .btn { margin-top: 10px; }
.tip { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: var(--teal-soft); color: var(--text); margin: 18px 0 0; font-size: 15px; }
.tip p { margin: 0; }
.tip > .ic { color: var(--teal-dark); margin-top: 1px; }
.tip.warn { background: var(--warn-soft); border: 1px solid var(--warn-line); }
.tip.warn > .ic { color: var(--warn-text); }
.help { margin: 0 0 16px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.help summary { display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; font-weight: 600; color: var(--teal-dark); list-style: none; min-height: 48px; }
.help summary::-webkit-details-marker { display: none; }
.help summary::after { content: "+"; margin-left: auto; font-size: 20px; line-height: 1; }
.help[open] summary::after { content: "−"; }
.help ol { margin: 0; padding: 0 16px 0 38px; }
.help li { margin-bottom: 6px; }
.help p { margin: 8px 16px 16px; color: var(--muted); font-size: 15px; }
.privacy { display: flex; gap: 10px; align-items: flex-start; margin: 20px 0 0; padding: 14px 16px; border-radius: 12px; background: var(--teal-soft); font-size: 14px; color: var(--text); }
.privacy .ic { color: var(--teal-dark); }

/* --------------------------------------------------------- figure de la TV */
.tv-figure { margin: 14px 16px 4px; }
.tv { max-width: 340px; margin: 0 auto; }
.tv-screen { background: linear-gradient(160deg, #10302E, #081A19); border: 8px solid #1B1F1F; border-radius: 12px; padding: 14px; color: #fff; aspect-ratio: 16 / 9; display: flex; flex-direction: column; gap: 10px; }
.tv-brand { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; }
.tv-brand img { border-radius: 3px; }
.tv-brand .pill { font-size: 9px; line-height: 14px; padding: 0 4px; }
.tv-panel { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); border-radius: 8px; padding: 10px 14px; }
.tv-panel p { margin: 0; }
.tv-title { font-weight: 700; font-size: 13px; }
.tv-sub { font-size: 10px; color: #B8C8C6; margin-bottom: 6px !important; }
.tv-label { font-size: 9px; color: #9FB3B0; text-transform: uppercase; letter-spacing: .06em; }
.tv-panel > div { min-width: 0; }
.tv-val { font-size: clamp(11px, 2.6vw, 14px); overflow-wrap: anywhere; font-weight: 700; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.tv-qr { width: 30%; max-width: 92px; height: auto; aspect-ratio: 1; background: #fff; color: var(--petrol); border-radius: 6px; padding: 6px; stroke-width: 2.2; }
.tv-foot { width: 34%; height: 8px; margin: 0 auto; background: #1B1F1F; border-radius: 0 0 8px 8px; }

/* ------------------------------------------------------ format segmenté */
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: #EEF1EA; border-radius: 12px; margin: 0 0 18px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented span { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 9px; font-weight: 600; font-size: 15px; color: var(--muted); cursor: pointer; text-align: center; padding: 0 8px; }
.segmented input:checked + span { background: var(--teal-dark); color: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.segmented input:focus-visible + span { box-shadow: var(--focus); }

/* ------------------------------------------- envoi, attente, résultat */
.progress { text-align: center; padding: 8px 0; }
.pg-icon { width: 88px; height: 88px; margin: 4px auto 18px; border-radius: 50%; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal-dark); position: relative; }
.pg-icon .ic { width: 38px; height: 38px; }
.pg-icon.is-wait::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--teal); animation: spin 1.2s linear infinite; }
.pg-icon.is-ok { background: var(--teal-dark); color: #fff; animation: pop .35s ease-out; }
.pg-icon.is-ok .ic { stroke-width: 2.6; }
.pg-icon.is-fail { background: var(--error-soft); color: var(--error); }
.pg-icon.is-warn { background: var(--warn-soft); color: var(--warn-text); }
@keyframes pop { from { transform: scale(.85); opacity: .4; } to { transform: scale(1); opacity: 1; } }
.progress .lead { max-width: 520px; margin-left: auto; margin-right: auto; }
.timeline { list-style: none; margin: 8px auto 0; padding: 0; max-width: 360px; text-align: left; }
.timeline li { display: flex; align-items: center; gap: 12px; padding: 8px 0; color: var(--muted); font-size: 15px; }
.timeline .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--field-border); flex: none; display: grid; place-items: center; background: var(--surface); }
.timeline li.done { color: var(--text); }
.timeline li.done .dot { background: var(--teal-dark); border-color: var(--teal-dark); }
.timeline li.done .dot::after { content: ""; width: 9px; height: 5px; border: solid #fff; border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px); }
.timeline li.active { color: var(--text); font-weight: 600; }
.timeline li.active .dot { border-color: var(--teal); border-top-color: transparent; animation: spin 1s linear infinite; }
.progress .tip { text-align: left; max-width: 520px; margin-left: auto; margin-right: auto; }
.tv-ok { display: flex; align-items: center; gap: 12px; max-width: 380px; margin: 20px auto 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: #fff; text-align: left; }
.tv-ok > .ic { color: var(--teal-dark); width: 26px; height: 26px; }
.tv-ok > span { flex: 1; display: flex; flex-direction: column; }
.tv-ok .mono { color: var(--muted); font-size: 14px; }
.tv-ok .ok { color: var(--success); }
.actions.center { max-width: 420px; margin-left: auto; margin-right: auto; }

/* ------------------------------------------------------------ ≥ 600 px */
@media (min-width: 600px) {
  .page { padding: 32px 24px 56px; }
  .site-in { padding: 0 24px; }
  .card { padding: 32px; }
  h1 { font-size: 30px; }
  .actions { flex-direction: row; justify-content: space-between; }
  .actions .btn { width: auto; min-width: 160px; }
  .actions .btn.primary { flex: 1; max-width: 360px; }
  .actions.center { flex-direction: row; justify-content: center; }
  .actions.center .btn { flex: 1; }
  .row2 { grid-template-columns: 1fr 1fr; }
  .group { padding: 20px 20px 4px; }
}

/* ----------------------------------------------------------- ≥ 1024 px */
@media (min-width: 1024px) {
  .card { padding: 36px 40px 40px; }
  h1 { font-size: 32px; }
}

/* ------------------------------------------------ préférences de l'utilisateur */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .btn.is-busy::before, .timeline li.active .dot, .pg-icon.is-wait::after { animation: none !important; }
  .timeline li.active .dot { border-color: var(--teal); background: var(--teal-soft); }
}
@media (forced-colors: active) {
  .btn, .control input, .group { border: 1px solid CanvasText; }
  .segmented input:checked + span { outline: 3px solid Highlight; }
}
