/* Cavely booking page - design/DIRECTION.md v2. Light-first; the salon colour arrives as --brand and is turned into
   accessible action tokens by booking.js. Nothing here may use an inline style (CSP). */

@font-face {
  font-family: "Hanken Grotesk";
  src: url("fonts/HankenGrotesk-var-latin.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("fonts/HankenGrotesk-var-latin-ext.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* The cavely.nl system (round 3): one palette and one typeface on every Cavely page. */
  --paper: #f7f8f6;
  --paper-deep: #eef1ee;
  --ink: #182624;
  --ink-2: #4e5e5a;      /* secondary text: 6.6:1 on paper */
  --ink-3: #5f6e6a;      /* quiet labels: 5.1:1 on paper */
  --rule: rgba(24, 38, 36, 0.12);
  --rule-strong: rgba(24, 38, 36, 0.26);
  --control-border: #7c8985;   /* inputs, checkboxes, day/time tiles: 3.5:1 on paper (WCAG 1.4.11) */
  --brand: #1c4439;
  --action: #1c4439;
  --on-action: #ffffff;
  --selected-bg: #e6efea;
  --focus: #1c4439;
  --danger: #9b2c22;     /* 6.5:1 on paper */

  --serif: "Hanken Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;   /* headings: same family, set heavier below */
  --sans: "Hanken Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --gutter: 20px;
  --measure: 540px;
  --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/24px var(--sans);
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 4px; z-index: 10; }
.skip:focus { left: 8px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* ---------- masthead: the salon is the brand */
.masthead {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 28px var(--gutter) 20px;
  border-bottom: 1px solid var(--rule);
}
.masthead__name {
  margin: 0;
  font: 700 29px/32px var(--serif); letter-spacing: -0.015em;
  letter-spacing: -0.01em;
}
.masthead__line { margin: 6px 0 0; color: var(--ink-2); font-size: 15px; line-height: 22px; }
.masthead__line:empty { display: none; }

/* ---------- layout */
.layout {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter) 120px;
}
.flow { min-width: 0; }

.title {
  margin: 32px 0 8px;
  font: 700 27px/33px var(--serif); letter-spacing: -0.015em;
  letter-spacing: -0.01em;
}
.title--sub { margin: 36px 0 18px; }
.step {
  margin: 40px 0 14px;
  font: 600 20px/27px var(--sans);
  letter-spacing: -0.005em;
}
.status { margin: 0; color: var(--ink-2); min-height: 0; }
.status:empty { display: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- services: a price list you can tap */
.group {
  margin: 28px 0 4px;
  font: 600 13px/18px var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.services { list-style: none; margin: 0; padding: 0; }
.svc {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  column-gap: 14px;
  align-items: start;
  width: 100%;
  min-height: 76px;
  padding: 17px 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: none;
  text-align: left;
  cursor: pointer;
}
.services li:first-child .svc { border-top: 1px solid var(--rule); }
.svc__box {
  width: 20px; height: 20px; margin-top: 2px;
  border: 1.5px solid var(--control-border);
  border-radius: 5px;
  display: grid; place-items: center;
  transition: background-color 120ms ease-out, border-color 120ms ease-out;
}
.svc__box svg { width: 12px; height: 12px; opacity: 0; transition: opacity 120ms ease-out; }
.svc[aria-pressed="true"] .svc__box { background: var(--action); border-color: var(--action); }
.svc[aria-pressed="true"] .svc__box svg { opacity: 1; color: var(--on-action); }
.svc__name { font: 500 17px/24px var(--sans); }
.svc__meta { display: block; margin-top: 2px; color: var(--ink-2); font-size: 14px; line-height: 20px; }
.svc__deposit { white-space: nowrap; }
.svc__price {
  font: 600 16px/24px var(--sans);
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
  text-align: right;
}
.svc:hover .svc__name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ---------- days */
.days { display: flex; align-items: center; gap: 6px; }
.days__nav {
  flex: none;
  width: 44px; height: 44px;
  border: 0; background: none;
  font: 700 22px/1 var(--serif); letter-spacing: -0.015em;
  color: var(--ink-2);
  cursor: pointer;
  border-radius: var(--radius);
}
.days__nav:disabled { opacity: 0.3; cursor: default; }
.days__track {
  display: flex; gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  flex: 1;
  padding: 2px;
}
.days__track::-webkit-scrollbar { display: none; }
.day {
  flex: none;
  scroll-snap-align: start;
  width: 66px; height: 74px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: transparent;
  display: grid; place-content: center; text-align: center;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.day__wd { font: 500 13px/18px var(--sans); color: var(--ink-2); text-transform: lowercase; }
.day__d { font: 600 20px/24px var(--sans); }
.day__m { font: 400 12px/16px var(--sans); color: var(--ink-3); }
.day[aria-pressed="true"] { background: var(--action); border-color: var(--action); }
.day[aria-pressed="true"] .day__wd, .day[aria-pressed="true"] .day__d, .day[aria-pressed="true"] .day__m { color: var(--on-action); }
.day--full, .day--closed { background: var(--paper-deep); border-color: transparent; cursor: default; }
.day--full .day__d, .day--closed .day__d, .day--full .day__wd, .day--closed .day__wd { color: var(--ink-3); }
.day--full .day__m, .day--closed .day__m { color: var(--ink-3); font-weight: 500; }
.days__more { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 12px; flex-wrap: wrap; }

.link {
  border: 0; background: none; padding: 6px 0;
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px;
  cursor: pointer;
}

/* ---------- times */
.slot-group { margin: 0 0 20px; }
.slot-group:first-child { margin-top: 2px; }
.slot-group__label { margin: 0 0 8px; color: var(--ink-3); font: 500 14px/20px var(--sans); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.slot {
  min-height: 52px;
  padding: 4px 6px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: transparent;
  font: 600 16px/22px var(--sans);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color 120ms ease-out;
}
.slot:hover { background: var(--selected-bg); }
.slot[aria-pressed="true"] { background: var(--action); border-color: var(--action); color: var(--on-action); }

/* ---------- confirm */
.recap {
  margin-top: 32px;
  padding: 20px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--rule);
}
.recap__day { margin: 0; font: 700 22px/26px var(--serif); letter-spacing: -0.015em; }
.recap__time { margin: 2px 0 10px; font: 500 18px/24px var(--sans); font-variant-numeric: tabular-nums; }
.recap__what { margin: 0; color: var(--ink-2); }
.recap__change { margin-top: 8px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { margin: 0 0 18px; min-width: 0; }
label { display: block; margin-bottom: 6px; font: 500 15px/20px var(--sans); }
.optional { color: var(--ink-3); font-weight: 400; }
input, textarea {
  width: 100%;
  min-height: 52px;
  padding: 13px 14px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  background: #fffdfa;
  font-size: 16px; line-height: 24px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
input[aria-invalid="true"] { border-color: var(--danger); }
.field__hint { margin: 6px 0 0; color: var(--ink-3); font-size: 14px; line-height: 20px; }
.field__error, .form-error { margin: 6px 0 0; color: var(--danger); font-size: 14px; line-height: 20px; }
.field__error:empty, .form-error:empty { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.note { color: var(--ink-2); font-size: 14px; line-height: 20px; margin: 4px 0 18px; }

.primary {
  display: block; width: 100%;
  min-height: 54px;
  padding: 0 20px;
  border: 0; border-radius: var(--radius);
  background: var(--action); color: var(--on-action);
  font: 600 16px/20px var(--sans);
  cursor: pointer;
}
.primary:disabled { background: var(--paper-deep); color: var(--ink-3); cursor: default; }
.primary[aria-busy="true"] { opacity: 0.75; cursor: progress; }
.secondary {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 18px;
  border: 1px solid var(--ink); border-radius: var(--radius);
  background: transparent; color: var(--ink);
  font: 600 15px/20px var(--sans); text-decoration: none;
  cursor: pointer;
}

/* ---------- category links and the combination hint */
/* Categories as pills (the back office's staff filter uses the same shape). They wrap: a row that scrolls sideways
   hid the last category on a 320-375 px phone with nothing showing there was more. */
.cats { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.cats a { flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border: 1px solid var(--rule-strong); border-radius: 20px; color: var(--ink); font-weight: 500; font-size: 15px; text-decoration: none; white-space: nowrap; }
.cats a:hover, .cats a:focus-visible { border-color: var(--ink); background: var(--paper-deep); }
.group { scroll-margin-top: 16px; }
.combo { padding: 10px 0 12px 36px; border-bottom: 1px solid var(--rule); }
.combo__text { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 20px; }
.combo .link { font-size: 14px; padding: 4px 0 0; }

/* ---------- the appointment card */
.card {
  margin: 32px 0 0;
  padding: 28px 0 8px;
  border-top: 1px solid var(--ink);
}
.card__salon { margin: 0 0 22px; font: 700 20px/26px var(--serif); letter-spacing: -0.015em; color: var(--ink-2); }
.card__status { margin: 0 0 18px; font: 600 15px/20px var(--sans); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); }
.card__day { margin: 0; font: 700 32px/36px var(--serif); letter-spacing: -0.015em; }
#phase-done .card, #phase-manage .card { max-width: 560px; }
.card__time { margin: 4px 0 24px; font: 500 30px/34px var(--sans); font-variant-numeric: tabular-nums; }
.card__what { margin: 0; font: 500 18px/26px var(--sans); }
.card__sub { margin: 2px 0 0; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.card__facts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 26px 0 0; padding-top: 18px; border-top: 1px solid var(--rule); }
.card__facts p { margin: 0; }
.card__label { margin-bottom: 4px !important; color: var(--ink-3); font: 600 12px/16px var(--sans); letter-spacing: 0.08em; text-transform: uppercase; }
.card__list { margin: 0; border-top: 1px solid var(--rule); }
.card__list div { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.card__list dt { color: var(--ink-3); }
.card__list dd { margin: 0; font-variant-numeric: tabular-nums; }
.card__actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 28px 0 16px; }
.card__mail { color: var(--ink-2); font-size: 15px; line-height: 22px; margin: 0; max-width: 42ch; }

/* ---------- summary (desktop margin) and bar (phone) */
.summary { display: none; }
.summary__title { margin: 0 0 12px; font: 600 13px/18px var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.summary__list { list-style: none; margin: 0; padding: 0; }
.summary__list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 15px; }
.summary__list li span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.summary__when { margin: 12px 0 0; font: 600 15px/21px var(--sans); font-variant-numeric: tabular-nums; }
.summary__when:empty { display: none; }
.summary__empty { margin: 0; color: var(--ink-3); }
.summary__total { display: flex; justify-content: space-between; margin: 14px 0 18px; padding-top: 12px; border-top: 1px solid var(--rule); font-weight: 600; font-variant-numeric: tabular-nums; }

.bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 14px;
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 1px solid var(--rule-strong);
  z-index: 5;
}
.bar__text { margin: 0; flex: 1; min-width: 0; font-size: 15px; line-height: 20px; font-variant-numeric: tabular-nums; }
.bar__text strong { display: block; font-weight: 600; }
.primary--bar { width: auto; flex: none; min-width: 132px; }

@media (min-width: 900px) {
  .masthead, .layout { max-width: calc(var(--measure) + 300px + 2 * var(--gutter)); }
  .layout { display: grid; grid-template-columns: minmax(0, var(--measure)) 240px; column-gap: 60px; padding-bottom: 80px; }
  .summary:not([hidden]) { display: block; position: sticky; top: 32px; align-self: start; margin-top: 44px; }
  .layout.is-single { grid-template-columns: minmax(0, 560px); justify-content: center; }
  .bar { display: none !important; }
}

@media (max-width: 480px) {
  .days { gap: 2px; margin: 0 -6px; }
  .days__nav { width: 32px; font-size: 26px; }
  .days__track { gap: 6px; }
  .day { width: 60px; height: 72px; }
}

@media (max-width: 360px) {
  :root { --gutter: 16px; }
  .masthead__name { font-size: 32px; line-height: 36px; }
  .title { font-size: 30px; line-height: 36px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .card__day { font-size: 34px; line-height: 38px; }
}

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

/* ---------- manage (from the e-mail link) */
.primary--inline { display: inline-flex; align-items: center; width: auto; min-height: 48px; }
.confirm-cancel { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--rule); }
.confirm-cancel p { margin: 0 0 4px; font-weight: 500; }
.is-cancelled .card__day, .is-cancelled .card__time { color: var(--ink-2); }
.is-cancelled #m-where-row { display: none; }
#m-new { margin-top: 18px; }
.phase:focus { outline: none; }
.back-link { margin-top: 24px; }

/* Feedback about the booking page: present, never in the way. */
.feedback { grid-column: 1; margin: 48px 0 24px; padding-top: 18px; border-top: 1px solid var(--rule); }
.feedback > summary { list-style: none; cursor: pointer; color: var(--ink-3); font-size: 14px; line-height: 20px; }
.feedback > summary::-webkit-details-marker { display: none; }
.feedback[open] > summary { color: var(--ink-2); margin-bottom: 14px; }
.feedback form { max-width: 520px; }
.feedback .field__hint { margin: 0 0 16px; }
.feedback .status:not(:empty) { margin-bottom: 12px; }

/* A treatment's description: three lines while browsing, all of it once chosen. */
.svc__desc {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
  margin-top: 6px; color: var(--ink-2); font-size: 14px; line-height: 21px; white-space: pre-line;
}
.svc[aria-pressed="true"] .svc__desc { display: block; -webkit-line-clamp: unset; }
/* The demo salon says what it is, plainly, above everything else. */
.demo-note { margin: 0; padding: 10px 16px; background: var(--paper-deep); border-bottom: 1px solid var(--rule); color: var(--ink); font: 500 14px/20px var(--sans); text-align: center; }
.demo-note p { margin: 0; }
.demo-note__nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-top: 6px; font-weight: 400; }
.demo-note__nav a { color: var(--ink); }

.who-holds { grid-column: 1; margin: 40px 0 0; color: var(--ink-3); font-size: 13px; line-height: 19px; }
.who-holds a { color: var(--ink-2); }

/* Taps are taps: no double-tap zoom on buttons and links (iOS), pinch-zoom stays available. */
html { touch-action: manipulation; }
