/* Pages publiques de prise de rendez-vous. Toutes les valeurs viennent de tokens.css (charte vaconseil.com). */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper-deep); color: var(--ink); font: 400 var(--size-body)/1.6 var(--font-text); }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-title); font-weight: 500; line-height: 1.15; margin: 0 0 var(--space-2); color: var(--ink); }
h2 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2rem); }
h3 { font-size: 1.35rem; }
a { color: var(--accent-text); }
.wrap { max-width: var(--width-max); margin: 0 auto; padding: 0 16px; }

.top { background: var(--paper); border-bottom: 1px solid var(--line-gold); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: var(--space-2); }
.brand { font-family: var(--font-title); font-size: 1.4rem; font-weight: 600; letter-spacing: 0.04em; color: var(--gold-text); text-decoration: none; }
.top-phone { color: var(--ink-soft); text-decoration: none; font-size: var(--size-small); white-space: nowrap; }

main.wrap { padding-top: var(--space-4); padding-bottom: var(--space-5); }

/* Carte principale à deux colonnes */
.booking { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; background: var(--card); border-radius: var(--radius-card); box-shadow: var(--shadow); overflow: hidden; min-height: 560px; }
.summary { padding: var(--space-4) var(--space-3); border-right: var(--rule); background: var(--paper); }
.summary h1 { font-size: clamp(1.8rem, 1.4rem + 1.2vw, 2.3rem); margin-top: var(--space-1); }
.eyebrow { font-size: var(--size-label); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-text); font-weight: 600; margin: 0 0 var(--space-2); }
.advisor { color: var(--ink-soft); margin: 0; font-size: var(--size-small); }
.portrait { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; margin-bottom: var(--space-1); }
.intro { color: var(--ink-soft); font-size: var(--size-small); }
.facts { list-style: none; padding: 0; margin: var(--space-2) 0; display: grid; gap: 8px; }
.facts li { padding-left: 26px; position: relative; font-size: var(--size-small); }
.facts li::before { content: ""; position: absolute; left: 0; top: 0.35em; width: 14px; height: 14px; border: 1.5px solid var(--accent); border-radius: 50%; }
.facts .f-place::before { border-radius: 3px; }
.facts .f-price::before { border-radius: 2px; transform: rotate(45deg) scale(0.8); }
.tag { display: inline-block; background: var(--paper-deep); color: var(--gold-text); border-radius: 999px; padding: 4px 12px; font-size: var(--size-small); margin: 0 0 var(--space-1); }
.chosen { font-weight: 600; color: var(--accent-text); border-left: 3px solid var(--accent); padding-left: 10px; }

.step { padding: var(--space-4); outline: none; min-width: 0; }
.lead { font-size: 1.08rem; }
.muted { color: var(--ink-soft); }
.small { font-size: var(--size-small); }
.center { text-align: center; }
.pre { white-space: pre-line; }
.loading { padding: var(--space-3) 0; }

