:root {
  --fondo: #ffffff;
  --carta: #ffffff;
  --inchiostro: #0a0a0a;
  --grigio: #71717a;
  --grigio-chiaro: #a1a1aa;
  --morbido: #f4f4f5;
  --linea: rgba(10, 10, 10, 0.09);
  --accento: #4ade80;
}

* { box-sizing: border-box; margin: 0; padding: 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;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

/* the booker keeps the space of the open card, so nothing around it jumps when it opens */
.booker {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 12px;
  /* lo spazio della card aperta, anche da chiusa: è il riquadro del poster e del video (inquadra) */
  min-width: min(340px, calc(100vw - 32px));
  min-height: 300px;
}

/* the shell: a pill when closed, a card when open; GSAP animates its width, height and corners */
.shell {
  position: relative;
  width: 160px;
  height: 46px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--carta);
  box-shadow: 0 1px 2px rgba(10, 10, 10, 0.18), 0 8px 18px -8px rgba(10, 10, 10, 0.45);
  isolation: isolate;
}
.shell__ink {
  position: absolute; inset: 0;
  background: var(--inchiostro);
  border-radius: inherit;
  z-index: 0;
}
.shell__edge {
  position: absolute; inset: 0;
  border: 1px solid var(--linea);
  border-radius: inherit;
  opacity: 0;
  z-index: 3;
  pointer-events: none;
}

.face {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  color: #fff;
  font-size: 14.5px;
  font-weight: 560;
  letter-spacing: -0.005em;
  white-space: nowrap;
  z-index: 2;
}
.face--idle { width: 100%; border-radius: 999px; }
.face--idle:focus-visible { outline: 2px solid #fff; outline-offset: -5px; }
.face--done { opacity: 0; pointer-events: none; font-variant-numeric: tabular-nums; }

.cal, .tick { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cal { overflow: visible; }
.tick { stroke: var(--accento); stroke-width: 2.1; }

/* the open card */
.panel {
  position: absolute; left: 0; top: 0;
  padding: 18px 18px 16px;
  opacity: 0;
  visibility: hidden;
  z-index: 1;
  color: var(--inchiostro);
}
.panel__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.panel__title { font-size: 15px; font-weight: 650; letter-spacing: -0.012em; }
.panel__sub { font-size: 12px; color: var(--grigio); margin-top: 3px; }
.panel__close {
  width: 28px; height: 28px; flex: none;
  display: grid; place-items: center;
  border-radius: 9px;
  margin: -4px -6px 0 0;
  color: var(--grigio);
  transition: background-color 0.2s ease, color 0.2s ease;
}
.panel__close svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }

.days {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 16px 0 12px;
  padding: 4px;
  border-radius: 13px;
  background: var(--morbido);
}
.days__pill {
  position: absolute; left: 0; top: 4px;
  height: calc(100% - 8px);
  border-radius: 10px;
  background: var(--carta);
  box-shadow: 0 1px 2px rgba(10, 10, 10, 0.08), 0 2px 8px -2px rgba(10, 10, 10, 0.12);
}
.day {
  position: relative;
  z-index: 1;
  display: grid; justify-items: center; gap: 1px;
  padding: 7px 0 6px;
  border-radius: 10px;
  color: var(--grigio);
  transition: color 0.25s ease;
}
.day__name { font-size: 11px; font-weight: 520; text-transform: uppercase; letter-spacing: 0.06em; }
.day__num { font-size: 16px; font-weight: 620; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.day[aria-selected="true"] { color: var(--inchiostro); }

.slots {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  height: 78px;
}
.slots__group {
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 35px;
  gap: 8px 7px;
  align-content: start;
  visibility: hidden;
}
.slot {
  position: relative;
  height: 35px;
  border-radius: 999px;
  border: 1px solid var(--linea);
  font-size: 13px;
  font-weight: 540;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.slot__fill {
  position: absolute; inset: 0;
  border-radius: inherit;
  background: var(--inchiostro);
  transform: scale(0);
  opacity: 0;
}
.slot__text { position: relative; z-index: 1; }

.tz {
  display: flex; align-items: center; gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--linea);
  font-size: 11.5px;
  color: var(--grigio);
}
.tz svg { width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; }

.note {
  font-size: 12px;
  color: var(--grigio);
  opacity: 0;
  white-space: nowrap;
}
.note span { color: var(--inchiostro); font-weight: 520; }

@media (hover: hover) {
  .panel__close:hover { background: var(--morbido); color: var(--inchiostro); }
  .day:hover { color: var(--inchiostro); }
  .slot:hover { border-color: rgba(10, 10, 10, 0.32); }
}

/* the drawn pointer of the autopilot */
.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.25));
  pointer-events: none;
  opacity: 0;
  z-index: 10;
}
