:root {
  --fondo: #ffffff;
  --carta: #ffffff;
  --inchiostro: #14161a;
  --grigio: #6f737b;
  --tenue: #b5b8bf;
  --linea: rgba(20, 22, 26, 0.09);
  --accento: #3d5af1;
  --accento-scuro: #2b45d6;
  --accento-tenue: rgba(61, 90, 241, 0.1);
  --giusto: #13a26b;
  --errore: #e5484d;
  --errore-tenue: rgba(229, 72, 77, 0.08);
  --campo: clamp(36px, 9vh, 44px);
  --font: 'Mona Sans Variable', 'Mona Sans', system-ui, -apple-system, 'Segoe 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; text-align: left; }
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 ---------- */
.wz {
  position: relative;
  width: min(372px, 92vw);
  padding: clamp(12px, 2.8vh, 18px) clamp(12px, 3.8vw, 18px);
  border-radius: 22px;
  background: var(--carta);
  border: 1px solid rgba(20, 22, 26, 0.07);
  box-shadow:
    0 0 0 0.5px rgba(20, 22, 26, 0.03),
    0 1px 1px rgba(20, 22, 26, 0.04),
    0 4px 10px -2px rgba(20, 22, 26, 0.05),
    0 18px 36px -12px rgba(20, 22, 26, 0.12),
    0 42px 70px -30px rgba(43, 69, 214, 0.18),
    inset 0 1px 0 #fff;
  isolation: isolate;
}
.wz__glow {
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(120% 60% at 50% -8%, rgba(61, 90, 241, 0.07), transparent 60%);
  z-index: -1;
}
.wz__glow::after {
  content: '';
  position: absolute; inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--giro, 0deg), transparent 0 70%, rgba(19, 162, 107, 0.9) 82%, transparent 92%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: var(--bordo, 0);
}

