/* SILL SA — Rendez-vous. Tokens repris de sillsa.ch (Swiss Design SILL SA) et du portail ca.sillsa.ch.
   Grille 12 colonnes : texte de cadrage à gauche (5), réservation à droite (6). Échelle nombre d'or. */
:root {
  --bg: #EFEDE9;
  --paper: #FFFFFF;
  --ink: #000000;
  --body: #333333;
  --muted: #6E6E68;
  --line: #CFCBC4;
  --accent: #E20613;
  --font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --fs-base: 16px; --fs-chapeau: 20px; --fs-h3: 26px; --fs-h1: clamp(30px, 4.2vw, 42px);
  --s1: 8px; --s2: 16px; --s3: 32px; --s4: 64px;
  --gutter: max(20px, env(safe-area-inset-left, 0px));
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
body {
  font-family: var(--font); font-size: var(--fs-base); line-height: 1.6;
  color: var(--body); background: var(--bg);
  border-top: 6px solid var(--accent);
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
a { color: var(--accent); }
.tnum { font-variant-numeric: tabular-nums; }
.wrap {
  width: 100%; max-width: 1240px; margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* En-tête */
.masthead { padding-block: var(--s3) var(--s2); }
.masthead-in { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; }
.logo { height: 56px; width: auto; display: block; }
.kicker, .eyebrow, .label, legend, .meta, dt, th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .2em; font-weight: 700; color: var(--muted);
}
.kicker { padding-bottom: 6px; }

/* Grille principale */
.grid { display: grid; gap: var(--s3); padding-block: var(--s3) var(--s4); }
@media (min-width: 960px) {
  .grid { grid-template-columns: repeat(12, 1fr); gap: 20px; }
  .intro { grid-column: 1 / span 5; }
  .booking { grid-column: 7 / span 6; }
}

/* Cadrage */
.intro { display: flex; flex-direction: column; gap: var(--s2); max-width: 34em; min-width: 0; }
h1 { font-size: var(--fs-h1); line-height: 1.08; color: var(--ink); font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }
.intro h1 { margin-bottom: var(--s1); }
.chapeau { font-size: var(--fs-chapeau); line-height: 1.5; color: var(--ink); }
.intro .label { margin-top: var(--s2); padding-top: var(--s2); border-top: 1px solid var(--ink); }
.points { list-style: none; display: flex; flex-direction: column; gap: var(--s1); }
.points li { padding-left: 22px; position: relative; }
.points li::before { content: ""; position: absolute; left: 0; top: .72em; width: 10px; height: 2px; background: var(--accent); }
.cadre { margin-top: var(--s2); padding: var(--s2) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--ink); }

/* Réservation */
.booking { min-width: 0; background: var(--paper); padding: var(--s3) clamp(20px, 3vw, 40px); }
.booking > .label { color: var(--ink); margin-bottom: var(--s2); }
form { display: flex; flex-direction: column; gap: var(--s3); }
fieldset.step { border: 0; display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
legend { color: var(--ink); display: flex; align-items: center; gap: 10px; margin-bottom: var(--s2); float: left; width: 100%; }
legend + * { clear: both; }
.n { display: inline-grid; place-items: center; width: 22px; height: 22px; background: var(--accent); color: var(--paper); letter-spacing: 0; font-size: 12px; }
.meta { letter-spacing: .12em; margin-top: calc(-1 * var(--s1)); }

.days { display: none; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.js .days { display: grid; }
.day {
  font: inherit; border: 0; background: var(--paper); color: var(--ink); cursor: pointer;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 10px 9px; text-align: left; min-width: 0;
}
.day .dj { font-size: 11px; text-transform: uppercase; letter-spacing: .16em; font-weight: 700; }
.day .dd { font-size: 20px; font-weight: 700; line-height: 1.1; }
.day .dl { font-size: 11px; color: var(--muted); }
.day:hover { background: var(--bg); }
.day[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.day[aria-selected="true"] .dl { color: var(--paper); }
@media (max-width: 479px) {
  .day { padding: 8px 6px 7px; }
  .day .dj { letter-spacing: .08em; font-size: 10px; }
  .day .dd { font-size: 15px; }
  .day .dl { font-size: 10px; }
}
.day.full { color: var(--muted); }
.day.full .dd { text-decoration: line-through; text-decoration-thickness: 1px; }

.slots { display: flex; flex-direction: column; gap: var(--s1); }
.slots-day { font-weight: 700; color: var(--ink); }
.slot-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s1); }
@media (min-width: 560px) { .slot-grid { grid-template-columns: repeat(4, 1fr); } }
.slot { position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 52px;
  border: 1px solid var(--ink); padding: 8px 10px; cursor: pointer; color: var(--ink); font-weight: 700; font-size: 15px; }
.slot input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.slot .t { font-size: 18px; line-height: 1.2; }
.slot small { font-weight: 400; font-size: 12px; color: var(--muted); }
.slot:has(input:checked) small { color: var(--paper); }
.slot:hover { background: var(--bg); }
.slot:has(input:checked) { background: var(--ink); color: var(--paper); }
.slot:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.slot.taken { border-color: var(--line); color: var(--muted); cursor: not-allowed; background: transparent; font-weight: 400; }
.slot.taken .t { text-decoration: line-through; text-decoration-thickness: 1px; }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.f-wide { grid-column: 1 / -1; }
@media (max-width: 479px) { .fields { grid-template-columns: 1fr; } }
label { font-size: 13px; color: var(--ink); font-weight: 700; }
input[type=text], input:not([type]), input[type=tel], input[type=email], input[type=password] {
  width: 100%; font: inherit; font-size: 16px; padding: 12px; border: 1px solid var(--ink); border-radius: 0;
  background: var(--paper); color: var(--ink);
}
input:focus-visible, .btn:focus-visible, .day:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.submit { display: flex; flex-direction: column; gap: var(--s2); border-top: 1px solid var(--ink); padding-top: var(--s2); }
.choice { color: var(--muted); }
.choice.on { color: var(--ink); font-weight: 700; }
.choice.on::before { content: ""; display: inline-block; width: 10px; height: 10px; background: var(--accent); margin-right: 10px; }
.btn {
  display: inline-block; text-align: center; font: inherit; font-size: 12px; text-transform: uppercase; letter-spacing: .2em;
  font-weight: 700; padding: 16px 24px; background: var(--ink); color: var(--paper); border: 1px solid var(--ink);
  border-radius: 0; cursor: pointer; text-decoration: none; transition: background .2s ease, border-color .2s ease;
}
.btn:hover { background: var(--accent); border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { color: var(--paper); }
.btn-red { background: var(--accent); border-color: var(--accent); padding: 10px 14px; }
.note { font-size: 13px; color: var(--muted); line-height: 1.6; }
.errors { border-left: 4px solid var(--accent); background: var(--bg); padding: 12px 16px; color: var(--ink); display: flex; flex-direction: column; gap: 4px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Confirmation */
.confirm { max-width: 640px; padding-block: var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
.recap { display: flex; flex-direction: column; border-top: 1px solid var(--ink); }
.recap > div { display: grid; grid-template-columns: 7em 1fr; gap: var(--s2); padding: 14px 0; border-bottom: 1px solid var(--line); }
.recap dt { padding-top: 4px; }
.recap dd { color: var(--ink); font-size: 18px; }

/* Administration */
.login { max-width: 400px; padding-block: var(--s4); }
.login form { gap: var(--s2); margin-top: var(--s3); }
.admin { padding-block: var(--s3) var(--s4); }
.admin-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s2); flex-wrap: wrap; padding-bottom: var(--s2); border-bottom: 1px solid var(--ink); }
.admin-head h1 { font-size: var(--fs-h3); margin-top: 4px; }
.admin-head .meta { margin-top: 8px; }
.actions { display: flex; gap: var(--s1); flex-wrap: wrap; }
.flash { margin-top: var(--s2); padding: 10px 14px; background: var(--paper); color: var(--ink); }
.admin > .errors { margin-top: var(--s2); background: var(--paper); }
.admin-day { font-size: 18px; color: var(--ink); margin: var(--s3) 0 var(--s1); }
.table-wrap { overflow-x: auto; background: var(--paper); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 10px; }
tr.booked td { color: var(--ink); }
td.muted { color: var(--muted); }
.cancel summary { cursor: pointer; color: var(--accent); font-size: 13px; list-style: none; }
.cancel summary::-webkit-details-marker { display: none; }
.cancel form { margin-top: 8px; }

.empty { display: flex; flex-direction: column; gap: var(--s1); padding: var(--s2) 0; }
.admin-grid { display: grid; gap: 20px; margin-top: var(--s3); }
@media (min-width: 900px) { .admin-grid { grid-template-columns: 5fr 7fr; } }
.panel { background: var(--paper); padding: var(--s3) clamp(20px, 3vw, 32px); display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.panel > .label { color: var(--ink); }
.open-form { gap: var(--s2); }
.presets { display: flex; flex-wrap: wrap; gap: var(--s1); }
.chip { font: inherit; font-size: 13px; padding: 8px 12px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 0; cursor: pointer; }
.chip:hover, .chip[aria-pressed="true"] { border-color: var(--ink); background: var(--paper); }
input[type=date], input[type=time] { width: 100%; font: inherit; font-size: 16px; padding: 11px 12px; border: 1px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink); }
.preview { color: var(--ink); min-height: 1.6em; }
.preview.ko { color: var(--accent); }
.plages { list-style: none; display: flex; flex-direction: column; border-top: 1px solid var(--ink); }
.plages li { display: grid; grid-template-columns: 1fr auto auto auto; gap: var(--s2); align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
.plages .pj { color: var(--ink); font-weight: 700; min-width: 0; }
.plages .ph { color: var(--ink); }
.plages .pn { font-size: 13px; color: var(--muted); }
@media (max-width: 599px) { .plages li { grid-template-columns: 1fr auto; } }
.day-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); margin: var(--s3) 0 var(--s1); }
.day-head .admin-day { margin: 0; }
.btn-sm { padding: 8px 12px; font-size: 11px; }
small.ok { color: #2E7D4F; }
small.ko { color: var(--accent); }

/* Feuille de route */
.roadmap { padding-block: var(--s3) var(--s4); }
.road-grid { display: grid; gap: 20px; margin-top: var(--s3); align-items: start; }
@media (min-width: 900px) { .road-grid { grid-template-columns: 7fr 5fr; } }
.docs { background: var(--paper); padding: var(--s3) 24px; display: flex; flex-direction: column; gap: var(--s2); }
.docs > .label { color: var(--ink); }
.checklist { list-style: none; display: flex; flex-direction: column; border-top: 1px solid var(--ink); }
.checklist li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 14px; }
.box { display: inline-block; width: 14px; height: 14px; border: 1px solid var(--ink); vertical-align: middle; }
.qty { font-weight: 700; white-space: nowrap; }
@media print {
  body { background: #fff; border-top: 0; }
  .noprint, .foot { display: none !important; }
  .docs, .table-wrap { background: #fff; padding: 0; }
  .road-grid { grid-template-columns: 1fr; }
  .masthead { padding-block: 0 8px; }
}

/* Pied */
.foot { border-top: 1px solid var(--line); padding-block: var(--s2) max(var(--s2), env(safe-area-inset-bottom, 0px)); }
.foot-in { display: flex; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; font-size: 12px; color: var(--muted); }

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