/* ==========================================================================
   2M Digital — Page /rdv (prise de rendez-vous)
   S'appuie sur style.css (titres, boutons, tuiles, liste groupée) et contact.css (champs .field, .choices).
   ========================================================================== */

.rdv-head {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  padding-top: 56px;
  padding-bottom: 56px;
}
.rdv-head .glow { top: -300px; right: max(-160px, (100% - 1440px) / 2); }

/* ---------- Récapitulatif + étapes ---------- */

.planner {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding-bottom: 96px;
}

.recap { position: sticky; top: 104px; display: flex; flex-direction: column; gap: 16px; }
.recap__card { display: flex; flex-direction: column; gap: 14px; padding: 28px; }
.recap__host { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 500; color: var(--label-2); }
.recap__avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.recap__type { font-size: 28px; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
.recap__desc { font-size: 16px; line-height: 1.5; color: var(--label-2); }
.recap__desc:empty { display: none; }

.recap__meta .list__row { --sep-left: 68px; align-items: center; gap: 14px; padding: 14px 20px; }
.recap__meta [hidden] { display: none; }
/* Filet seulement entre deux lignes visibles */
.recap__meta .list__row::before { content: none; }
.recap__meta .list__row:not([hidden]) ~ .list__row::before { content: ""; }
.recap__value { font-size: 17px; font-weight: 600; line-height: 1.35; }
.recap__when .recap__value { color: var(--yellow); }
.recap__tz .recap__value { font-weight: 400; color: var(--label-2); }
.recap__tz .tile { background: var(--surface-2); color: var(--label-2); }

.steps-panel { min-width: 0; min-height: 560px; padding: 36px; }
.rdv-loading { color: var(--label-2); }

.step-title { font-size: 30px; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
.step-sub { margin-top: 8px; font-size: 17px; line-height: 1.5; color: var(--label-2); }

.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 8px 14px 8px 10px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--label);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .15s ease;
}
.back .icon { width: 18px; height: 18px; }
.back:hover { background: var(--surface-3); }

.icon--flip { transform: scaleX(-1); }

/* ---------- Choix du type ---------- */

.types { margin-top: 24px; background: var(--surface-2); }
.type-card { width: 100%; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.type-card:hover { background: var(--surface-3); }
.type-card + .type-card::before { left: 84px; background: #48484a; }

/* ---------- Calendrier + horaires ---------- */

.picker { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 40px; margin-top: 28px; }

.cal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.cal__month { font-size: 21px; font-weight: 600; }
.cal__nav { display: flex; gap: 8px; }
.cal__nav button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--label);
  cursor: pointer;
  transition: background-color .15s ease;
}
.cal__nav .icon { width: 20px; height: 20px; }
.cal__nav button:hover:not(:disabled) { background: var(--surface-3); }
.cal__nav button:disabled { opacity: .35; cursor: default; }

.cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal__dow { padding-bottom: 8px; text-align: center; font-size: 13px; font-weight: 600; color: var(--label-3); }
.cal__day {
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 52px;
  aspect-ratio: 1;
  justify-self: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--label-3);
  font: inherit;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.cal__day[data-free] {
  background: var(--surface-2);
  color: var(--label);
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s ease, transform .15s ease;
}
.cal__day[data-free]:hover { background: var(--surface-3); }
.cal__day[data-free]:active { transform: scale(.94); }
.cal__day--today { color: var(--yellow); }
.cal__day[aria-pressed="true"] { background: var(--yellow); color: var(--on-yellow); }

.times__day { font-size: 17px; font-weight: 600; }
.times__list { display: flex; flex-direction: column; gap: 8px; max-height: 440px; margin-top: 14px; padding-right: 4px; overflow-y: auto; }
.time { display: flex; gap: 8px; }
.time__btn, .time__go {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 12px;
  border: 1.5px solid transparent;
  border-radius: var(--r-sm);
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.time__btn { background: var(--surface-2); color: var(--label); }
.time__btn:hover { background: var(--surface-3); }
.time--selected .time__btn { flex: 0 0 44%; border-color: var(--label-2); }
.time__go { background: var(--yellow); color: var(--on-yellow); }
.time__go .icon { width: 18px; height: 18px; stroke-width: 2.25; }
.times__empty { margin-top: 14px; font-size: 15px; color: var(--label-2); }

/* ---------- Formulaire ---------- */

.book-form { display: flex; flex-direction: column; gap: 20px; max-width: 680px; margin-top: 28px; }
.book-form__submit { align-self: flex-start; }
.book-form__legal { font-size: 14px; line-height: 1.5; color: var(--label-3); }
.book-form__legal a { color: var(--label-2); text-decoration: underline; text-underline-offset: 3px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Confirmation / annulation ---------- */

.done { max-width: 680px; }
.done__stamp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 8px 14px 8px 12px;
  border-radius: 999px;
  background: rgba(48, 209, 88, .16);
  color: var(--green);
  font-size: 15px;
  font-weight: 600;
}
.done__stamp .icon { width: 18px; height: 18px; stroke-width: 2.5; }
.done__stamp--ko { background: rgba(255, 69, 58, .16); color: var(--red); }
.done__text { margin-top: 14px; font-size: 18px; line-height: 1.55; color: var(--label-2); }
.done__text strong { font-weight: 600; color: var(--label); }
.done__text a { color: var(--yellow); text-decoration: underline; text-underline-offset: 3px; word-break: break-all; }
.done__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 32px; }

.btn--danger { background: var(--red); color: #fff; }
.btn--danger:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: default; }

.rdv-error { margin-top: 16px; font-size: 16px; color: var(--red); }
.rdv-error[hidden] { display: none; }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .planner { grid-template-columns: minmax(0, 1fr); }
  .recap { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .rdv-head { padding-top: 32px; padding-bottom: 40px; gap: 18px; }
  .recap { grid-template-columns: minmax(0, 1fr); }
  .recap__card { padding: 22px; }
  .recap__type { font-size: 24px; }
  .steps-panel { min-height: 0; padding: 24px 18px; }
  .step-title { font-size: 26px; }
  .picker { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .cal__grid { gap: 4px; }
  .cal__day { font-size: 17px; }
  .times__list { max-height: none; overflow: visible; }
  .book-form__submit { align-self: stretch; }
  .done__actions .btn { width: 100%; }
}
