:root {
  --fondo: #ffffff;
  --carta: #ffffff;
  --bordo: rgba(17, 17, 19, 0.1);
  --bordo-forte: rgba(17, 17, 19, 0.22);
  --testo: #18181b;
  --testo-2: #71717a;
  --testo-3: #a1a1aa;
  --nero: #111113;
  --verde: #14532d;
  --rosso: #d4373c;
  --accento: #4f46e5;
}

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

html, body { height: 100%; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.stage {
  overflow: hidden;
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(14px, 4vmin, 40px);
}

.card {
  width: min(420px, 100%);
  text-align: left;
}

.kicker {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--accento);
}

.title {
  margin-top: 8px;
  font-size: clamp(22px, min(6.4vw, 5.2vh), 30px);
  line-height: 1.12;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.sub {
  margin-top: 8px;
  font-size: clamp(13.5px, min(3.8vw, 3.4vh), 15px);
  line-height: 1.5;
  color: var(--testo-2);
}

/* the pill: field and button in one shape */
.pill {
  position: relative;
  margin-top: clamp(14px, 3.4vh, 22px);
  height: 52px;
  border-radius: 999px;
  background: #fafafa;
  box-shadow: inset 0 0 0 1px var(--bordo), 0 1px 2px rgba(17, 17, 19, 0.04);
  display: flex;
  align-items: center;
  transition: box-shadow 0.2s ease, background-color 0.2s ease;
}
.pill.is-focus { background: #ffffff; box-shadow: inset 0 0 0 1px var(--bordo-forte), 0 0 0 4px rgba(79, 70, 229, 0.12); }
.pill.is-bad { box-shadow: inset 0 0 0 1px rgba(212, 55, 60, 0.6), 0 0 0 4px rgba(212, 55, 60, 0.1); }

.pill__icon {
  flex: none;
  width: 19px;
  height: 19px;
  margin-left: 18px;
  fill: none;
  stroke: var(--testo-3);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pill__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0 10px 0 10px;
  font: inherit;
  font-size: 15px;
  color: var(--testo);
  caret-color: var(--accento);
}
.pill__input::placeholder { color: var(--testo-3); }

/* the button sits on the right; when it confirms it grows over the whole pill */
.go {
  position: absolute;
  right: 5px;
  top: 5px;
  bottom: 5px;
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  color: #ffffff;
  cursor: pointer;
  border-radius: 999px;
  outline: none;
}
.go:focus-visible { box-shadow: 0 0 0 3px #ffffff, 0 0 0 5px var(--accento); }

.go__fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--nero);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.18), 0 8px 16px -8px rgba(17, 17, 19, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.go__label {
  position: relative;
  display: inline-block; /* inline-block, so its width is the word's and not the button's */
  padding: 0 20px;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 42px;
  white-space: nowrap;
}

.go__arc {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0;
}

.go__done {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14.5px;
  white-space: nowrap;
  opacity: 0;
}
.go__done b { font-weight: 650; }
.go__check {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* the line under the pill: three messages in the same place */
.hint {
  position: relative;
  height: 20px;
  margin-top: 10px;
  padding-left: 18px;
  font-size: 13px;
  color: var(--testo-2);
}
.hint > span { position: absolute; left: 18px; top: 0; white-space: nowrap; }
.hint__err { color: var(--rosso); opacity: 0; }
.hint__yay { color: var(--verde); opacity: 0; font-weight: 550; }

.num { display: inline-flex; font-variant-numeric: tabular-nums; }
.digit { position: relative; display: inline-block; height: 1.25em; overflow: hidden; vertical-align: -0.25em; }
.digit__col { display: flex; flex-direction: column; line-height: 1.25em; }

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

@media (max-width: 380px) {
  .pill { height: 48px; }
  .pill__icon { margin-left: 14px; }
  .go__label { padding: 0 15px; line-height: 38px; font-size: 14px; }
  .go__done { font-size: 13px; gap: 6px; }
  .go__text b { margin-right: 1px; }
}
