/* ===================== QUESTIONNAIRE (style Typeform) ===================== */
.tf {
  position: relative; overflow: hidden; text-align: left;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-md); margin: 40px auto 0; max-width: 880px; min-height: 520px;
  display: flex; flex-direction: column;
}
.tf-progress { height: 4px; background: var(--blue-light); }
.tf-progress span { display: block; height: 100%; width: 0; background: var(--blue); transition: width .45s cubic-bezier(.2,.8,.2,1); }
.tf-stage { position: relative; flex: 1; display: flex; }
.tf-screen {
  flex: 1; padding: 56px 72px 40px; display: flex; flex-direction: column; justify-content: center;
  animation: tfIn .45s cubic-bezier(.2,.8,.2,1) both;
}
.tf-screen.out { animation: tfOut .22s ease-in both; }
.tf-screen.back { animation-name: tfInBack; }
@keyframes tfIn { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes tfInBack { from { opacity: 0; transform: translateY(-28px); } to { opacity: 1; transform: none; } }
@keyframes tfOut { to { opacity: 0; transform: translateY(-18px); } }

.tf-kicker { display: flex; align-items: center; gap: 8px; color: var(--blue); font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.tf-kicker svg { width: 14px; height: 14px; }
.tf-title { font-family: var(--font-head); font-size: 27px; line-height: 1.3; font-weight: 600; color: var(--navy); letter-spacing: -.01em; text-wrap: balance; }
.tf-title .req { color: var(--blue); }
.tf-desc { color: var(--muted); font-size: 16px; margin-top: 10px; max-width: 640px; }
.tf-intro { color: var(--muted); font-size: 14px; margin-bottom: 22px; display: flex; align-items: center; gap: 8px; }
.tf-intro svg { width: 16px; height: 16px; color: var(--blue); flex: none; }

.tf-field { margin-top: 30px; }
.tf-input, .tf-textarea, .tf-select {
  width: 100%; border: 0; border-bottom: 2px solid rgba(37,99,235,.28); background: transparent;
  font: 500 24px/1.4 var(--font); color: var(--navy); padding: 8px 0 10px; outline: none; border-radius: 0;
  transition: border-color .2s;
}
.tf-input::placeholder, .tf-textarea::placeholder { color: rgba(18,59,99,.32); }
.tf-input:focus, .tf-textarea:focus, .tf-select:focus { border-bottom-color: var(--blue); }
.tf-textarea { resize: none; min-height: 48px; max-height: 220px; font-size: 21px; }
.tf-age { display: flex; align-items: baseline; gap: 12px; max-width: 220px; }
.tf-age span { font-size: 22px; color: var(--muted); }
.tf-phone { display: flex; gap: 14px; align-items: flex-end; }
.tf-select { width: auto; flex: none; font-size: 20px; padding-right: 4px; cursor: pointer; appearance: auto; }

.tf-choices { display: grid; gap: 10px; margin-top: 28px; max-width: 520px; }
.tf-choices.grid { grid-template-columns: repeat(3, 1fr); max-width: 640px; }
.tf-choice {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  font: 500 17px/1.3 var(--font); color: var(--navy); background: var(--blue-light);
  border: 1.5px solid rgba(37,99,235,.22); border-radius: 10px; padding: 12px 14px;
  transition: background .15s, border-color .15s, transform .15s;
}
.tf-choice:hover { border-color: var(--blue); background: #E3ECFB; }
.tf-choice:active { transform: scale(.985); }
.tf-choice .key {
  flex: none; width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: var(--blue); background: var(--white); border: 1.5px solid rgba(37,99,235,.3);
}
.tf-choice .ok { margin-left: auto; width: 18px; height: 18px; opacity: 0; color: var(--white); }
.tf-choice.sel { background: var(--blue); border-color: var(--blue); color: var(--white); }
.tf-choice.sel .key { background: var(--white); color: var(--blue); border-color: var(--white); }
.tf-choice.sel .ok { opacity: 1; }
.tf-choice.blink { animation: tfBlink .32s ease 2; }
.tf button:focus { outline: none; }
.tf button:focus-visible { outline: 3px solid rgba(37,99,235,.35); outline-offset: 2px; }
@keyframes tfBlink { 50% { opacity: .55; } }

.tf-actions { display: flex; align-items: center; gap: 16px; margin-top: 30px; flex-wrap: wrap; }
.tf-btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; border: 0; border-radius: 10px;
  background: var(--blue); color: var(--white); font: 600 17px/1 var(--font); padding: 14px 24px;
  box-shadow: 0 8px 20px rgba(37,99,235,.28); transition: background .15s, transform .15s, box-shadow .15s;
}
.tf-btn:hover { background: var(--blue-hover); transform: translateY(-1px); }
.tf-btn:disabled { opacity: .55; cursor: default; transform: none; }
.tf-btn svg { width: 17px; height: 17px; }
.tf-btn.ghost { background: var(--white); color: var(--navy); border: 1.5px solid var(--border); box-shadow: none; }
.tf-btn.ghost:hover { background: var(--offwhite); }
.tf-btn.lg { font-size: 18px; padding: 17px 28px; }
.tf-hint { font-size: 13px; color: var(--muted); }
.tf-hint b { font-weight: 600; color: var(--navy-2); }
.tf-error { color: #B42318; background: #FEF3F2; border: 1px solid #FECDCA; border-radius: 8px; font-size: 14px; padding: 8px 12px; margin-top: 16px; display: none; }
.tf-error.show { display: inline-block; }

.tf-nav { position: absolute; left: 20px; bottom: 16px; }
.tf-back { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; cursor: pointer; color: var(--muted); font: 500 14px var(--font); padding: 8px; border-radius: 8px; }
.tf-back[hidden] { display: none; }
.tf-back:hover { color: var(--navy); background: var(--offwhite); }
.tf-back svg { width: 15px; height: 15px; }
.tf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Chargement / états finaux */
.tf-center { align-items: center; text-align: center; }
.tf-center .tf-desc { margin-left: auto; margin-right: auto; }
.tf-spin { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--blue-light); border-top-color: var(--blue); animation: tfSpin .8s linear infinite; margin-bottom: 22px; }
@keyframes tfSpin { to { transform: rotate(360deg); } }
.tf-badge { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 20px; }
.tf-badge svg { width: 30px; height: 30px; }
.tf-badge.good { background: rgba(22,163,74,.12); color: #16a34a; }
.tf-badge.info { background: var(--blue-light); color: var(--blue); }

/* Délai d'ouverture */
.tf-ring { position: relative; width: 120px; height: 120px; margin-bottom: 22px; }
.tf-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.tf-ring circle { fill: none; stroke-width: 7; }
.tf-ring .bg { stroke: var(--blue-light); }
.tf-ring .fg { stroke: var(--blue); stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.tf-count { position: absolute; inset: 0; display: grid; place-items: center; font: 700 28px var(--font); color: var(--navy); font-variant-numeric: tabular-nums; }
.tf-lock .tf-title { max-width: 520px; }

/* Calendrier */
/* Jours et horaires sur la même grille (--cols colonnes, même écart) : cases alignées.
   Marge négative + padding : le contour de focus n'est pas coupé et le bord gauche reste aligné sur le titre. */
.tf-days, .tf-times { --cols: 7; --gap: 10px; }
.tf-days { display: flex; gap: var(--gap); margin: 22px -5px 0; padding: 5px 5px 8px; overflow-x: auto; scrollbar-width: thin; scroll-snap-type: x proximity; scroll-padding-inline: 5px; }
.tf-day {
  flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols)); min-width: 0; scroll-snap-align: start;
  cursor: pointer; text-align: center; border-radius: 12px; padding: 12px 4px;
  background: var(--white); border: 1.5px solid var(--border); color: var(--navy); font-family: var(--font);
  transition: border-color .15s, background .15s;
}
.tf-day:hover { border-color: var(--blue); }
.tf-day .dow { display: block; font-size: 13px; text-transform: capitalize; color: var(--muted); }
.tf-day .num { display: block; font-size: 24px; font-weight: 700; line-height: 1.2; margin: 2px 0; }
.tf-day .mon { display: block; font-size: 13px; text-transform: capitalize; }
.tf-day.sel { background: var(--blue); border-color: var(--blue); color: var(--white); }
.tf-day.sel .dow { color: rgba(255,255,255,.8); }
.tf-times { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: var(--gap); margin: 8px -5px 0; padding: 5px; max-height: 240px; overflow-y: auto; }
.tf-time {
  cursor: pointer; border-radius: 9px; padding: 11px 6px; font: 600 15px var(--font); color: var(--blue);
  background: var(--white); border: 1.5px solid rgba(37,99,235,.35); transition: background .15s, color .15s;
}
.tf-time:hover { background: var(--blue-light); }
.tf-time.sel { background: var(--blue); color: var(--white); border-color: var(--blue); }
.tf-tz { font-size: 13px; color: var(--muted); margin-top: 14px; }
@media (max-width: 900px) { .tf-days, .tf-times { --cols: 5; } }
@media (max-width: 520px) { .tf-days, .tf-times { --cols: 4; --gap: 8px; } .tf-day .num { font-size: 21px; } .tf-time { font-size: 14px; } }

@media (max-width: 700px) {
  .tf { min-height: 560px; margin-top: 28px; }
  .tf-screen { padding: 40px 22px 64px; justify-content: flex-start; }
  .tf-title { font-size: 22px; }
  .tf-desc { font-size: 15px; }
  .tf-input { font-size: 20px; }
  .tf-textarea { font-size: 18px; }
  .tf-choices.grid { grid-template-columns: repeat(2, 1fr); }
  .tf-choice { font-size: 16px; }
  .tf-hint { display: none; }
  .tf-phone { flex-direction: column; align-items: stretch; }
  .tf-select { width: 100%; font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .tf-screen, .tf-screen.out { animation: none; }
  .tf-progress span { transition: none; }
}

