/* PARCOURS DE RÉSERVATION : overlay plein écran (écran de téléphone sur desktop),
   écrans #etape-1 à #etape-6 affichés par js/flow.js selon l'ancre de l'URL. */

/* Overlay et cadre */
#flow { position: fixed; inset: 0; z-index: 100; background: rgba(15,31,58,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 16px; }
#flow[hidden] { display: none; }
#flow a { text-decoration: none; }
body.flow-open { overflow: hidden; }

.flow-close { position: absolute; top: 20px; right: 20px; width: 44px; height: 44px; border-radius: 50%; background: #fff; color: var(--ink); display: grid; place-items: center; box-shadow: 0 6px 18px rgba(15,31,58,.2); }
.flow-close:hover { color: var(--blue); }

.f-screen { position: relative; width: 390px; max-width: 100%; height: min(844px, calc(100dvh - 32px)); margin: 0; border-radius: 32px; overflow: hidden; background: var(--bg); color: var(--ink); box-shadow: 0 30px 80px rgba(15,31,58,.35); animation: flowIn .25s ease; }
.f-screen[hidden] { display: none; }
@keyframes flowIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.f-scr-in { width: 100%; height: 100%; display: flex; flex-direction: column; background: var(--bg); overflow: hidden; }

@media (max-width: 520px) {
  #flow { padding: 0; }
  .f-screen { width: 100%; height: 100dvh; border-radius: 0; box-shadow: none; }
  .flow-close { display: none; }
}

/* En-tête : retour + progression */
.f-top { display: flex; align-items: center; gap: 12px; padding: 16px 20px 8px; }
.f-back { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line-tile); background: #fff; display: grid; place-items: center; color: var(--ink); }
.f-prog { flex: 1; height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.f-prog i { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
.f-stepn { font-size: 12.5px; font-weight: 700; color: var(--muted); min-width: 28px; text-align: right; }

/* Corps défilant + pied */
.f-body { flex: 1; padding: 8px 20px 20px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
.f-h1 { font-size: 28px; line-height: 1.1; margin: 8px 0 0; font-weight: 800; }
.f-hint { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.f-foot { padding: 12px 20px 20px; background: linear-gradient(180deg, rgba(246,249,253,0), var(--bg) 30%); display: flex; flex-direction: column; gap: 10px; }

/* Desktop : popup plus large et plus aéré (le mobile garde les valeurs ci-dessus).
   L'espace vertical en plus n'est ajouté que si l'écran est assez haut pour tout afficher sans défiler. */
@media (min-width: 521px) {
  .f-screen { width: 540px; }
  .f-top { padding-left: 48px; padding-right: 48px; }
  .f-body { padding-left: 48px; padding-right: 48px; }
  .f-foot { padding-left: 48px; padding-right: 48px; }
  .f-tiles { gap: 14px; }
  .f-tile { padding: 18px; }
  .f-chips { gap: 12px; }
}
@media (min-width: 521px) and (min-height: 972px) {
  .f-screen { height: 940px; }
  .f-top { padding-top: 36px; padding-bottom: 16px; }
  .f-body { padding-top: 20px; padding-bottom: 32px; gap: 28px; }
  .f-foot { padding-top: 20px; padding-bottom: 40px; gap: 14px; }
  .f-h1 { font-size: 34px; }
  .f-gar { gap: 14px; }
}

/* Boutons du parcours */
.f-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 0 22px; border-radius: 14px; font-weight: 800; font-size: 16px; border: 0; width: 100%; }
.f-btn-primary { background: var(--blue); color: #fff; box-shadow: 0 8px 20px rgba(29,95,209,.28); }
.f-btn-primary:hover { background: var(--blue-hover); color: #fff; }
.f-btn-ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line-2); }
.f-applepay { background: #000; color: #fff; }
.f-applepay:hover { color: #fff; }
.f-safe { font-size: 12.5px; color: var(--muted); text-align: center; display: flex; gap: 6px; align-items: center; justify-content: center; line-height: 1.3; }
.f-safe svg { color: var(--green); }

/* Étape 1 : onglets + tuiles de métier */
.f-tabs { display: flex; background: var(--tabs-bg); padding: 4px; border-radius: 12px; gap: 4px; }
.f-tab { flex: 1; border: 0; background: transparent; padding: 10px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--text-2); min-height: 44px; }
.f-tab.f-on { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(15,31,58,.08); }
.f-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.f-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; background: #fff; border: 1.5px solid var(--line-tile); border-radius: 16px; padding: 14px; min-height: 92px; color: var(--ink); }
.f-tile:hover { border-color: var(--blue); color: var(--ink); }
.f-tile.f-on { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 3px rgba(29,95,209,.15); }
.f-tile.f-other { border-style: dashed; background: transparent; grid-column: span 2; flex-direction: row; align-items: center; min-height: 56px; }
.f-tile.f-other .f-tile-sub { margin-left: auto; }
.f-tile-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--blue-soft); display: grid; place-items: center; color: var(--muted); }
.f-tile.f-on .f-tile-ico { background: var(--blue); color: #fff; }
.f-tile b { font-size: 15px; }
.f-tile-sub { font-size: 12px; color: var(--muted); line-height: 1.3; }

/* Étape 2 : puces + description (champ .f-field, étape 5) + photo facultative (aperçu affiché par js/flow.js) */
.f-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.f-chips[hidden] { display: none; }
.f-chip { border: 1.5px solid var(--line-tile); background: #fff; border-radius: 999px; padding: 11px 16px; font-weight: 700; font-size: 14px; color: var(--ink); min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.f-chip.f-on { background: var(--blue); border-color: var(--blue); color: #fff; }
.f-chip:not(.f-on) .i { display: none; }
.f-photo { position: relative; display: flex; align-items: center; gap: 12px; border: 2px dashed var(--line-dashed); border-radius: 16px; padding: 12px 14px; background: #fff; cursor: pointer; }
.f-photo:hover { border-color: var(--blue); }
.f-photo:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.f-photo-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.f-photo-ico { width: 44px; height: 44px; border-radius: 10px; background: var(--blue-soft) center / cover no-repeat; color: var(--blue); display: grid; place-items: center; flex-shrink: 0; }
.f-photo.f-has { border-style: solid; border-color: var(--green); }
.f-photo.f-has .f-photo-ico svg { display: none; }
.f-photo-txt { flex: 1; min-width: 0; }
.f-photo b { display: block; font-size: 14.5px; }
.f-photo small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; margin-top: 4px; }
.f-photo-tag { font-size: 11px; font-weight: 700; color: var(--muted); background: var(--surface-2); padding: 3px 8px; border-radius: 999px; margin-left: 4px; vertical-align: middle; }
.f-photo-act { font-weight: 700; font-size: 13px; color: var(--blue); white-space: nowrap; }

/* Étape 3 : options de délai + créneaux */
.f-opt { display: flex; align-items: center; gap: 14px; background: #fff; border: 1.5px solid var(--line-tile); border-radius: 16px; padding: 14px 16px; color: var(--ink); }
.f-opt[hidden] { display: none; }
.f-opt.f-on { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 3px rgba(29,95,209,.15); }
.f-radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-dashed); flex-shrink: 0; display: grid; place-items: center; }
.f-opt.f-on .f-radio { border-color: var(--blue); background: var(--blue); color: #fff; }
.f-opt b { display: block; font-size: 15.5px; }
.f-opt small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.f-opt .f-pr { margin-left: auto; font-family: var(--font-display); font-weight: 800; font-size: 16px; white-space: nowrap; text-align: right; }
.f-opt .f-pr small { color: var(--danger); font-weight: 700; font-size: 11px; }
.f-reco { font-size: 11px; font-weight: 800; color: var(--green-dark); background: var(--green-soft); padding: 3px 8px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.f-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.f-slot { border: 1.5px solid var(--line-tile); background: #fff; border-radius: 10px; padding: 10px 4px; text-align: center; font-weight: 700; font-size: 13px; color: var(--ink); }
.f-slot.f-on { background: var(--blue); border-color: var(--blue); color: #fff; }
.f-slot.f-off { color: var(--muted-lighter); text-decoration: line-through; }
.f-slots-note { margin: 8px 0 0; color: var(--muted); font-size: 12.5px; }
.f-nowrap { white-space: nowrap; }

/* Étape 3 : calendrier de « Choisir une date » (rempli par js/flow.js) */
.f-cal { background: #fff; border: 1.5px solid var(--line-tile); border-radius: 16px; padding: 12px; margin-top: 10px; }
.f-cal[hidden] { display: none; }
.f-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.f-cal-month { font-size: 15px; text-transform: capitalize; }
.f-cal-nav { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line-tile); background: #fff; display: grid; place-items: center; color: var(--ink); }
.f-cal-nav:disabled { color: var(--muted-lighter); cursor: default; }
.f-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.f-cal-wd { font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.f-cal-day { border: 0; background: transparent; border-radius: 10px; min-height: 40px; font-size: 14px; font-weight: 700; color: var(--ink); }
.f-cal-day:not(:disabled):hover { background: var(--blue-soft); }
.f-cal-day:disabled { color: var(--muted-lighter); cursor: default; }
.f-cal-day.f-on { background: var(--blue); color: #fff; }
.f-cal .f-slots { margin-top: 12px; }

/* Récapitulatif (ligne blanche) */
.f-recap { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 13.5px; color: var(--text-2); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.f-recap b { color: var(--ink); }
.f-recap > b { white-space: nowrap; }
.f-edit { font-weight: 700; font-size: 13px; }

/* Étape 4 : prix + garanties */
.f-pricebox { background: var(--ink); color: #fff; border-radius: 22px; padding: 24px; text-align: center; position: relative; overflow: hidden; }
.f-pricebox::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 60% at 90% 0%, rgba(29,95,209,.55), transparent 70%); }
.f-price { font-family: var(--font-display); font-size: 64px; font-weight: 800; line-height: 1; position: relative; }
.f-pricebox small { display: block; color: var(--muted-lighter); font-size: 13.5px; margin-top: 8px; position: relative; line-height: 1.4; }
.f-incl { font-size: 12.5px; color: var(--muted); line-height: 1.45; margin: 0; }
.f-gar { display: flex; flex-direction: column; gap: 10px; }
.f-g { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.f-ck { width: 28px; height: 28px; border-radius: 8px; background: var(--green-soft); color: var(--green-dark); display: grid; place-items: center; flex-shrink: 0; }
.f-g b { display: block; font-size: 14.5px; }
.f-g small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }

/* Étape 5 : coordonnées */
.f-field { display: flex; flex-direction: column; gap: 6px; }
.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.f-row .f-field { min-width: 0; }
.f-field label { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.f-field input, .f-field textarea { width: 100%; border: 1.5px solid var(--line-tile); border-radius: 12px; padding: 0 14px; min-height: 50px; font-family: inherit; font-size: 15px; color: var(--ink); background: #fff; }
.f-field textarea { padding: 12px 14px; min-height: 96px; line-height: 1.4; resize: vertical; }
.f-field input::placeholder, .f-field textarea::placeholder { color: var(--muted); }
.f-field input:focus, .f-field textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; }

/* Étape 6 : confirmation + suivi */
.f-ok-banner { background: var(--green-soft); color: var(--green-dark); border-radius: 14px; padding: 14px; font-weight: 800; font-size: 15px; display: flex; gap: 10px; align-items: center; line-height: 1.3; }
.f-pro { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 14px; }
.f-pro .avatar { width: 52px; height: 52px; font-size: 17px; flex-shrink: 0; }
.f-pro b { display: block; font-size: 16px; }
.f-pro small { color: var(--muted); font-size: 12.5px; display: block; margin-top: 2px; }
.f-star { color: var(--amber); }
.f-row2 { display: flex; gap: 10px; }
.f-mini { flex: 1; border: 1.5px solid var(--line-2); background: #fff; border-radius: 12px; padding: 12px; text-align: center; font-weight: 800; font-size: 14px; color: var(--ink); min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.f-tl { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.f-tli { display: flex; gap: 12px; align-items: center; padding: 8px 0; font-size: 14px; font-weight: 700; color: var(--muted-lighter); position: relative; }
.f-tli .f-d { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); background: #fff; flex-shrink: 0; }
.f-tli.f-done { color: var(--ink); }
.f-tli.f-done .f-d { background: var(--green); border-color: var(--green); }
.f-tli.f-now { color: var(--blue); }
.f-tli.f-now .f-d { border-color: var(--blue); background: var(--blue); box-shadow: 0 0 0 4px rgba(29,95,209,.2); }
.f-tli small { margin-left: auto; font-weight: 600; color: var(--muted); font-size: 12px; }
.f-lockrow { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; font-size: 13.5px; line-height: 1.35; color: var(--text-2); }
.f-lockrow b { color: var(--ink); }
.f-lockrow .lockbox { width: 38px; height: 38px; }