.btn { display: inline-block; background: var(--btn); color: var(--btn-ink); font: 600 0.8rem/1.2 var(--font-text); letter-spacing: 0.09em; text-transform: uppercase; text-decoration: none; border: 1px solid var(--btn); border-radius: var(--radius); padding: 15px 28px; cursor: pointer; transition: background .2s, transform .2s; }
.btn:hover { background: var(--btn-hover); transform: translateY(-1px); }
.btn:disabled { opacity: .6; cursor: wait; transform: none; }
.btn-wide { width: 100%; margin-top: var(--space-2); }
.btn-ghost { background: transparent; color: var(--btn); }
.btn-ghost:hover { background: var(--paper-deep); }
.link { background: none; border: 0; padding: 0; color: var(--ink-soft); text-decoration: underline; font: inherit; font-size: var(--size-small); cursor: pointer; }
.link:hover { color: var(--ink); }
.back { display: inline-block; margin-bottom: var(--space-2); text-decoration: none; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-3); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Routage */
.question { border: 0; padding: 0; margin: 0 0 var(--space-3); min-width: 0; }
.question legend { font-weight: 600; margin-bottom: var(--space-1); padding: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.cards-inline { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.card-choice { position: relative; display: block; cursor: pointer; }
.card-choice input { position: absolute; opacity: 0; inset: 0; }
.card-choice span { display: block; height: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: var(--paper); transition: border-color .15s, background .15s; }
.card-choice:hover span { border-color: var(--gold-text); }
.card-choice input:checked + span { border-color: var(--accent); background: rgba(23, 120, 78, 0.06); box-shadow: inset 0 0 0 1px var(--accent); }
.card-choice input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Types de rendez-vous */
.type-list { display: grid; gap: 12px; }
.type-card { display: grid; gap: 4px; text-align: left; width: 100%; background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--type-color, var(--accent)); border-radius: 10px; padding: 18px 20px; cursor: pointer; font: inherit; color: inherit; transition: box-shadow .15s, transform .15s; }
.type-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.type-card.primary { border-color: var(--accent); border-left-width: 4px; }
.type-name { font-family: var(--font-title); font-size: 1.45rem; font-weight: 600; }
.type-meta { font-size: var(--size-small); color: var(--gold-text); }
.type-desc { color: var(--ink-soft); font-size: var(--size-small); }
.type-go { margin-top: 6px; color: var(--accent-text); font-weight: 600; font-size: var(--size-small); }

/* Calendrier */
.picker { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: var(--space-4); align-items: start; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-2); }
.cal-head strong { font-family: var(--font-title); font-size: 1.35rem; font-weight: 600; text-transform: capitalize; }
.cal-nav { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--ink); }
.cal-nav:disabled { opacity: .35; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.dow { text-align: center; font-size: var(--size-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); padding-bottom: 4px; }
.day { aspect-ratio: 1; max-height: 52px; border-radius: 50%; border: 0; background: transparent; color: rgba(15, 28, 46, 0.32); font: inherit; cursor: default; }
.day.avail { background: rgba(23, 120, 78, 0.09); color: var(--accent-text); font-weight: 600; cursor: pointer; }
.day.avail:hover { background: rgba(23, 120, 78, 0.18); }
.day.sel { background: var(--accent); color: var(--accent-ink); }
.day.today { box-shadow: inset 0 0 0 1px var(--line); }
.next-avail { margin-top: var(--space-2); }
.slots-day { font-weight: 600; margin: 0 0 var(--space-2); }
.slot-list { display: grid; gap: 8px; max-height: 380px; overflow-y: auto; padding-right: 4px; }
.slot-row { display: grid; grid-template-columns: 1fr; gap: 6px; }
.slot-row.open { grid-template-columns: 1fr 1fr; }
.slot, .slot-ok { height: 48px; border-radius: var(--radius); font: 600 0.95rem var(--font-text); cursor: pointer; }
.slot { border: 1px solid var(--accent); background: var(--paper); color: var(--accent-text); }
.slot:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.slot-row.open .slot { background: var(--ink-soft); border-color: var(--ink-soft); color: #fff; }
.slot-ok { display: none; border: 0; background: var(--accent); color: var(--accent-ink); }
.slot-row.open .slot-ok { display: block; }
.tz-line { margin-top: var(--space-3); font-size: var(--size-small); color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tz-line select { width: auto; padding: 6px 10px; font-size: var(--size-small); }

/* Formulaires */
.field { margin-bottom: var(--space-2); border: 0; padding: 0; min-width: 0; }
.field > label, .field legend { display: block; font-weight: 500; font-size: var(--size-small); margin-bottom: 6px; padding: 0; }
input:not([type]), input[type=text], input[type=email], input[type=tel], input[type=number], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--field); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--gold-text); outline: none; box-shadow: 0 0 0 3px rgba(29, 79, 140, 0.12); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-2); }
.choices { display: grid; gap: 8px; }
.choices-inline { display: flex; flex-wrap: wrap; }
.choice { display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; cursor: pointer; background: var(--paper); font-size: var(--size-small); }
.choice:has(input:checked) { border-color: var(--accent); background: rgba(23, 120, 78, 0.06); }
.choice input, .check input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; flex: none; }
.check, .field > label.check { display: flex; gap: 10px; align-items: flex-start; font-size: var(--size-small); margin: 0 0 var(--space-2); cursor: pointer; }
.hint { font-size: var(--size-small); color: var(--ink-soft); margin: 6px 0 0; }
.error { color: #b42318; font-size: var(--size-small); margin: 6px 0 0; }
.has-error input, .has-error select, .has-error textarea { border-color: #b42318; }
.req { color: #b42318; }
.alert { background: #fdecea; color: #7a1c13; border-radius: var(--radius); padding: 12px 16px; margin: var(--space-2) 0; }
.notice { background: rgba(23, 120, 78, 0.08); border-left: 3px solid var(--accent); padding: 12px 16px; border-radius: var(--radius); margin: 0 0 var(--space-3); }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.pay { background: var(--paper-deep); border-radius: 10px; padding: var(--space-2); }

/* Confirmation */
.done-mark { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 1.6rem; margin-bottom: var(--space-2); }
.next-steps { margin: var(--space-3) 0; display: grid; gap: 10px; }
.next-steps h3 { margin-bottom: 4px; }
.next { display: grid; gap: 4px; text-decoration: none; color: inherit; border: 1px solid var(--accent); border-radius: 10px; padding: 16px 18px; background: rgba(23, 120, 78, 0.04); }
.next:hover { background: rgba(23, 120, 78, 0.09); }
.next strong { color: var(--accent-text); }
.next span { font-size: var(--size-small); color: var(--ink-soft); }

/* Pages simples (gérer, DER, questionnaire) */
.panel { background: var(--card); border-radius: var(--radius-card); box-shadow: var(--shadow); padding: var(--space-4); max-width: 820px; margin: 0 auto; }
.panel-narrow { max-width: 640px; }
.recap { background: var(--paper-deep); border-radius: 10px; padding: var(--space-2) var(--space-3); margin: var(--space-2) 0; }
.recap p { margin: 4px 0; }
.der-doc { border: var(--rule); border-radius: 10px; padding: var(--space-3); max-height: 520px; overflow-y: auto; background: var(--paper); font-size: 0.9rem; line-height: 1.55; }
.der-doc h3 { font-family: var(--font-text); font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold-text); margin: var(--space-3) 0 var(--space-1); font-weight: 600; }
.der-doc ul { padding-left: 1.2em; }
.sig-pad { border: 1px dashed var(--gold-text); border-radius: 10px; background: var(--field); width: 100%; height: 170px; touch-action: none; display: block; cursor: crosshair; }
.sig-tools { display: flex; justify-content: space-between; margin-top: 6px; }
.section-title { font-size: var(--size-label); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-text); font-weight: 600; margin: var(--space-4) 0 var(--space-2); padding-top: var(--space-2); border-top: var(--rule); }
.section-title:first-of-type { border-top: 0; margin-top: var(--space-2); }

.legal { padding: var(--space-3) 0 var(--space-4); font-size: 0.74rem; color: var(--ink-soft); line-height: 1.5; }
.legal p { max-width: 900px; margin: 0 auto 8px; text-align: center; }

@media (max-width: 860px) {
  main.wrap { padding-top: var(--space-2); }
  .booking { grid-template-columns: 1fr; min-height: 0; }
  .summary { border-right: 0; border-bottom: var(--rule); padding: var(--space-3) var(--space-2); }
  .summary .intro { display: none; }
  .step { padding: var(--space-3) var(--space-2); }
  .picker { grid-template-columns: 1fr; gap: var(--space-3); }
  .slot-list { max-height: none; }
  .panel { padding: var(--space-3) var(--space-2); }
}
@media (max-width: 520px) {
  .two { grid-template-columns: 1fr; }
  .top-phone { display: none; }
  .cal-grid { gap: 3px; }
  .actions { gap: var(--space-2); }
}
@media print {
  .top, .legal, .no-print { display: none !important; }
  body { background: #fff; }
  .panel { box-shadow: none; padding: 0; }
  .der-doc { max-height: none; overflow: visible; border: 0; padding: 0; }
}
