/* Styles de l'application. Toutes les valeurs visuelles viennent des variables du thème. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--color-action); }
a:hover { color: var(--color-action-hover); }
h1, h2, h3 { font-family: var(--font-heading); font-weight: var(--heading-weight); margin: 0; }
p { margin: 0; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }
[hidden] { display: none !important; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 16px;
  background: var(--color-surface); border-radius: var(--radius-control); font-weight: 700;
}
.skip:focus { top: 12px; }

/* --- Mise en page -------------------------------------------------------- */

.container { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
/* Colonne pleine hauteur : sur une page courte, le pied de page reste en bas de l'écran. */
.shell { min-height: 100vh; padding-bottom: 48px; display: flex; flex-direction: column; }
.shell > .container { width: 100%; margin-bottom: 24px; }
.stack { display: flex; flex-direction: column; gap: 24px; }

.hero-inner { padding-top: 32px; padding-bottom: 24px; }
.hero-intro, .hero-bar, .hero-desc { display: none; }

.site-header {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  flex: none; width: 40px; height: 40px; border-radius: var(--radius-control);
  background: var(--color-logo-bg); color: var(--color-logo-text);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.brand-logo { height: 40px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand-name { font-weight: 700; font-size: 16px; }
.brand-url { font-size: 13px; color: var(--color-text-secondary); overflow-wrap: anywhere; }
.brand-url strong { color: var(--color-text); }
.step-label { font-size: 14px; color: var(--color-text-secondary); }

.site-footer { margin-top: auto; font-size: 12px; color: var(--color-text-secondary); }
.footer-inner {
  padding-top: 16px; padding-bottom: 16px; border-top: 1px solid var(--color-border);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.site-footer strong { color: var(--color-text); }

.card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-card); box-shadow: var(--card-shadow);
}

/* --- Boutons ----------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border-radius: var(--radius-control);
  font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background-color .15s, border-color .15s;
}
.btn-primary { background: var(--color-action); color: var(--color-action-text); }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--color-action-hover); color: var(--color-action-text); }
.btn-secondary { background: var(--color-surface); color: var(--color-text); border-color: var(--color-field); }
.btn-secondary:hover { border-color: var(--color-text-secondary); color: var(--color-text); }
.btn-danger { background: var(--color-danger); color: #FFFFFF; }
.btn-danger:hover { filter: brightness(.9); color: #FFFFFF; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .6; cursor: default; }
.btn-icon {
  width: var(--target); height: var(--target); padding: 0; border-radius: var(--radius-control);
  border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text);
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; flex: none;
}
.btn-icon:hover { border-color: var(--color-field); color: var(--color-text); }
.btn-icon[aria-disabled="true"] { color: var(--color-text-disabled); border-color: var(--color-border-soft); pointer-events: none; }
.link-back {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--target);
  font-size: 14px; font-weight: 600; text-decoration: none; align-self: flex-start;
}

/* --- Page de réservation : 3 colonnes ------------------------------------ */

.booking { display: flex; flex-wrap: wrap; overflow: hidden; margin-top: 0; }
.widget { display: contents; }
.info-col {
  flex: 1 1 260px; padding: 32px; display: flex; flex-direction: column; gap: 20px;
  border-right: 1px solid var(--color-border);
}
.avatar {
  width: 56px; height: 56px; border-radius: 50%; background: var(--color-action-pale); color: var(--color-action);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px;
}
.title-group { display: flex; flex-direction: column; gap: 6px; }
.host { font-size: 14px; color: var(--color-text-secondary); }
.page-title { font-size: 26px; line-height: 1.2; }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; color: var(--color-text-body); }
.facts li { display: flex; gap: 10px; align-items: center; }
.facts svg { flex: none; }
.facts-inline { display: none; font-size: 14px; color: var(--color-text-secondary); }
.description { line-height: 1.6; color: var(--color-text-body); white-space: pre-line; }

.cal-col { flex: 2 1 380px; padding: 32px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.col-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.col-head h2 { font-size: 18px; display: flex; align-items: center; gap: 10px; }
.step-num { display: none; }
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-label { font-size: 15px; font-weight: 600; min-width: 120px; text-align: center; }
.weekdays, .month-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px;
}
.weekdays {
  font-family: var(--font-label); font-size: 12px; font-weight: 600; color: var(--color-text-secondary); text-align: center;
  text-transform: uppercase; letter-spacing: .04em;
}
.month-grid { margin: 0; }
.day {
  height: 48px; border: none; border-radius: var(--radius-control); font-size: 15px;
  background: transparent; color: var(--color-text-disabled); padding: 0;
}
.day-on { background: var(--color-action-pale); color: var(--color-action); font-weight: 700; cursor: pointer; }
.day-on:hover { background: var(--color-action); color: var(--color-action-text); }
.day-sel { background: var(--color-action); color: var(--color-action-text); font-weight: 700; cursor: pointer; }
.realtime { font-size: 13px; color: var(--color-text-secondary); }

.week-strip { display: none; flex-direction: column; gap: 14px; }
.week-head { display: flex; justify-content: space-between; align-items: center; }
.week-head h3 { font-size: 16px; }
.week-nav { display: flex; gap: 6px; }
.week-days { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 6px; margin: 0; }
.week-day {
  height: 64px; border: none; border-radius: var(--radius-chip); padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: transparent; color: var(--color-text-disabled);
}
.week-day .dow { font-size: 12px; font-weight: 600; }
.week-day .num { font-size: 18px; font-weight: 700; }
.week-day.day-on { background: var(--color-action-pale); color: var(--color-action); }
.week-day.day-sel { background: var(--color-action); color: var(--color-action-text); }

.slots-col {
  flex: 1 1 240px; padding: 32px; display: flex; flex-direction: column; gap: 16px; min-width: 0;
  background: var(--color-surface-alt); border-left: 1px solid var(--color-border);
}
.slots-head { display: flex; flex-direction: column; gap: 4px; }
.slots-head h2 { font-size: 18px; display: flex; align-items: center; gap: 10px; }
.slots-head h2:focus { box-shadow: none; }
.slots-count { font-size: 14px; color: var(--color-text-secondary); }
.slot-list { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.slot {
  height: 48px; border: 1px solid var(--color-action); border-radius: var(--radius-control);
  background: var(--color-surface); color: var(--color-action); font-size: 15px; font-weight: 700;
  cursor: pointer; padding: 0 8px; font-family: var(--font-slot);
}
.slot:hover { background: var(--color-action-pale); }
.slot-row { display: flex; gap: 8px; }
.slot-row > * { flex: 1 1 0; }
.slot[aria-pressed="true"] { background: var(--color-slot-selected); border-color: var(--color-slot-selected); color: #FFFFFF; }
.empty { font-size: 14px; color: var(--color-text-secondary); }

.notice {
  border-radius: var(--radius-chip); padding: 14px 16px; font-size: 14px; line-height: 1.5;
  display: flex; flex-direction: column; gap: 8px;
}
.notice-warning { background: var(--color-warning-pale); color: var(--color-warning); }
.notice-info { background: var(--color-action-pale); color: var(--color-text); }
.notice-danger { background: var(--color-danger-pale); color: var(--color-danger); }
.notice strong { color: inherit; }

.mobile-bar { display: none; }
.preview-banner {
  background: var(--color-warning-pale); color: var(--color-warning); text-align: center;
  padding: 10px 16px; font-size: 14px; font-weight: 600;
}

/* --- Formulaire de coordonnées ------------------------------------------- */

.summary-col {
  flex: 1 1 280px; padding: 32px; display: flex; flex-direction: column; gap: 20px;
  background: var(--color-surface-alt); border-right: 1px solid var(--color-border);
}
.slot-card {
  background: var(--color-action-pale); border-radius: var(--radius-chip); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 6px;
}
.slot-card .eyebrow-label {
  font-size: 13px; font-weight: 600; color: var(--color-action); text-transform: uppercase; letter-spacing: .04em;
}
.slot-card .slot-date { font-size: 17px; font-weight: 700; }
.slot-card .slot-time { color: var(--color-text-body); }
.inline-fact { display: flex; gap: 10px; align-items: center; color: var(--color-text-body); }

.form-col { flex: 2 1 420px; padding: 32px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.form-col h2 { font-size: 20px; }
.row { display: flex; flex-wrap: wrap; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
/* Base de 220 px seulement côte à côte : dans une colonne, elle s'appliquerait à la hauteur. */
.row > .field { flex: 1 1 220px; }
.field label, .label { font-size: 14px; font-weight: 600; }
.field .opt { font-weight: 500; color: var(--color-text-secondary); }
.input, .field input[type="text"], .field input[type="email"], .field input[type="tel"], .field input[type="password"],
.field input[type="number"], .field input[type="url"], .field input[type="time"], .field select, .field textarea {
  min-height: 46px; width: 100%; border: 1px solid var(--color-field); border-radius: var(--radius-control);
  padding: 0 14px; font-size: 15px; background: var(--color-surface); color: var(--color-text);
}
.field textarea { padding: 12px 14px; resize: vertical; min-height: 110px; }
.field [aria-invalid="true"] { border-color: var(--color-danger); }
.field-error { font-size: 13px; color: var(--color-danger); font-weight: 600; }
.field-hint { font-size: 13px; color: var(--color-text-secondary); }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--color-action); flex: none; }
.check label { font-size: 14px; line-height: 1.5; color: var(--color-text-body); }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding-top: 4px; }
.form-actions .hint { font-size: 13px; color: var(--color-text-secondary); }
.errors-summary { outline: none; }
.errors-summary ul { margin: 0; padding-left: 18px; }
/* Champ piège : hors écran, jamais vu ni atteint au clavier par un humain. */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* --- Pages centrées (confirmation, messages) ----------------------------- */

.centered-header { padding-top: 32px; padding-bottom: 48px; }
.panel {
  max-width: 600px; width: 100%; margin: 0 auto; padding: 40px 32px;
  display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center;
}
.panel h1 { font-size: 28px; line-height: 1.2; }
.panel .lead { line-height: 1.6; color: var(--color-text-body); }
.panel .small { font-size: 13px; color: var(--color-text-secondary); }
.badge-icon {
  width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--color-action-pale); color: var(--color-action);
}
.badge-success { background: var(--color-success-pale); color: var(--color-success); }
.badge-warning { background: var(--color-warning-pale); color: var(--color-warning); }
.badge-danger { background: var(--color-danger-pale); color: var(--color-danger); }
.recap { width: 100%; border: 1px solid var(--color-border); border-radius: var(--radius-chip); overflow: hidden; text-align: left; margin: 0; }
.recap > div { display: flex; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--color-border); }
.recap > div:last-child { border-bottom: none; }
.recap .pre { white-space: pre-line; text-align: right; }
.recap dt { color: var(--color-text-secondary); }
.recap dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.recap .old dd { text-decoration: line-through; color: var(--color-text-secondary); font-weight: 600; }
.home-steps {
  margin: 0; padding: 0; list-style: none; counter-reset: step; width: 100%; max-width: 440px;
  display: flex; flex-direction: column; gap: 12px; text-align: left;
}
.home-steps li { counter-increment: step; display: flex; gap: 12px; align-items: flex-start; color: var(--color-text-body); }
.home-steps li::before {
  content: counter(step); flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-action-pale); color: var(--color-action); font-weight: 700; font-size: 14px;
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; width: 100%; }
.actions form { margin: 0; }

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

