:root {
  --fondo: #ffffff;
  --card: #ffffff;
  --inchiostro: #141416;
  --grigio: #6b6b73;
  --grigio-chiaro: #a3a3ab;
  --spento: #cfcfd4;
  --bordo: rgba(20, 20, 22, 0.09);
  --campo: #f4f4f5;
  --accento: #e0603a;
  --nastro: rgba(224, 96, 58, 0.13);
  --cella: clamp(26px, 6.6vh, 36px);
}

* { 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; -webkit-tap-highlight-color: transparent; }

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

.stay {
  position: relative;
  width: min(380px, 100%);
  background: var(--card);
  border: 1px solid var(--bordo);
  border-radius: 22px;
  padding: clamp(14px, 3.6vmin, 20px);
  box-shadow: 0 1px 2px rgba(20, 20, 22, 0.04), 0 22px 54px -22px rgba(20, 20, 22, 0.2);
}

.stay__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.stay__brand { font-size: 14.5px; font-weight: 650; letter-spacing: -0.01em; }
.stay__brand span { display: block; margin-top: 1px; font-size: 12px; font-weight: 500; color: var(--grigio); letter-spacing: 0; }
.stay__rate { font-size: 12.5px; color: var(--grigio); white-space: nowrap; }
.stay__rate b { font-size: 16px; font-weight: 680; color: var(--inchiostro); font-variant-numeric: tabular-nums; }

