/* ════════════════════════════════════════════════════════════════
   ia.docteurseo.com — formulaire « communauté IA » + tableau de bord
   Encre profonde · halo violet/turquoise · cartes de verre
   Typo commune au site principal : Bricolage Grotesque + Schibsted Grotesk
   ════════════════════════════════════════════════════════════════ */
:root {
  --fond: #0d0c12;
  --fond-2: #15131f;
  --carte: rgba(255, 255, 255, 0.045);
  --carte-forte: rgba(255, 255, 255, 0.07);
  --bord: rgba(255, 255, 255, 0.10);
  --bord-fort: rgba(255, 255, 255, 0.2);
  --texte: #f5f3f9;
  --doux: #a9a4bb;
  /* --doux sur --fond : 7,3:1. Le gris ne descend pas plus bas : ce
     formulaire se lit surtout dehors, sur un téléphone, en pleine lumière. */
  --accent: #8b7bff;
  --accent-2: #38dbc4;
  --accent-txt: #b9afff;
  --erreur: #ff8b8b;
  --trait: #cfc9e6;
  --r-lg: 28px;
  --r-md: 16px;
  --r-pill: 999px;
  --font-display: 'Bricolage Grotesque', 'Schibsted Grotesk', sans-serif;
  --font-body: 'Schibsted Grotesk', -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
/* `display: flex` sur une classe l'emporte sur la règle `[hidden]` du
   navigateur : sans ce rappel, la jauge et la barre de boutons restent
   visibles sur l'écran d'accueil, où elles n'ont rien à annoncer. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--texte);
  background: var(--fond);
  overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.025em; line-height: 1.15; margin: 0; }
a { color: var(--accent-txt); }
img, svg { max-width: 100%; }

/* ── Halo de fond ──────────────────────────────────────────────── */
.aurore { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aurore span {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
}
.aurore .a1 {
  width: 52vmax; height: 52vmax;
  top: -22vmax; left: -14vmax;
  background: radial-gradient(circle, rgba(139, 123, 255, 0.75), transparent 68%);
  animation: derive1 22s ease-in-out infinite alternate;
}
.aurore .a2 {
  width: 44vmax; height: 44vmax;
  right: -16vmax; bottom: -20vmax;
  background: radial-gradient(circle, rgba(56, 219, 196, 0.5), transparent 68%);
  animation: derive2 26s ease-in-out infinite alternate;
}
@keyframes derive1 { to { transform: translate3d(12vmax, 8vmax, 0) scale(1.12); } }
@keyframes derive2 { to { transform: translate3d(-10vmax, -6vmax, 0) scale(1.08); } }

/* ── Scène ─────────────────────────────────────────────────────── */
.scene {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  max-width: 680px;
  margin: 0 auto;
  padding: 28px 18px calc(32px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  /* `safe center` et pas `center` : dès que la carte est plus haute que
     l'écran — question longue sur un téléphone —, un centrage strict pousse
     son HAUT hors du cadre, et rien ne permet d'y remonter. `safe` bascule
     alors sur un alignement en haut. Les navigateurs qui ne le connaissent pas
     ignorent la déclaration et alignent en haut : le même comportement. */
  justify-content: safe center;
  gap: 18px;
}

.marque {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--doux);
  text-decoration: none;
  transition: color 0.2s;
}
.marque:hover { color: var(--texte); }
.pastille {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(56, 219, 196, 0.16);
  animation: pouls 2.6s ease-in-out infinite;
}
@keyframes pouls {
  50% { box-shadow: 0 0 0 8px rgba(56, 219, 196, 0.05); }
}

/* ── Carte ─────────────────────────────────────────────────────── */
.carte {
  position: relative;
  width: 100%;
  background: linear-gradient(160deg, var(--carte-forte), var(--carte));
  border: 1px solid var(--bord);
  border-radius: var(--r-lg);
  padding: 26px 24px 24px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: monte 0.6s cubic-bezier(0.22, 0.8, 0.28, 1) both;
}
@keyframes monte {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
}

/* ── Jauge de progression ──────────────────────────────────────── */
.jauge { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.jauge-piste {
  flex: 1;
  height: 6px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}
.jauge-remplie {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.45s cubic-bezier(0.22, 0.8, 0.28, 1);
}
.jauge-txt { font-size: 12.5px; font-weight: 600; color: var(--doux); font-variant-numeric: tabular-nums; }

/* ── Étapes ────────────────────────────────────────────────────── */
.etapes { transition: height 0.35s cubic-bezier(0.22, 0.8, 0.28, 1); }
.etapes.mesure { overflow: hidden; }
.etape[hidden] { display: none !important; }
.etape { animation: venirDroite 0.4s cubic-bezier(0.22, 0.8, 0.28, 1) both; }
[data-sens='arriere'] .etape { animation-name: venirGauche; }
@keyframes venirDroite { from { opacity: 0; transform: translateX(22px); } }
@keyframes venirGauche { from { opacity: 0; transform: translateX(-22px); } }

.kicker {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 8px;
  font-size: 12.5px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-txt);
}
.facultatif {
  font-style: normal; font-size: 11px; letter-spacing: 0.04em;
  padding: 2px 8px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.08); color: var(--doux);
}
.etape h1 { font-size: clamp(25px, 6.2vw, 34px); margin-bottom: 12px; }
.etape h2 { font-size: clamp(20px, 4.8vw, 26px); margin-bottom: 8px; }
.chapo { color: var(--doux); font-size: 16px; margin: 0 0 22px; }
.aide { color: var(--doux); font-size: 14.5px; margin: 0 0 18px; }
.mini { color: var(--doux); font-size: 12.5px; margin: 14px 0 0; }

/* ── Illustrations ─────────────────────────────────────────────── */
.illu { margin: 0 auto 18px; max-width: 300px; }
.illu svg { display: block; width: 100%; height: auto; }
.illu [class^='il-'] {
  fill: none;
  stroke: var(--trait);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.illu .il-accent { stroke: var(--accent-2); }
.illu .il-pt { fill: var(--accent-2); stroke: none; }

/* Le tracé ne s'anime que si `data-anim` a été posé par le script : sans
   JavaScript, le dessin s'affiche simplement terminé. */
.illu[data-anim] [class^='il-']:not(.il-pt) { stroke-dasharray: 100; stroke-dashoffset: 100; }
.illu[data-anim] .il-pt { opacity: 0; }
.etape:not([hidden]) .illu[data-anim] [class^='il-']:not(.il-pt) {
  animation: trace 0.6s cubic-bezier(0.4, 0, 0.25, 1) forwards;
}
.etape:not([hidden]) .illu[data-anim] .il-pt { animation: pointille 0.4s ease forwards 0.7s; }
.illu[data-anim] .il-1 { animation-delay: 0.06s; }
.illu[data-anim] .il-2 { animation-delay: 0.2s; }
.illu[data-anim] .il-3 { animation-delay: 0.34s; }
.illu[data-anim] .il-4 { animation-delay: 0.46s; }
.illu[data-anim] .il-5 { animation-delay: 0.58s; }
@keyframes trace { to { stroke-dashoffset: 0; } }
@keyframes pointille { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: scale(1); } }

/* ── Champs ────────────────────────────────────────────────────── */
.champ {
  width: 100%;
  font-family: inherit;
  font-size: 16.5px; /* 16px minimum : en dessous, iOS zoome à la mise au point */
  color: var(--texte);
  background: rgba(0, 0, 0, 0.28);
  border: 1.5px solid var(--bord);
  border-radius: var(--r-md);
  padding: 15px 16px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.champ::placeholder { color: #7d788e; }
.champ:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.42);
  box-shadow: 0 0 0 4px rgba(139, 123, 255, 0.18);
}
.champ-long { resize: vertical; min-height: 120px; line-height: 1.5; }
.champ.faux { border-color: var(--erreur); animation: secoue 0.4s; }
@keyframes secoue {
  25% { transform: translateX(-6px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}
.compteur { margin: 8px 2px 0; font-size: 12px; color: var(--doux); text-align: right; font-variant-numeric: tabular-nums; }

/* ── Tuiles de choix ───────────────────────────────────────────── */
.choix { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.choix-2 { grid-template-columns: 1fr; }
@media (max-width: 460px) { .choix { grid-template-columns: 1fr; } }

.tuile {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 44px 14px 15px;
  border: 1.5px solid var(--bord);
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.tuile:hover { border-color: var(--bord-fort); transform: translateY(-2px); }
.tuile input { position: absolute; opacity: 0; width: 0; height: 0; }
.tuile-corps { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tuile-label { font-weight: 600; font-size: 15.5px; }
.tuile-detail { font-size: 12.5px; color: var(--doux); }
.tuile-coche {
  position: absolute; right: 14px; top: 50%;
  width: 22px; height: 22px; margin-top: -11px;
  fill: none; stroke: var(--accent-2); stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round;
  opacity: 0; transform: scale(0.5);
  transition: opacity 0.2s, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tuile:has(input:checked) {
  border-color: var(--accent);
  background: rgba(139, 123, 255, 0.14);
  box-shadow: 0 0 0 3px rgba(139, 123, 255, 0.14);
}
.tuile:has(input:checked) .tuile-coche { opacity: 1; transform: scale(1); }
.tuile:has(input:focus-visible) { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* ── Boutons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: inherit; font-size: 15.5px; font-weight: 650;
  padding: 14px 22px;
  border-radius: var(--r-pill);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s, border-color 0.2s, opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }
.btn-primaire {
  color: #100e18;
  background: linear-gradient(100deg, var(--accent-2), var(--accent));
  box-shadow: 0 10px 28px -10px rgba(139, 123, 255, 0.8);
}
.btn-primaire:hover { box-shadow: 0 14px 34px -10px rgba(139, 123, 255, 0.95); transform: translateY(-1px); }
.btn-fantome { color: var(--texte); background: transparent; border-color: var(--bord-fort); }
.btn-fantome:hover { background: rgba(255, 255, 255, 0.07); }
.btn[disabled] { opacity: 0.55; pointer-events: none; }
.fleche { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s; }
.btn-primaire:hover .fleche { transform: translateX(3px); }
.btn-retour:hover .fleche-g { transform: translateX(-3px); }

.barre { display: flex; gap: 10px; margin-top: 22px; }
.barre .btn-primaire { flex: 1; }
.barre .btn-retour { flex: 0 0 auto; padding-inline: 18px; }
.etape-fin { text-align: center; }
.etape-fin .btn { margin-top: 6px; }

/* ── Erreur ────────────────────────────────────────────────────── */
.erreur {
  margin: 14px 0 0;
  padding: 11px 14px;
  font-size: 14px;
  color: var(--erreur);
  background: rgba(255, 139, 139, 0.1);
  border: 1px solid rgba(255, 139, 139, 0.28);
  border-radius: var(--r-md);
  animation: venirDroite 0.3s both;
}
.erreur[hidden] { display: none; }

/* Pot de miel : hors de l'écran, jamais lu par un lecteur d'écran. */
.pot-de-miel { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.pied { display: flex; gap: 10px; font-size: 12.5px; color: var(--doux); margin: 4px 0 0; }
.pied a { color: var(--doux); text-decoration: none; }
.pied a:hover { color: var(--texte); text-decoration: underline; }

/* ════════════════════════════════════════════════════════════════
   Tableau de bord
   ════════════════════════════════════════════════════════════════ */
.page-tableau .scene { justify-content: flex-start; }
.admin {
  position: relative; z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 18px calc(48px + env(safe-area-inset-bottom));
}
.carte-login { max-width: 420px; margin: 12vh auto 0; text-align: center; }
.carte-login .champ { margin: 18px 0 12px; }
.carte-login .btn { width: 100%; }

.admin-tete {
  display: flex; flex-wrap: wrap; gap: 12px;
  align-items: center; justify-content: space-between;
  margin-bottom: 22px;
}
.admin-tete h1 { font-size: 26px; }
.admin-actions { display: flex; gap: 8px; }
.btn-mini { padding: 9px 15px; font-size: 13.5px; }

.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.chiffre {
  background: var(--carte); border: 1px solid var(--bord);
  border-radius: var(--r-md); padding: 16px 16px 14px;
  animation: monte 0.5s cubic-bezier(0.22, 0.8, 0.28, 1) both;
}
.chiffre b { display: block; font-family: var(--font-display); font-size: 30px; line-height: 1.05; }
.chiffre span { font-size: 12.5px; color: var(--doux); }
.chiffre em { font-style: normal; color: var(--accent-2); }

.panneaux { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 780px) { .panneaux { grid-template-columns: 1fr; } }

.panneau {
  background: var(--carte); border: 1px solid var(--bord);
  border-radius: var(--r-lg); padding: 18px 18px 20px;
  margin-bottom: 14px;
}
.panneau h2 { font-size: 16px; margin-bottom: 14px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.panneau h2 small { font-family: var(--font-body); font-size: 12.5px; font-weight: 400; color: var(--doux); letter-spacing: 0; }

/* Colonnes, pas courbe : on lit un volume par jour, pas une tendance.
   La piste porte la hauteur ; l'étiquette est HORS d'elle, sans quoi une
   colonne à 100 % dépasse du panneau de la hauteur du texte. */
.courbe { display: flex; align-items: flex-end; gap: 4px; }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.col .piste { width: 100%; height: 104px; display: flex; align-items: flex-end; }
.col i {
  display: block; width: 100%; min-height: 3px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, var(--accent), rgba(139, 123, 255, 0.28));
  transform-origin: bottom;
  animation: pousse 0.5s cubic-bezier(0.22, 0.8, 0.28, 1) both;
}
/* Hauteur fixe même vide : les colonnes sont alignées par le BAS, une
   étiquette absente remonterait sa colonne de la hauteur du texte. */
.col small { font-size: 10px; color: var(--doux); min-height: 13px; line-height: 13px; }
@keyframes pousse { from { transform: scaleY(0); opacity: 0; } }

.barres { display: flex; flex-direction: column; gap: 10px; }
.barre-ligne { display: grid; grid-template-columns: 108px 1fr 68px; align-items: center; gap: 10px; font-size: 13.5px; }
.barre-piste { height: 9px; border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.barre-remplie {
  height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transform-origin: left;
  animation: etire 0.6s cubic-bezier(0.22, 0.8, 0.28, 1) both;
}
@keyframes etire { from { transform: scaleX(0); } }
.barre-n { text-align: right; color: var(--doux); font-variant-numeric: tabular-nums; }

.nuage { display: flex; flex-wrap: wrap; gap: 8px; }
.mot {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 7px 13px; border-radius: var(--r-pill);
  background: rgba(139, 123, 255, 0.12);
  border: 1px solid rgba(139, 123, 255, 0.25);
  font-size: 14px;
}
.mot b { font-weight: 600; }
.mot span { font-size: 11.5px; color: var(--accent-txt); }
.vide { color: var(--doux); font-size: 14px; margin: 0; }

.filtres { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; align-items: center; }
.champ-mini { width: auto; flex: 1 1 200px; padding: 10px 13px; font-size: 14.5px; border-radius: 12px; }
select.champ-mini { flex: 0 0 auto; }
.bascule { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--doux); cursor: pointer; }
.bascule input { accent-color: var(--accent); width: 16px; height: 16px; }

.liste { display: flex; flex-direction: column; gap: 10px; }
.rep {
  border: 1px solid var(--bord); border-radius: var(--r-md);
  background: rgba(0, 0, 0, 0.2); padding: 14px 16px;
}
.rep-tete { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; justify-content: space-between; }
.rep-act { font-weight: 650; font-size: 15px; }
.rep-date { font-size: 12px; color: var(--doux); font-variant-numeric: tabular-nums; }
.rep-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0 10px; }
.tag {
  font-size: 11.5px; padding: 3px 9px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.08); color: var(--doux);
}
.tag-oui { background: rgba(56, 219, 196, 0.16); color: var(--accent-2); }
.tag-sujet { background: rgba(139, 123, 255, 0.16); color: var(--accent-txt); }
.rep p { margin: 0 0 8px; font-size: 14.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.rep p:last-child { margin-bottom: 0; }
.rep p b { color: var(--doux); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; display: block; margin-bottom: 2px; }
.rep-contact { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; }

/* ── Mouvement réduit : on garde l'information, on retire le mouvement ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .illu[data-anim] [class^='il-']:not(.il-pt) { stroke-dashoffset: 0; }
  .illu[data-anim] .il-pt { opacity: 1; }
}