@media (max-width: 899px) {
  .info-col, .summary-col { border-right: none; border-bottom: 1px solid var(--color-border); }
  .slots-col { border-left: none; border-top: 1px solid var(--color-border); }
  .info-col, .cal-col, .slots-col, .summary-col, .form-col { flex-basis: 100%; }
}

@media (max-width: 639px) {
  body { background: var(--color-surface); }
  .shell { padding-bottom: 120px; }
  .hero-inner { padding-top: 20px; padding-bottom: 16px; }
  .booking { border: none; border-radius: 0; box-shadow: none; }
  .container-booking { padding: 0; }
  .site-header .step-label, .brand-url { display: none; }
  .brand-mark { width: 32px; height: 32px; font-size: 10px; border-radius: 8px; }
  .brand-logo { height: 32px; }
  .brand-name { font-size: 14px; }
  .info-col { padding: 0 16px 16px; gap: 4px; }
  .info-col .avatar, .info-col .facts, .info-col .description { display: none; }
  .page-title { font-size: 22px; }
  .facts-inline { display: block; }
  .cal-col { padding: 20px 16px 8px; gap: 14px; }
  .cal-col > .col-head, .cal-col > .weekdays, .cal-col > .month-grid, .cal-col > .realtime { display: none; }
  .week-strip { display: flex; }
  .slots-col { padding: 12px 16px; background: var(--color-surface); border-top: none; gap: 12px; }
  .slots-head h2 { font-size: 16px; }
  .slot-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .slot-row { display: contents; }
  .slot-row .next-btn { display: none; }
  .slot[aria-pressed="true"] { background: var(--color-action); border-color: var(--color-action); }
  .mobile-bar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    padding: 14px 16px 24px; background: var(--color-surface); border-top: 1px solid var(--color-border);
    align-items: center; justify-content: space-between; gap: 12px;
  }
  .mobile-bar .label-small { font-size: 13px; color: var(--color-text-secondary); display: block; }
  .mobile-bar .value { font-size: 15px; font-weight: 700; }
  .summary-col, .form-col { padding: 24px 16px; }
  .panel { padding: 32px 16px; }
  .panel h1 { font-size: 24px; }
  .recap > div { flex-direction: column; gap: 2px; }
  .recap dd { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
