:root {
  --fondo: #ffffff;
  --card: #ffffff;
  --inchiostro: #121214;
  --grigio: #6e6e76;
  --grigio-chiaro: #a8a8b0;
  --bordo: rgba(18, 18, 20, 0.1);
  --campo: #f5f5f6;
  --accento: #2563eb;
  --errore: #d93a2b;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 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;
}

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

.pay {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--bordo);
  border-radius: 20px;
  padding: clamp(16px, 4.4vmin, 24px);
  box-shadow: 0 1px 2px rgba(18, 18, 20, 0.04), 0 20px 50px -22px rgba(18, 18, 20, 0.2);
}

.pay__head { display: flex; gap: 12px; align-items: flex-start; }
.pay__mark {
  flex: none;
  width: 30px; height: 30px;
  padding: 6px;
  border-radius: 9px;
  background: var(--inchiostro);
  fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round;
}
.pay__brand { font-size: 15px; font-weight: 640; letter-spacing: -0.01em; }
.pay__crumb { color: var(--grigio-chiaro); font-weight: 500; }
.pay__sub { margin-top: 3px; font-size: 13px; line-height: 1.4; color: var(--grigio); }

.pay__row {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: clamp(14px, 4vmin, 22px);
  margin-bottom: 8px;
}
.pay__label { font-size: 13px; font-weight: 620; }
.pay__hint { font-size: 11.5px; color: var(--grigio); }

/* the field: the real input lies on top, invisible; what you see is the drawn text with its groups */
.field {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  height: 48px;
  padding: 0 12px 0 8px;
  border-radius: 12px;
  background: var(--campo);
  border: 1px solid var(--bordo);
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.field.is-focus { background: #fff; border-color: rgba(18, 18, 20, 0.22); }
.field.is-valid { background: #fff; border-color: var(--accento); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accento) 14%, transparent); }
.field.is-wrong { background: #fff; border-color: var(--errore); box-shadow: 0 0 0 4px color-mix(in srgb, var(--errore) 12%, transparent); }

.tag {
  position: relative;
  flex: none;
  width: 34px; height: 30px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--bordo);
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em;
}
.tag__globe { width: 17px; height: 17px; fill: none; stroke: var(--grigio-chiaro); stroke-width: 1.5; }
.tag__code { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; color: var(--inchiostro); }

.field__text {
  position: relative;
  flex: 1; min-width: 0;
  display: flex; align-items: center;
  height: 100%;
  white-space: nowrap; overflow: hidden;
  font-family: var(--mono);
  font-size: clamp(11px, 3.4vw, 14.5px);
  letter-spacing: 0.02em;
}
.field__ph { position: absolute; left: 0; color: var(--grigio-chiaro); pointer-events: none; }
.grp { display: inline-flex; }
.grp + .grp { margin-left: var(--gap, 0px); }
.ch { display: inline-block; width: 1ch; text-align: center; }
.caret {
  display: inline-block;
  width: 1.5px; height: 1.15em;
  margin-left: 1px;
  background: var(--accento);
  opacity: 0;
}

.field__input {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  font-size: 16px;
  border: 0; background: none;
  cursor: text;
}

.field__ok { flex: none; width: 22px; height: 22px; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ok__ring { stroke: var(--accento); opacity: 0.2; }
.ok__tick { stroke: var(--accento); }

.below { position: relative; height: 30px; margin-top: 6px; }
.bank, .error {
  position: absolute; left: 2px; top: 6px;
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px;
  opacity: 0;
}
.bank__icon, .error__icon { width: 15px; height: 15px; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.bank__icon { stroke: var(--grigio); }
.bank__name { font-weight: 600; }
.bank__city { color: var(--grigio); }
.error { color: var(--errore); font-weight: 560; }
.error__icon { stroke: var(--errore); }

.go {
  position: relative;
  width: 100%; height: 46px;
  margin-top: 8px;
  border: 0; border-radius: 12px;
  background: #e9e9ec;
  color: #9a9aa2;
  font: inherit; font-size: 14.5px; font-weight: 600;
  overflow: hidden;
  cursor: not-allowed;
  transition: background 0.3s, color 0.3s;
}
.go.is-ready { background: var(--inchiostro); color: #fff; cursor: pointer; }
.go__fill { position: absolute; inset: 0; background: var(--accento); transform: scaleX(0); transform-origin: left; }
.go__label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 7px; }
.go__label--b { opacity: 0; color: #fff; }
.go__label--b svg { width: 17px; height: 17px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pay__foot { margin-top: 10px; font-size: 11.5px; color: var(--grigio); text-align: center; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

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

@media (hover: hover) {
  .go.is-ready:hover { background: #26262a; }
}