.wz__head { display: flex; align-items: center; gap: 10px; }
.wz__logo {
  flex: none;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(180deg, #23262d, #121418);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14) inset, 0 3px 8px -2px rgba(20, 22, 26, 0.35);
}
.wz__logo svg { width: 20px; height: 20px; fill: #fff; }
.wz__logo-snow { fill: none; stroke: var(--accento); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.wz__meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.wz__brand { font-size: 11.5px; color: var(--grigio); font-weight: 500; letter-spacing: 0.01em; }
.wz__title { font-size: 15.5px; font-weight: 640; letter-spacing: -0.01em; font-stretch: 104%; }
.wz__time { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--grigio); padding: 5px 9px; border-radius: 99px; background: #f5f6f8; }
.wz__time svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }

/* ---------- the step bar ---------- */
.bar {
  list-style: none; margin: clamp(10px, 2.6vh, 16px) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px;
}
.seg { min-width: 0; }
.seg__btn { display: block; width: 100%; padding: 2px 0 4px; cursor: default; border-radius: 6px; }
.seg.is-done .seg__btn { cursor: pointer; }
.seg__btn:focus-visible { outline: 2px solid var(--accento); outline-offset: 3px; }
.seg__line {
  position: relative; display: block;
  height: 3px; border-radius: 3px;
  background: #eceef2;
  overflow: hidden;
}
.seg__fill {
  position: absolute; inset: 0;
  border-radius: inherit;
  background: var(--accento);
  transform-origin: 0 50%;
  transform: scaleX(0);
}
.seg.is-done .seg__fill { background: var(--inchiostro); }
.seg__sheen {
  position: absolute; top: 0; bottom: 0; left: 0; width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  transform: translateX(-120%);
}
.seg__text { position: relative; display: block; height: 16px; margin-top: 7px; overflow: hidden; }
.seg__name, .seg__ans {
  position: absolute; left: 0; right: 0; top: 0;
  display: flex; align-items: center; gap: 3px;
  font-size: 11.5px; line-height: 16px;
  white-space: nowrap;
}
.seg__name { color: var(--tenue); font-weight: 520; }
.seg.is-on .seg__name { color: var(--inchiostro); font-weight: 600; }
.seg__ans { color: var(--inchiostro); font-weight: 600; opacity: 0; }
.seg__ans span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.seg__ans svg { flex: none; width: 11px; height: 11px; fill: none; stroke: var(--giusto); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) {
  .seg.is-done .seg__btn:hover .seg__ans span { color: var(--accento); }
}

/* ---------- the body ---------- */
.wz__body { position: relative; margin-top: clamp(10px, 2.4vh, 16px); }
.panel { position: absolute; left: 0; right: 0; top: 0; }
.panel__q {
  display: flex; justify-content: space-between; align-items: baseline; width: 100%;
  margin: 0 0 clamp(8px, 1.8vh, 12px);
  font-size: 15px; font-weight: 620; letter-spacing: -0.01em;
}
.panel__note { font-size: 11.5px; font-weight: 500; color: var(--grigio); }

/* fields */
.field { display: block; }
.field + .field { margin-top: clamp(7px, 1.6vh, 11px); }
.field__label { display: block; font-size: 11.5px; font-weight: 560; color: var(--grigio); margin: 0 0 5px 2px; }
.field__box {
  position: relative; display: flex; align-items: center;
  height: var(--campo);
  border-radius: 12px;
  background: #fbfbfc;
  box-shadow: 0 0 0 1px rgba(20, 22, 26, 0.1) inset, 0 1px 2px rgba(20, 22, 26, 0.04);
  transition: box-shadow 0.25s ease, background-color 0.25s ease;
}
.field.is-focus .field__box { background: #fff; box-shadow: 0 0 0 1.5px var(--accento) inset, 0 0 0 4px var(--accento-tenue); }
.field.is-bad .field__box { background: #fff; box-shadow: 0 0 0 1.5px var(--errore) inset, 0 0 0 4px var(--errore-tenue); }
.field__input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; outline: 0; background: none;
  padding: 0 38px 0 13px;
  font: inherit; font-size: 14.5px; font-weight: 500; color: var(--inchiostro);
  caret-color: var(--accento);
}
.field__input::placeholder { color: #c3c6cc; font-weight: 450; }
.field__ok {
  position: absolute; right: 12px; top: 50%;
  width: 18px; height: 18px; margin-top: -9px;
  fill: none; stroke: var(--giusto); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  opacity: 0;
}
.field__ok circle { fill: rgba(19, 162, 107, 0.1); stroke: none; }
.field__err { display: block; height: 0; overflow: hidden; }
.field__err-in { display: flex; align-items: center; gap: 5px; padding: 6px 0 0 2px; font-size: 11.5px; font-weight: 520; color: var(--errore); }
.field__err-in svg { flex: none; width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }

/* plans */
.plans { display: grid; gap: clamp(5px, 1.2vh, 8px); }
.plan {
  position: relative;
  display: flex; align-items: center; gap: 11px; width: 100%;
  height: clamp(44px, 11vh, 54px);
  padding: 0 13px;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(20, 22, 26, 0.09) inset, 0 1px 2px rgba(20, 22, 26, 0.04);
  transition: box-shadow 0.25s ease, background-color 0.25s ease;
}
.plan[aria-checked="true"] { background: linear-gradient(180deg, #fff, #f7f8ff); box-shadow: 0 0 0 1.5px var(--accento) inset, 0 6px 16px -8px rgba(61, 90, 241, 0.45); }
.plan.is-hover { box-shadow: 0 0 0 1px rgba(20, 22, 26, 0.2) inset, 0 3px 8px -4px rgba(20, 22, 26, 0.18); }
@media (hover: hover) {
  .plan:hover { box-shadow: 0 0 0 1px rgba(20, 22, 26, 0.2) inset, 0 3px 8px -4px rgba(20, 22, 26, 0.18); }
  .plan[aria-checked="true"]:hover { box-shadow: 0 0 0 1.5px var(--accento) inset, 0 6px 16px -8px rgba(61, 90, 241, 0.45); }
}
.plan:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }
.plan__radio {
  flex: none; position: relative;
  width: 18px; height: 18px; border-radius: 50%;
  box-shadow: 0 0 0 1.5px #cfd2d8 inset;
  transition: box-shadow 0.2s ease;
}
.plan__radio::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: var(--accento);
  transform: scale(var(--r, 0));
}
.plan__radio svg { position: absolute; inset: 2px; width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 12; stroke-dashoffset: 12; }
.plan__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.plan__name { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 620; }
.plan__tag { font-size: 10px; font-weight: 620; color: var(--accento); padding: 1px 6px; border-radius: 99px; background: var(--accento-tenue); letter-spacing: 0.02em; }
.plan__sub { font-size: 11.5px; color: var(--grigio); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan__price { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.plan__price small { font-size: 11px; font-weight: 500; color: var(--grigio); margin-left: 1px; }

/* days */
.days { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.day {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  height: clamp(50px, 12.4vh, 60px);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(20, 22, 26, 0.09) inset;
  text-align: center;
  transition: box-shadow 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}
.day__wd { font-size: 11px; color: var(--grigio); font-weight: 520; transition: color 0.25s ease; }
.day__n { font-size: 17px; font-weight: 640; letter-spacing: -0.01em; }
.day[aria-checked="true"] { background: var(--inchiostro); color: #fff; box-shadow: 0 0 0 1px var(--inchiostro) inset, 0 8px 16px -8px rgba(20, 22, 26, 0.55); }
.day[aria-checked="true"] .day__wd { color: rgba(255, 255, 255, 0.6); }
.day.is-hover { box-shadow: 0 0 0 1px rgba(20, 22, 26, 0.22) inset; }
@media (hover: hover) { .day:not([aria-checked="true"]):hover { box-shadow: 0 0 0 1px rgba(20, 22, 26, 0.22) inset; } }
.day:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }

.check {
  display: flex; align-items: center; gap: 11px; width: 100%;
  margin-top: clamp(8px, 1.8vh, 12px);
  padding: clamp(8px, 1.8vh, 11px) 12px;
  border-radius: 13px;
  background: #f7f8fa;
}
.check:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }
.check__box {
  flex: none; display: grid; place-items: center;
  width: 20px; height: 20px; border-radius: 6px;
  background: #fff;
  box-shadow: 0 0 0 1.5px #cfd2d8 inset;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.check[aria-checked="true"] .check__box { background: var(--accento); box-shadow: 0 0 0 1.5px var(--accento) inset, 0 3px 8px -3px rgba(61, 90, 241, 0.6); }
.check__box svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 12; stroke-dashoffset: 12; }
.check__txt { display: flex; flex-direction: column; min-width: 0; }
.check__name { font-size: 13.5px; font-weight: 600; }
.check__sub { font-size: 11.5px; color: var(--grigio); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* review */
.rows { margin: 0; border-radius: 14px; box-shadow: 0 0 0 1px var(--linea) inset; }
.row {
  display: flex; align-items: center; gap: 10px;
  padding: 0 13px;
  height: clamp(36px, 8.8vh, 44px);
}
.row + .row { border-top: 1px solid var(--linea); }
.row dt { width: 58px; flex: none; font-size: 11.5px; color: var(--grigio); font-weight: 520; }
.row dd { flex: 1; margin: 0; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__edit { font-size: 11.5px; font-weight: 600; color: var(--accento); padding: 6px 2px; border-radius: 6px; }
.row__edit:focus-visible { outline: 2px solid var(--accento); outline-offset: 1px; }
@media (hover: hover) { .row__edit:hover { color: var(--accento-scuro); } }
.due {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: clamp(8px, 1.8vh, 12px); padding: 0 4px;
  font-size: 12.5px; color: var(--grigio); font-weight: 520;
}
.due strong { font-size: 20px; color: var(--inchiostro); font-weight: 680; letter-spacing: -0.02em; }

/* done */
.panel--done { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: clamp(4px, 1.4vh, 12px); }
.done__mark { width: clamp(52px, 13vh, 64px); height: clamp(52px, 13vh, 64px); overflow: visible; }
.done__halo { fill: rgba(19, 162, 107, 0.1); transform-origin: 32px 32px; }
.done__ring { fill: var(--giusto); transform-origin: 32px 32px; }
.done__tick { fill: none; stroke: #fff; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; }
.done__title { margin: clamp(8px, 2vh, 14px) 0 4px; font-size: 19px; font-weight: 660; letter-spacing: -0.015em; font-stretch: 104%; }
.done__sub { margin: 0; font-size: 12.5px; color: var(--grigio); }
.done__sub strong { color: var(--inchiostro); font-weight: 620; }

/* ---------- the actions ---------- */
.acts { display: flex; gap: 8px; margin-top: clamp(12px, 2.8vh, 18px); }
.back {
  flex: none;
  display: flex; align-items: center; justify-content: center; gap: 2px;
  height: clamp(40px, 10vh, 46px);
  width: 0; padding: 0; overflow: hidden;
  border-radius: 13px;
  font-size: 13.5px; font-weight: 580; color: var(--inchiostro);
  background: #f3f4f6;
  opacity: 0;
}
.back svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.back span { padding-right: 4px; }
.back:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }
@media (hover: hover) { .back:hover { background: #eceef1; } }

.cta {
  position: relative; flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  height: clamp(40px, 10vh, 46px);
  border-radius: 13px;
  color: #fff;
  font-size: 14px; font-weight: 620; font-stretch: 104%;
  isolation: isolate;
}
.cta__bg {
  position: absolute; inset: 0; z-index: -1;
  border-radius: inherit;
  background: linear-gradient(180deg, #2a2d35, #14161a);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.16) inset, 0 -1px 0 rgba(0, 0, 0, 0.3) inset, 0 6px 14px -6px rgba(20, 22, 26, 0.55);
  transition: background 0.3s ease;
}
.cta.is-last .cta__bg { background: linear-gradient(180deg, #5571ff, #3048e0); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.28) inset, 0 -1px 0 rgba(0, 0, 0, 0.15) inset, 0 8px 18px -6px rgba(61, 90, 241, 0.6); }
.cta.is-hover .cta__bg { filter: brightness(1.12); }
@media (hover: hover) { .cta:hover .cta__bg { filter: brightness(1.12); } }
.cta:focus-visible { outline: 2px solid var(--accento); outline-offset: 3px; }
.cta__arrow { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cta__spin { position: absolute; width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 28 60; opacity: 0; }

.pointer {
  position: absolute; left: 0; top: 0;
  width: 22px; height: 22px;
  fill: #14161a; 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) {
  .wz__time { display: none; }
  .check__sub { display: none; }
  .plan__sub { font-size: 11px; }
}