/* ---------- the dates field: two halves and a white pill that slides to the active one ---------- */
.field {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 18px 1fr;
  align-items: center;
  margin-top: clamp(10px, 2.6vh, 16px);
  height: clamp(50px, 12vh, 58px);
  padding: 4px;
  border-radius: 14px;
  background: var(--campo);
  box-shadow: inset 0 0 0 1px rgba(20, 20, 22, 0.04);
}
.field__pill {
  position: absolute; top: 4px; bottom: 4px; left: 4px;
  width: calc(50% - 13px);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(20, 20, 22, 0.07), 0 4px 12px -4px rgba(20, 20, 22, 0.16);
  opacity: 0;
}
.field__half {
  position: relative;
  height: 100%;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding: 0 12px;
  border-radius: 10px;
  text-align: left;
  transition: background-color 0.2s;
}
.field__half.is-hover:not(.is-active) { background: rgba(20, 20, 22, 0.04); }
@media (hover: hover) { .field__half:hover:not(.is-active) { background: rgba(20, 20, 22, 0.04); } }
.field__half:focus-visible { outline: 2px solid var(--accento); outline-offset: 1px; }
.field__label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--grigio); transition: color 0.25s; }
.field__half.is-active .field__label { color: var(--accento); }
.field__val {
  position: relative; display: block;
  height: 19px; width: 100%;
  margin-top: 2px;
  overflow: hidden;
  font-size: 14.5px; font-weight: 620; letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.field__val span { position: absolute; left: 0; top: 0; white-space: nowrap; }
.field__val.is-empty span { color: var(--grigio-chiaro); font-weight: 500; }
.field__arrow { position: relative; width: 16px; fill: none; stroke: var(--grigio-chiaro); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- the body: price breakdown and calendar take turns in the same box ---------- */
.body {
  position: relative;
  margin-top: 8px;
  height: calc(var(--cella) * 6 + 10px + 64px);
}
.sum, .cal { position: absolute; inset: 0; }

.sum { display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 0 2px; }
.perk {
  position: absolute; top: 6px; left: 0; right: 0;
  display: flex; gap: 10px; align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--campo);
}
.perk svg { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--inchiostro); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.perk > div { flex: 1; min-width: 0; }
.perk__t { font-size: 12.5px; font-weight: 620; }
.perk__s { position: relative; height: 16px; overflow: hidden; font-size: 12px; color: var(--grigio); }
.perk__s span { position: absolute; left: 0; top: 0; white-space: nowrap; }
.sum__rows { display: grid; gap: clamp(3px, 0.9vh, 7px); }
.sum__row { display: flex; justify-content: space-between; font-size: 13px; color: var(--grigio); font-variant-numeric: tabular-nums; }
.sum__row dd { color: var(--inchiostro); font-weight: 520; }
.sum__row--total { margin-top: 3px; padding-top: clamp(6px, 1.4vh, 9px); border-top: 1px solid var(--bordo); font-size: 14.5px; color: var(--inchiostro); font-weight: 650; }
.sum__row--total dd { font-weight: 680; }
.reserve {
  position: relative;
  height: clamp(40px, 9.6vh, 46px);
  margin-top: 4px;
  border-radius: 999px;
  background: var(--inchiostro);
  color: #fff;
  font-size: 14px; font-weight: 600;
  font-variation-settings: "wdth" 100;
  box-shadow: 0 8px 18px -8px rgba(20, 20, 22, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.reserve.is-ready { background: var(--accento); box-shadow: 0 8px 18px -8px rgba(224, 96, 58, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.22); }
.reserve__txt { display: inline-block; }
.sum__note { text-align: center; font-size: 11.5px; color: var(--grigio-chiaro); }

/* ---------- the calendar ---------- */
.cal {
  visibility: hidden;
  display: flex; flex-direction: column;
  padding: 2px 0 0;
}
.cal__top { display: flex; align-items: center; justify-content: space-between; height: 32px; }
.cal__nav {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  transition: background-color 0.2s;
}
.cal__nav svg { width: 14px; height: 14px; fill: none; stroke: var(--inchiostro); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cal__nav.is-hover { background: var(--campo); }
@media (hover: hover) { .cal__nav:hover { background: var(--campo); } }
.cal__nav:disabled { cursor: default; }
.cal__nav:disabled svg { stroke: var(--spento); }
.cal__nav:focus-visible { outline: 2px solid var(--accento); }
.cal__month { position: relative; height: 18px; flex: 1; overflow: hidden; text-align: center; font-size: 13.5px; font-weight: 640; letter-spacing: -0.005em; }
.cal__month span { position: absolute; left: 0; right: 0; top: 0; }
.cal__week { display: grid; grid-template-columns: repeat(7, 1fr); margin-top: 6px; height: 18px; font-size: 10.5px; font-weight: 600; color: var(--grigio-chiaro); text-align: center; letter-spacing: 0.02em; }
.cal__clip { position: relative; flex: 1; margin-top: 4px; overflow: hidden; }

.page { position: absolute; inset: 0; }
.band { position: absolute; inset: 0; pointer-events: none; }
.band i {
  position: absolute; top: 0; left: 0;
  height: var(--cella);
  background: var(--nastro);
  border-radius: 0;
  opacity: 0;
}
.band i.a { border-top-left-radius: 999px; border-bottom-left-radius: 999px; }
.band i.b { border-top-right-radius: 999px; border-bottom-right-radius: 999px; }
.grid { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: var(--cella); row-gap: 2px; }

.d {
  position: relative;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 520;
  font-variant-numeric: tabular-nums;
}
.d__c {
  position: relative;
  width: var(--cella); height: var(--cella);
  display: grid; place-items: center;
  border-radius: 50%;
}
.d__c::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--campo);
  transform: scale(0.6); opacity: 0;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s;
}
.d__c::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--accento);
  box-shadow: 0 4px 10px -4px rgba(224, 96, 58, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform: scale(0);
  transition: transform 0.34s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.d.is-edge .d__c::after { transform: scale(1); }
.d__n { position: relative; z-index: 1; transition: color 0.2s; }
.d.is-today .d__c { box-shadow: inset 0 0 0 1px var(--inchiostro); }
.d.is-hover .d__c::before { transform: scale(1); opacity: 1; }
@media (hover: hover) { .d:not(:disabled):hover .d__c::before { transform: scale(1); opacity: 1; } }
.d.is-in .d__c::before { opacity: 0; }
.d.is-edge .d__n { color: #fff; font-weight: 640; }
.d.is-end-hover .d__c::before { opacity: 1; transform: scale(1); background: #fff; box-shadow: inset 0 0 0 1.5px var(--accento), 0 3px 8px -4px rgba(224, 96, 58, 0.5); }
.d.is-end-hover .d__n { color: var(--accento); font-weight: 640; }
.d:disabled { cursor: default; }
.d:disabled .d__n { color: var(--spento); text-decoration: line-through; text-decoration-color: rgba(20, 20, 22, 0.18); text-decoration-thickness: 1px; }
.d:focus-visible { outline: none; }
.d:focus-visible .d__c { box-shadow: 0 0 0 2px var(--accento); }
.d--blank { pointer-events: none; }

.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;
}
