/* PROVISOIRE : feuille de style de la page "boîte à idées" Padel Pont l'Évêque.
   Palette tirée du logo (bleu, blanc, rouge). Une seule police, Archivo, hébergée sur place. */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --blue: #16209a;
  --blue-deep: #0c1370;
  --red: #e8212b;
  --ink: #0b1033;
  --muted: #4b5173;
  --paper: #ffffff;
  --tint: #f2f4fb;
  --line: #cfd4ea;
  --radius: 14px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; overflow-x: clip; }

body {
  margin: 0;
  font-family: "Archivo", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  overflow-x: clip;
}

/* Bande tricolore en haut */
.flag { display: flex; height: 8px; }
.flag i { flex: 1; }
.flag i:nth-child(1) { background: var(--blue); }
.flag i:nth-child(2) { background: var(--paper); box-shadow: inset 0 -1px 0 var(--line); }
.flag i:nth-child(3) { background: var(--red); }

.top {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo { width: 72px; height: 72px; display: block; border-radius: 50%; background: var(--paper); }
.tag {
  margin: 0;
  font-weight: 700;
  font-stretch: 115%;
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--blue);
  border: 2px solid var(--blue);
  border-radius: 999px;
  padding: 6px 14px;
  background: var(--paper);
}

main { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Hero */
.hero { position: relative; padding: 48px 0 40px; }
.kicker {
  margin: 0 0 14px;
  font-weight: 700;
  font-stretch: 115%;
  font-size: .85rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--red);
}
h1 {
  margin: 0;
  font-weight: 900;
  font-stretch: 112%;
  font-size: clamp(2.5rem, 9vw, 5.5rem);
  line-height: .98;
  letter-spacing: -.025em;
  color: var(--blue);
  text-wrap: balance;
}
h1 span { color: var(--ink); }
.lead { max-width: 34rem; margin: 22px 0 0; font-size: 1.2rem; color: var(--muted); }


/* Panneau du formulaire : bord net, ombre dure */
.panel {
  background: var(--paper);
  border: 3px solid var(--blue);
  border-radius: 22px;
  box-shadow: 10px 10px 0 var(--blue);
  padding: 28px 20px 24px;
  margin: 0 0 72px;
  max-width: 760px;
}
@media (min-width: 700px) { .panel { padding: 44px 48px 36px; } }

