:root {
  --fondo: #f4f4f5;
  --carta: #ffffff;
  --testo: #111113;
  --grigio: #71717a;
  --grigio-chiaro: #a1a1aa;
  --linea: rgba(17, 17, 19, 0.09);
  --accento: #3355e8;
  --accento-tenue: #e9eefd;
  --accento-medio: #c9d4fa;
  --errore: #dc2626;
  --fatto: #15803d;
  --w: min(392px, 90vw);
  --pad: min(22px, 3.4vh, 5.4vw);
  --gap: min(14px, 2.2vh);
}

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

html, body { height: 100%; }

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

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

/* ---------- the card ---------- */

.inv {
  position: relative;
  width: var(--w);
  background: var(--carta);
  border: 1px solid var(--linea);
  border-radius: 20px;
  padding: var(--pad);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.04), 0 18px 48px -18px rgba(17, 17, 19, 0.18);
}

.head { display: flex; flex-direction: column; gap: min(6px, 1vh); }

.ws {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--grigio);
  font-weight: 500;
}

.ws__mark { width: 15px; height: 15px; }
.ws__mark rect { fill: none; stroke: var(--accento); stroke-width: 1.6; }
.ws__mark rect + rect { fill: var(--accento-tenue); }
.ws__brand { color: var(--testo); font-weight: 600; }
.ws__sep { color: var(--grigio-chiaro); }

.title {
  font-size: min(21px, 3.6vh, 6vw);
  font-weight: 650;
  font-stretch: 105%;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.sub {
  font-size: 13px;
  color: var(--grigio);
  line-height: 1.35;
  min-height: 1.35em;
}

/* ---------- the field with the chips ---------- */

.box {
  position: relative;
  border: 1px solid var(--linea);
  border-radius: 12px;
  background: #fafafa;
  padding: 6px;
  min-height: 46px;
  cursor: text;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.box.is-focus {
  border-color: var(--accento);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(51, 85, 232, 0.12);
}

.box.is-error {
  border-color: var(--errore);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.input {
  flex: 1 0 120px;
  min-width: 0;
  height: 32px;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--testo);
  padding: 0 6px;
}

.input::placeholder { color: var(--grigio-chiaro); }
.input.is-error { color: var(--errore); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 4px 0 4px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--linea);
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.05);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  max-width: 100%;
  transform-origin: 0% 50%;
}

.chip.is-marked {
  border-color: var(--accento);
  background: var(--accento-tenue);
}

.chip__av {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--accento);
  background: var(--accento-tenue);
  box-shadow: inset 0 0 0 1px rgba(51, 85, 232, 0.14);
}

.chip__mail {
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.chip__x {
  flex: none;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--grigio-chiaro);
  transition: background 0.15s, color 0.15s;
}

.chip__x svg { width: 10px; height: 10px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; fill: none; }
.chip__x.is-hot, .chip__x:focus-visible { background: rgba(17, 17, 19, 0.07); color: var(--testo); outline: 0; }

@media (hover: hover) {
  .chip__x:hover { background: rgba(17, 17, 19, 0.07); color: var(--testo); }
}

.hint {
  margin-top: calc(var(--gap) * -0.55);
  font-size: 12px;
  color: var(--grigio);
  min-height: 1.3em;
  line-height: 1.3;
}

.hint.is-error { color: var(--errore); }

/* ---------- role ---------- */

.role {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.role__label { font-size: 13px; color: var(--grigio); }

.seg {
  position: relative;
  display: flex;
  padding: 3px;
  border-radius: 10px;
  background: #f1f1f3;
  box-shadow: inset 0 0 0 1px var(--linea);
}

.seg__pill {
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.08), 0 2px 8px -2px rgba(17, 17, 19, 0.12);
}

.seg__opt {
  position: relative;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--grigio);
  padding: 5px 13px;
  border-radius: 7px;
  cursor: pointer;
  transition: color 0.2s;
}

.seg__opt[aria-checked="true"] { color: var(--testo); }
.seg__opt:focus-visible { outline: 2px solid var(--accento); outline-offset: 1px; }

/* ---------- seats ---------- */

.seats { display: flex; flex-direction: column; gap: 7px; }

.seats__top {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--grigio);
}

.seats__count { font-variant-numeric: tabular-nums; color: var(--testo); }

.roll { display: inline-block; }

.seats__bar {
  position: relative;
  height: 4px;
  border-radius: 4px;
  background: #ececef;
  overflow: hidden;
}

.seats__pending, .seats__fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  border-radius: 4px;
  transform-origin: 0 50%;
}

.seats__pending { background: var(--accento-medio); }
.seats__fill { background: var(--accento); }

/* ---------- footer ---------- */

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: var(--gap);
  border-top: 1px solid var(--linea);
}

.stack { display: flex; align-items: center; min-height: 30px; }

.av {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 650;
  border: 2px solid #fff;
  margin-left: -5px;
  color: var(--accento);
  background: var(--accento-tenue);
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.08);
}

.av:first-child { margin-left: 0; }
.av--a { background: #111113; color: #fff; }
.av--b { background: #e4e4e7; color: #3f3f46; }

.send {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  min-width: 132px;
  padding: 0 16px;
  border: 0;
  border-radius: 11px;
  background: var(--testo);
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.2), 0 6px 16px -6px rgba(17, 17, 19, 0.35);
  transition: background 0.25s, color 0.25s, box-shadow 0.25s;
}

.send:disabled { background: #e4e4e7; color: var(--grigio-chiaro); cursor: default; box-shadow: none; }
.send.is-done { background: var(--fatto); }
.send:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }

.send__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.22) 50%, transparent 70%);
  transform: translateX(-120%);
  pointer-events: none;
}

.send__ring, .send__check { width: 16px; height: 16px; flex: none; display: none; }
.send__ring circle { fill: none; stroke: currentColor; stroke-width: 2; stroke-dasharray: 30 14; stroke-linecap: round; }
.send__check path { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }

.send__label { position: relative; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- the flying avatar and the drawn pointer ---------- */

.flyer {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 9.5px;
  font-weight: 650;
  color: var(--accento);
  background: var(--accento-tenue);
  box-shadow: 0 0 0 2px #fff, 0 6px 14px -4px rgba(51, 85, 232, 0.45);
  pointer-events: none;
  z-index: 5;
}

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

@media (max-height: 470px) {
  .sub { display: none; }
  .inv { gap: min(11px, 2vh); }
}
