:root {
  --fondo: #ffffff;
  --card: #ffffff;
  --inchiostro: #141414;
  --grigio: #6f6f6f;
  --grigio-chiaro: #a8a8a8;
  --bordo: rgba(20, 20, 20, 0.09);
  --campo: #f4f3f1;
  --accento: #c4532c;
  --accento-tenue: #fbeee8;
}

* { box-sizing: border-box; margin: 0; }

html, body { height: 100%; }

body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 12px;
}

.card {
  width: min(380px, 100%);
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--bordo);
  border-radius: 20px;
  padding: clamp(12px, 3.6vmin, 20px);
  box-shadow: 0 1px 2px rgba(20, 20, 20, 0.04), 0 18px 46px -20px rgba(20, 20, 20, 0.2);
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 2.4vmin, 12px);
}

/* the head: the restaurant's mark, its name and the months the strip spans */
.head { display: flex; align-items: center; gap: 10px; }
.mark {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accento-tenue); color: var(--accento);
}
.mark svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.head__text { display: flex; flex-direction: column; line-height: 1.15; flex: 1; min-width: 0; }
.head__name { font-size: 15px; font-weight: 640; letter-spacing: -0.01em; }
.head__sub { font-size: 12px; color: var(--grigio); }
.head__month { font-size: 12px; font-weight: 560; color: var(--grigio); }

/* the strip of days: a track moved by hand with inertia and snap, a pill under the chosen day */
.strip {
  position: relative;
  overflow: hidden;
  min-width: 0;
  border-radius: 14px;
  background: var(--campo);
  touch-action: pan-y;
  cursor: grab;
  outline: none;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 22px), transparent 100%);
  mask-image: linear-gradient(90deg, #000 calc(100% - 22px), transparent 100%);
}
.strip.is-drag { cursor: grabbing; }
.strip:focus-visible { box-shadow: 0 0 0 2px var(--accento); }
.strip__track { position: relative; display: flex; padding: 5px 0; will-change: transform; }
.strip__pill {
  position: absolute; left: 0; top: 5px; bottom: 5px;
  border-radius: 11px;
  background: var(--inchiostro);
  box-shadow: 0 6px 14px -6px rgba(20, 20, 20, 0.45);
  pointer-events: none;
}
.day {
  position: relative;
  flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px;
  height: clamp(48px, 13vmin, 56px);
  border: 0; background: none; font: inherit; color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.25s;
}
.day__wd { font-size: 10.5px; font-weight: 560; letter-spacing: 0.04em; text-transform: uppercase; color: var(--grigio); transition: color 0.25s; }
.day__num { font-size: 17px; font-weight: 600; font-variation-settings: "wdth" 100; transition: font-variation-settings 0.3s; }
.day.is-on { color: #fff; }
.day.is-on .day__wd { color: rgba(255, 255, 255, 0.7); }
.day.is-on .day__num { font-variation-settings: "wdth" 112; }
/* a full day: struck through and dimmed, written, never a dot */
.day.is-full { cursor: not-allowed; color: var(--grigio-chiaro); }
.day.is-full .day__wd { color: var(--grigio-chiaro); }
.day.is-full .day__num { position: relative; }
.day.is-full .day__num::after {
  content: ""; position: absolute; left: -3px; right: -3px; top: 52%;
  height: 1.5px; background: currentColor; transform: rotate(-12deg);
}
.day__full { font-size: 8.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--grigio-chiaro); height: 10px; }
.day:not(.is-full) .day__full { visibility: hidden; }
@media (hover: hover) {
  .day:not(.is-on):not(.is-full):hover .day__num { font-variation-settings: "wdth" 108; }
}

.row-head { display: flex; justify-content: space-between; align-items: baseline; }
.label { font-size: 12px; font-weight: 600; letter-spacing: 0.02em; }
.label--soft { color: var(--grigio); font-weight: 500; }

/* the times of the chosen day */
.times { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; min-height: calc(2 * 34px + 6px); }
.time {
  position: relative;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--bordo);
  background: #fff;
  font: inherit; font-size: 13px; font-weight: 560; color: var(--inchiostro);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}
.time.is-taken { color: var(--grigio-chiaro); background: var(--campo); border-color: transparent; cursor: not-allowed; text-decoration: line-through; text-decoration-thickness: 1.5px; }
.time.is-on { background: var(--accento-tenue); border-color: var(--accento); color: var(--accento); }
.time:focus-visible, .step:focus-visible, .cta:focus-visible, .day:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }
@media (hover: hover) {
  .time:not(.is-taken):not(.is-on):hover, .time.is-hover { border-color: rgba(20, 20, 20, 0.28); }
}
.time.is-hover { border-color: rgba(20, 20, 20, 0.28); }

/* the guests, with a digit that rolls */
.guests { display: flex; align-items: center; justify-content: space-between; }
.stepper { display: flex; align-items: center; gap: 4px; }
.step {
  width: 32px; height: 32px; border-radius: 10px;
  border: 1px solid var(--bordo); background: #fff; color: var(--inchiostro);
  display: grid; place-items: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.step svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.step:disabled { color: var(--grigio-chiaro); cursor: not-allowed; }
.step.is-hover { border-color: rgba(20, 20, 20, 0.28); }
@media (hover: hover) { .step:not(:disabled):hover { border-color: rgba(20, 20, 20, 0.28); } }
.count { position: relative; width: 28px; height: 22px; overflow: hidden; text-align: center; }
.count__num { position: absolute; inset: 0; font-size: 16px; font-weight: 620; line-height: 22px; }

/* the button that says the whole booking */
.cta {
  position: relative;
  overflow: hidden;
  height: 46px;
  border: 0; border-radius: 13px;
  background: var(--inchiostro); color: #fff;
  font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: grid; place-items: center;
}
.cta.is-off { background: #e9e8e5; color: var(--grigio); cursor: default; }
.cta__fill { position: absolute; inset: 0; background: var(--accento); transform: scaleX(0); transform-origin: left center; }
.cta__label { position: relative; white-space: nowrap; font-variation-settings: "wdth" 100; }
.cta__spin { position: absolute; width: 20px; height: 20px; opacity: 0; }
.cta__spin svg { width: 100%; height: 100%; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; }
.cta__check { position: absolute; left: 16px; width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }

.note { font-size: 11.5px; color: var(--grigio); text-align: center; margin-top: -4px; }

.ghost {
  position: absolute; left: 0; top: 0;
  width: 22px; height: 22px;
  fill: var(--inchiostro); stroke: #fff; stroke-width: 1.4; stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.18));
  pointer-events: none;
  opacity: 0;
  z-index: 5;
}

@media (max-height: 470px) {
  .note { display: none; }
  .head__sub { display: none; }
}