fieldset { border: 0; margin: 0 0 38px; padding: 0; min-width: 0; }
legend {
  padding: 0;
  margin-bottom: 16px;
  font-weight: 800;
  font-stretch: 108%;
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: -.01em;
}
legend b {
  display: inline-block;
  min-width: 2.2rem;
  margin-right: 6px;
  color: var(--red);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
legend em { font-style: normal; font-weight: 500; font-size: .9rem; color: var(--muted); margin-left: 6px; }

.field {
  display: block;
  margin: 18px 0 8px;
  font-weight: 600;
  font-size: .95rem;
  color: var(--ink);
}

/* Contrôles radio / case : l'input est masqué mais reste au clavier */
.scale input, .chips input, .seg input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

/* Note de 1 à 5 */
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.scale label {
  display: grid;
  place-items: center;
  min-height: 60px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  font-weight: 800;
  font-stretch: 112%;
  font-size: 1.5rem;
  color: var(--blue);
  background: var(--tint);
  cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
}
.scale label:hover { border-color: var(--blue); transform: translateY(-2px); }
.scale input:checked + label { background: var(--blue); border-color: var(--blue); color: #fff; }
.scale input:checked + label { transform: translateY(-2px); box-shadow: 0 4px 0 var(--red); }
.scale-legend { display: flex; justify-content: space-between; margin-top: 8px; font-size: .85rem; color: var(--muted); }

/* Pastilles */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chips label {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 18px;
  border: 2px solid var(--line);
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  background: var(--paper);
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.chips label:hover { border-color: var(--blue); }
.chips input:checked + label { background: var(--blue); border-color: var(--blue); color: #fff; }
.chips input:checked + label::before { content: "\2713"; margin-right: 8px; font-weight: 900; }

/* Choix oui / peut-être / non */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 2px solid var(--blue); border-radius: var(--radius); overflow: hidden; }
.seg label {
  display: grid;
  place-items: center;
  min-height: 54px;
  font-weight: 700;
  cursor: pointer;
  background: var(--paper);
  transition: background-color .15s ease, color .15s ease;
}
.seg label + input + label, .seg input + label + input + label { border-left: 2px solid var(--blue); }
.seg label:hover { background: var(--tint); }
.seg input:checked + label { background: var(--red); color: #fff; }

/* Champs texte */
input[type="text"], input[type="email"], textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem; /* 16px minimum : évite le zoom automatique sur iPhone */
  color: var(--ink);
  background: var(--tint);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 15px;
  transition: border-color .15s ease, background-color .15s ease;
}
textarea { resize: vertical; min-height: 96px; }
input::placeholder, textarea::placeholder { color: #8087a8; }
input[type="text"]:hover, input[type="email"]:hover, textarea:hover { border-color: #aab1d6; }
input[type="text"]:focus, input[type="email"]:focus, textarea:focus { outline: none; border-color: var(--blue); background: var(--paper); }

.two { display: grid; gap: 4px 16px; }
@media (min-width: 700px) { .two { grid-template-columns: 1fr 1fr; } }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Focus clavier visible partout */
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.scale input:focus-visible + label,
.chips input:focus-visible + label,
.seg input:focus-visible + label { outline: 3px solid var(--red); outline-offset: 3px; }

/* Envoi */
.send {
  width: 100%;
  min-height: 62px;
  font: inherit;
  font-weight: 800;
  font-stretch: 112%;
  font-size: 1.2rem;
  letter-spacing: .01em;
  color: #fff;
  background: var(--red);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--ink);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.send:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
.send:active { transform: translate(5px, 5px); box-shadow: 1px 1px 0 var(--ink); }
.send:disabled { opacity: .6; cursor: progress; transform: none; box-shadow: 6px 6px 0 var(--ink); }

.error { margin: 0 0 16px; padding: 12px 14px; border-radius: 10px; background: #fdeaea; border: 2px solid var(--red); color: #8c0f16; font-weight: 600; }
.fine { margin: 18px 0 0; font-size: .85rem; color: var(--muted); text-align: center; }

/* Remerciement */
.done { text-align: center; padding: 28px 0 20px; }
.done:focus { outline: none; }
.done h2 { margin: 18px 0 8px; font-weight: 900; font-stretch: 112%; font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.05; color: var(--blue); }
.done p { margin: 0 auto; max-width: 26rem; color: var(--muted); }
/* La balle rebondit de gauche à droite, son trajet trace le drapeau : bleu, blanc, rouge */
.bounce { display: block; width: calc(100% + 36px); margin: 0 -18px; height: auto; overflow: visible; }
@media (min-width: 700px) { .bounce { width: 100%; margin: 0; } }
.trail { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 2; stroke-dashoffset: 1; }
.trail.blue { stroke: var(--blue); stroke-width: 8; }
.trail.red { stroke: var(--red); stroke-width: 8; }
.trail.white { stroke: #fff; stroke-width: 8; }
.trail.edge { stroke: var(--line); stroke-width: 11; } /* léger contour pour que le blanc reste visible sur fond blanc */
.done.static .trail { stroke-dashoffset: 0; }
.done .bounce #ballMove { opacity: 0; }
.done.play .bounce #ballMove, .done.static .bounce #ballMove { opacity: 1; }
.done h2, .done p { opacity: 0; transform: translateY(8px); }
.done.play h2, .done.static h2 { animation: rise .5s ease 2.2s forwards; }
.done.play p, .done.static p { animation: rise .5s ease 2.45s forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

footer { border-top: 2px solid var(--line); padding: 22px 20px 36px; text-align: center; color: var(--muted); font-size: .85rem; }
footer p { margin: 0 auto; max-width: 40rem; }

/* Barre de progression */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 5px; z-index: 30; background: transparent; pointer-events: none; }
.progress i { display: block; height: 100%; width: 0; background: var(--red); transition: width .35s ease; }

/* Confort mobile : pas de délai au toucher, pas de halo gris */
a, button, label, input, textarea { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* ---- Mobile d'abord : ajustements sous 700px ---- */
@media (max-width: 699px) {
  .top { padding-top: 14px; }
  .logo { width: 56px; height: 56px; }
  .tag { font-size: .72rem; padding: 5px 12px; }
  .hero { padding: 26px 0 26px; }
  .kicker { margin-bottom: 10px; font-size: .75rem; }
  h1 { font-size: clamp(2.2rem, 11vw, 3rem); }
  .lead { margin-top: 14px; font-size: 1.02rem; }
  .panel { padding: 24px 18px 18px; margin-bottom: 32px; border-width: 2px; box-shadow: 6px 6px 0 var(--blue); border-radius: 18px; }
  fieldset { margin-bottom: 30px; }
  legend { font-size: 1.2rem; }
  .field { margin-top: 14px; }
  /* Pastilles sur deux colonnes, plus faciles à viser du pouce */
  .chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .chips label { min-height: 50px; padding: 0 12px; border-radius: 14px; font-size: .95rem; }
  .scale label { min-height: 62px; }
  .seg label { min-height: 56px; }
  textarea { min-height: 88px; }

  /* Bouton d'envoi toujours à portée du pouce, au-dessus de la barre du téléphone */
  .send-wrap {
    position: sticky;
    bottom: 0;
    z-index: 20;
    margin: 0 -18px -18px;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
    background: var(--paper);
    border-top: 2px solid var(--line);
    border-radius: 0 0 16px 16px;
  }
  .send { min-height: 58px; box-shadow: 4px 4px 0 var(--ink); }
  .send:hover { transform: none; box-shadow: 4px 4px 0 var(--ink); }
  .send:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
  .fine { margin: 20px 0 6px; }
}

@media (max-width: 380px) {
  .scale { gap: 6px; }
  .scale label { min-height: 54px; font-size: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .done h2, .done p { opacity: 1; transform: none; }
}
