:root {
  --fondo: #ffffff;
  --carta: #fcfbf9;
  --inchiostro: #15171a;
  --grigio: #73767c;
  --tenue: #b7b9be;
  --linea: rgba(21, 23, 26, 0.08);
  --accento: #ef5a24;
  --accento-scuro: #c8411a;
  --accento-tenue: rgba(239, 90, 36, 0.12);
  --corpo: clamp(196px, 50vh, 252px);
  --pillola: clamp(42px, 10.6vh, 54px);
  --giorno: clamp(52px, 12.6vh, 64px);
  --font: 'Mona Sans Variable', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(8px, 2.4vh, 28px) 12px;
}

/* ---------- the card ---------- */
.bk {
  position: relative;
  width: min(372px, 92vw);
  padding: clamp(12px, 2.8vh, 18px) clamp(12px, 3.6vw, 18px) clamp(12px, 2.8vh, 18px);
  border-radius: 24px;
  background:
    radial-gradient(110% 55% at 100% 0%, rgba(239, 90, 36, 0.07), transparent 62%),
    linear-gradient(180deg, #ffffff, var(--carta));
  border: 1px solid rgba(21, 23, 26, 0.07);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 1px 2px rgba(21, 23, 26, 0.05),
    0 10px 24px -8px rgba(21, 23, 26, 0.13),
    0 34px 70px -28px rgba(21, 23, 26, 0.26);
  overflow: hidden;
  isolation: isolate;
}
/* a fine grain so the white has a material */
.bk::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0.08 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23g)'/%3E%3C/svg%3E");
  z-index: 5;
}

.bk__head { display: flex; align-items: center; gap: 10px; height: 36px; margin-bottom: clamp(9px, 2.2vh, 14px); position: relative; }
.bk__back {
  position: absolute; left: 0; top: 2px;
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  background: #fff;
  border: 1px solid var(--linea);
  box-shadow: 0 1px 2px rgba(21, 23, 26, 0.06);
  opacity: 0; visibility: hidden;
  z-index: 2;
}
.bk__back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bk__back:focus-visible, .svc__pill:focus-visible, .day:focus-visible, .slot:focus-visible, .cta:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }
.bk__logo {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #2a2d33, #121417);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.16) inset, 0 5px 12px -4px rgba(18, 20, 23, 0.55);
}
.bk__logo svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.bk__logo svg path { stroke: var(--accento); }
.bk__meta { display: flex; flex-direction: column; line-height: 1.15; flex: 1; min-width: 0; }
.bk__brand { font-size: 12px; color: var(--grigio); font-weight: 500; }
.bk__title { font-weight: 660; font-size: 16px; letter-spacing: -0.015em; font-stretch: 104%; }
.bk__open {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--grigio); white-space: nowrap;
  padding: 5px 8px 5px 6px; border-radius: 99px;
  background: rgba(21, 23, 26, 0.035);
  border: 1px solid var(--linea);
}
.bk__open svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }

/* ---------- the step bar ---------- */
.bk__steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: clamp(10px, 2.4vh, 16px); }
.bk__step { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bk__bar { position: relative; height: 4px; border-radius: 4px; background: rgba(21, 23, 26, 0.08); overflow: hidden; }
.bk__fill {
  position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--accento-scuro), var(--accento));
  transform-origin: 0 50%; transform: scaleX(0);
}
.bk__sheen {
  position: absolute; top: 0; bottom: 0; left: -40%; width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85), transparent);
  opacity: 0;
}
.bk__slabel { font-size: 11px; font-weight: 540; color: var(--tenue); transition: color 0.3s ease; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk__step.is-on .bk__slabel { color: var(--inchiostro); }
.bk__step.is-done .bk__slabel { color: var(--grigio); }

/* ---------- the body with its three panels ---------- */
.bk__body { position: relative; height: var(--corpo); margin-bottom: clamp(10px, 2.4vh, 16px); }
.panel { position: absolute; inset: 0; display: flex; flex-direction: column; visibility: hidden; }
.panel__q {
  display: flex; justify-content: space-between; align-items: baseline; width: 100%;
  margin: 0 0 clamp(6px, 1.6vh, 10px);
  font-size: 13px; font-weight: 600; letter-spacing: -0.005em;
}
.panel__q--small { margin-top: clamp(8px, 2.2vh, 14px); }
.panel__month, .panel__note { font-size: 11.5px; font-weight: 500; color: var(--grigio); }
.panel__note { color: var(--accento-scuro); }

/* the services, as pills in a two by two grid, with one dark mark that slides under the chosen one */
.svc { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.svc__mark {
  position: absolute; left: 0; top: 0; width: 10px; height: 10px;
  border-radius: 16px;
  background: linear-gradient(170deg, #2b2e34, #111316);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14) inset, 0 8px 18px -8px rgba(17, 19, 22, 0.7), 0 2px 4px rgba(17, 19, 22, 0.18);
  opacity: 0;
  pointer-events: none;
}
.svc__pill {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 9px;
  height: var(--pillola); padding: 0 12px;
  border-radius: 16px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--linea);
  box-shadow: 0 1px 2px rgba(21, 23, 26, 0.04);
  transition: border-color 0.25s ease, background-color 0.25s ease;
}
.svc__pill svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--grigio); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; transition: stroke 0.25s ease; }
.svc__txt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.svc__name { font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; transition: color 0.25s ease, font-stretch 0.3s ease; white-space: nowrap; }
.svc__price { font-size: 11.5px; color: var(--grigio); transition: color 0.25s ease; white-space: nowrap; }
.svc__pill.is-sel { background: transparent; border-color: transparent; box-shadow: none; }
.svc__pill.is-sel .svc__name { color: #fff; font-stretch: 108%; }
.svc__pill.is-sel .svc__price { color: rgba(255, 255, 255, 0.62); }
.svc__pill.is-sel svg { stroke: var(--accento); }
@media (hover: hover) {
  .svc__pill:not(.is-sel):hover, .svc__pill.is-hover:not(.is-sel) { border-color: rgba(21, 23, 26, 0.18); background: #fdfdfc; }
  .svc__pill:not(.is-sel):hover svg { stroke: var(--inchiostro); }
}
.svc__pill.is-hover:not(.is-sel) { border-color: rgba(21, 23, 26, 0.18); }

.car {
  margin-top: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(21, 23, 26, 0.03);
  border: 1px dashed rgba(21, 23, 26, 0.13);
}
.car__icon { width: 30px; height: 15px; flex: none; fill: none; stroke: var(--inchiostro); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.car__txt { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 0; }
.car__name { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.car__sub { font-size: 11px; color: var(--grigio); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.car__edit { font-size: 11.5px; font-weight: 600; color: var(--accento-scuro); }

/* the days, a strip you drag with inertia and a snap */
.days {
  position: relative;
  height: var(--giorno);
  margin: 0 -2px;
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 22px), transparent);
          mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 22px), transparent);
}
.days.is-drag { cursor: grabbing; }
.days__track { position: absolute; left: 2px; top: 0; bottom: 0; display: flex; gap: 6px; will-change: transform; }
.days__mark {
  position: absolute; left: 0; top: 0; bottom: 0; width: 46px;
  border-radius: 14px;
  background: linear-gradient(170deg, #2b2e34, #111316);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14) inset, 0 8px 16px -8px rgba(17, 19, 22, 0.7);
  opacity: 0;
  pointer-events: none;
}
.day {
  position: relative; z-index: 1;
  width: 46px; height: 100%; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--linea);
  transition: background-color 0.25s ease, border-color 0.25s ease;
  user-select: none; -webkit-user-select: none;
}
.day__wd { font-size: 10.5px; font-weight: 540; color: var(--grigio); text-transform: uppercase; letter-spacing: 0.04em; transition: color 0.25s ease; }
.day__n { font-size: 17px; font-weight: 640; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; transition: color 0.25s ease; }
.day__load { width: 18px; height: 2px; border-radius: 2px; background: rgba(21, 23, 26, 0.1); overflow: hidden; margin-top: 3px; }
.day__load i { display: block; height: 100%; background: var(--accento); border-radius: inherit; transform-origin: 0 50%; }
.day.is-sel { background: transparent; border-color: transparent; }
.day.is-sel .day__wd { color: rgba(255, 255, 255, 0.6); }
.day.is-sel .day__n { color: #fff; }
.day.is-sel .day__load { background: rgba(255, 255, 255, 0.18); }
.day.is-off { background: transparent; border-style: dashed; cursor: default; }
.day.is-off .day__n, .day.is-off .day__wd { color: var(--tenue); }
.day.is-off .day__load { visibility: hidden; }
@media (hover: hover) {
  .day:not(.is-sel):not(.is-off):hover { border-color: rgba(21, 23, 26, 0.2); }
}
.day.is-hover:not(.is-sel) { border-color: rgba(21, 23, 26, 0.2); }

/* the times */
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.slot {
  position: relative;
  height: clamp(28px, 7.2vh, 34px);
  border-radius: 10px;
  font-size: 12.5px; font-weight: 580;
  background: #fff;
  border: 1px solid var(--linea);
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.slot.is-full { color: var(--tenue); background: transparent; cursor: default; text-decoration: line-through; text-decoration-color: rgba(21, 23, 26, 0.2); }
.slot.is-sel { background: var(--accento); border-color: var(--accento); color: #fff; box-shadow: 0 6px 14px -6px rgba(239, 90, 36, 0.8), 0 1px 0 rgba(255, 255, 255, 0.3) inset; }
@media (hover: hover) {
  .slot:not(.is-sel):not(.is-full):hover { border-color: rgba(239, 90, 36, 0.5); color: var(--accento-scuro); }
}
.slot.is-hover:not(.is-sel) { border-color: rgba(239, 90, 36, 0.5); color: var(--accento-scuro); }

/* the ticket */
.ticket {
  position: relative;
  height: 100%;
  display: flex; flex-direction: column;
  padding: clamp(10px, 2.4vh, 14px) 14px clamp(8px, 2vh, 12px);
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--linea);
  box-shadow: 0 1px 2px rgba(21, 23, 26, 0.05), 0 12px 24px -16px rgba(21, 23, 26, 0.3);
}
.ticket__top { display: flex; justify-content: space-between; min-height: clamp(60px, 15vh, 74px); padding-right: 90px; }
.ticket__kicker { margin: 0; font-size: 11px; font-weight: 600; color: var(--accento-scuro); }
.ticket__title { margin: 2px 0 0; font-size: 18px; font-weight: 680; letter-spacing: -0.02em; font-stretch: 106%; white-space: nowrap; }
.ticket__ref { margin: 3px 0 0; font-size: 11px; color: var(--grigio); font-variant-numeric: tabular-nums; }
.ticket__ref span { color: var(--inchiostro); font-weight: 600; letter-spacing: 0.04em; }
.ticket__rows { margin: 0; display: flex; flex-direction: column; }
.ticket__row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: clamp(3px, 0.9vh, 5px) 0; border-top: 1px solid var(--linea); overflow: hidden; }
.ticket__row dt { font-size: 11.5px; color: var(--grigio); }
.ticket__row dd { margin: 0; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.roll { display: inline-block; }
.ticket__cut {
  position: relative; height: 1px; margin: auto -14px 0;
  background-image: linear-gradient(90deg, rgba(21, 23, 26, 0.22) 50%, transparent 50%);
  background-size: 7px 1px;
}
.ticket__cut::before, .ticket__cut::after {
  content: ''; position: absolute; top: -8px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--carta);
  border: 1px solid var(--linea);
}
.ticket__cut::before { left: -9px; }
.ticket__cut::after { right: -9px; }
.ticket__total { display: flex; justify-content: space-between; align-items: baseline; padding-top: clamp(6px, 1.6vh, 10px); font-size: 12px; color: var(--grigio); }
.ticket__total strong { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; color: var(--inchiostro); font-variant-numeric: tabular-nums; }

.stamp {
  position: absolute; right: 8px; top: 6px;
  width: clamp(72px, 19vh, 92px); height: auto;
  color: var(--accento);
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: multiply;
}
.stamp__line { fill: none; stroke: currentColor; stroke-width: 3.2; }
.stamp__thin { fill: none; stroke: currentColor; stroke-width: 1.2; }
.stamp__ring { fill: currentColor; font-size: 10.5px; font-weight: 720; letter-spacing: 0.08em; font-stretch: 112%; }
.stamp__tick { fill: none; stroke: currentColor; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- the button ---------- */
.cta {
  position: relative;
  width: 100%;
  height: clamp(42px, 10.6vh, 48px);
  border-radius: 99px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  color: #fff;
  font-size: 14px; font-weight: 620; letter-spacing: -0.005em;
  isolation: isolate;
  overflow: hidden;
}
.cta__bg {
  position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  background: linear-gradient(180deg, #2a2d33, #111316);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.16) inset, 0 -1px 0 rgba(0, 0, 0, 0.4) inset;
}
.cta::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  background: radial-gradient(60% 120% at var(--lx, 50%) 0%, rgba(239, 90, 36, 0.55), transparent 70%);
  opacity: 0; transition: opacity 0.35s ease;
}
.cta.is-ready::before { opacity: 1; }
.cta__label { font-stretch: var(--w, 100%); transition: font-stretch 0.35s cubic-bezier(.3, 1.6, .5, 1); white-space: nowrap; }
.cta__arrow { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.35s cubic-bezier(.3, 1.6, .5, 1); }
.cta__spin { position: absolute; width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 30 100; opacity: 0; }
.cta:disabled { cursor: default; color: rgba(255, 255, 255, 0.5); }
.cta:disabled .cta__bg { background: linear-gradient(180deg, #8d9096, #7c7f85); }
.cta:disabled .cta__arrow { opacity: 0.4; }
@media (hover: hover) {
  .cta:not(:disabled):hover .cta__label { --w: 110%; }
  .cta:not(:disabled):hover .cta__arrow { transform: translateX(3px); }
}
.cta.is-hover .cta__label { --w: 110%; }
.cta.is-hover .cta__arrow { transform: translateX(3px); }
.cta.is-busy .cta__label, .cta.is-busy .cta__arrow { opacity: 0; }
.cta.is-busy .cta__spin { opacity: 1; }

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

@media (max-height: 470px) {
  .car__sub { display: none; }
  .bk__open { display: none; }
}
@media (max-width: 360px) {
  .bk__open span { display: none; }
  .bk__open { padding: 5px; }
}
