/* The registration form (src/pages/[locale]/index.astro), from the T-Reds
   app, restyled after spazi4i.it: its cream, violet and light blue, Poppins
   headings, Source Sans text. Every class here is written by
   public/iscrizioni/modulo.js. The values are src/styles/tokens.css's: this
   page has its own styles, not the Tailwind build. Contrast is against
   white unless stated; the website's own violet (#6f76b9) is decoration
   only, never text. */
:root {
  --brand: #535cac; /* buttons, links, focus (6.0:1) */
  --brand-dark: #434989;
  --brand-light: #eeeff8;
  --violet: #6f76b9;
  --light-blue: #5ec7d1;
    --ink: #111827;
  --body: #374151;
  --muted: #4b5563;
  --control: #6b7280;
  --line: #e5e7eb;
  --canvas: #fbfbef;
  font-family: "Source Sans 3 Variable", "Source Sans Pro", system-ui, sans-serif;
  font-size: 17px;
  color: var(--ink);
  background: var(--canvas);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
h1,
h2,
h3,
.choice strong,
.total {
  font-family: Poppins, system-ui, sans-serif;
}

/* Notices under the header: the first one is also where the script says
   that the form is in trial mode. */
.demo {
  background: var(--brand-light);
  color: var(--ink);
  padding: 12px 24px;
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
}
#registrations-closed {
  background: #fdf9c4;
  font-weight: 600;
}

/* ── Layout ──────────────────────────────────────────────────────────── */
main {
  max-width: 1120px;
  margin: 32px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
}
.panel,
#summary {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.08);
  padding: 32px;
}
/* The website's form frame is light blue. */
.panel {
  border-top: 6px solid var(--light-blue);
}
#summary {
  align-self: start;
  position: sticky;
  top: 24px;
  padding: 25px;
  border-top: 6px solid var(--violet);
}
.progress {
  display: flex;
  gap: 5px;
  margin: 0 0 26px;
}
.progress span {
  height: 6px;
  flex: 1;
  background: var(--brand-light);
  border-radius: 3px;
}
.progress .on {
  background: var(--violet);
}

/* ── Text ────────────────────────────────────────────────────────────── */
.eyebrow {
  font-family: Poppins, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand);
  margin-bottom: 12px;
}
h1 {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 14px;
  letter-spacing: -0.02em;
}
h2 {
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 20px;
}
p {
  line-height: 1.6;
  color: var(--body);
}
a {
  color: var(--brand);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--brand-dark);
}
.note {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
}
.pill {
  display: inline-block;
  border-radius: 30px;
  background: var(--brand-light);
  color: var(--brand-dark);
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 18px;
}
.error {
  color: #b91c1c;
  font-size: 15px;
}

/* ── Choices and buttons ─────────────────────────────────────────────── */
.choices {
  display: grid;
  gap: 12px;
  margin: 24px 0;
}
button {
  font: inherit;
  cursor: pointer;
}
button.choice {
  padding: 20px;
  text-align: left;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  width: 100%;
  color: var(--ink);
}
.choice:hover {
  border-color: var(--violet);
  background: var(--brand-light);
}
.choice strong {
  font-size: 18px;
  font-weight: 600;
  display: block;
}
.choice small {
  font-size: 15px;
  color: var(--muted);
  display: block;
  margin-top: 8px;
  line-height: 1.5;
}
.primary {
  background: var(--brand);
  color: white;
  border: 0;
  border-radius: 6px;
  padding: 16px 24px;
  font-weight: 700;
  letter-spacing: 0.02em;
  width: 100%;
  margin-top: 16px;
}
.primary:hover {
  background: var(--brand-dark);
}
.back {
  border: 0;
  background: none;
  color: var(--brand);
  font-weight: 600;
  padding: 0;
  margin-bottom: 24px;
}

/* ── Fields ──────────────────────────────────────────────────────────── */
.radio {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 17px;
  display: flex;
  align-items: start;
  gap: 12px;
  margin: 12px 0;
  line-height: 1.5;
}
.radio:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-light);
}
input[type="radio"],
input[type="checkbox"] {
  width: 19px;
  height: 19px;
  accent-color: var(--brand);
  flex-shrink: 0;
}
select,
input:not([type="checkbox"]):not([type="radio"]) {
  font: inherit;
  width: 100%;
  border: 1px solid var(--control);
  border-radius: 6px;
  padding: 12px;
  background: white;
  color: var(--ink);
  margin-top: 8px;
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.fields label {
  font-size: 15px;
  font-weight: 600;
}
.wide {
  grid-column: 1 / -1;
}
.check {
  display: flex;
  gap: 10px;
  align-items: start;
  line-height: 1.5;
  margin: 18px 0;
}
details {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 17px;
  margin: 14px 0;
}
summary {
  font-weight: 700;
  cursor: pointer;
}
.legal {
  max-height: 420px;
  overflow: auto;
  padding: 12px 6px;
}
.legal h3 {
  font-size: 17px;
}
.legal p {
  font-size: 16px;
}

/* ── The summary ─────────────────────────────────────────────────────── */
.sumrow {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.5;
}
.total {
  font-weight: 700;
  font-size: 24px;
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  color: var(--ink);
}

/* ── The quality box, the certificate, the kit guide ─────────────────── */
.quality {
  margin: 0 0 24px;
  border: 2px solid var(--light-blue);
  border-radius: 8px;
  padding: 20px;
  background: #effafb;
  display: flow-root;
}
.quality .certificate {
  width: 150px;
  float: right;
  margin: 0 0 12px 18px;
}
.quality p {
  margin: 12px 0;
}
.quality h2 {
  margin-bottom: 10px;
}
.quality a {
  color: var(--brand);
  font-weight: 700;
}
.footprints {
  position: relative;
  aspect-ratio: 4 / 1;
  overflow: hidden;
  margin: 10px 0 24px;
  background: white;
  border-radius: 8px;
}
.footprints img {
  position: absolute;
  width: 100%;
  height: auto;
  top: -370%;
  left: 0;
}
.certificate {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 18px 0;
}
.kit-guide {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 18px 0;
}

/* ── Sent ────────────────────────────────────────────────────────────── */
.success {
  font-size: 64px;
  color: #15803d;
}
.confirmed {
  background: #f0fdf4;
}
.confirmed .panel,
.confirmed #summary {
  background: #f7fef9;
  border-color: #a2d8b3;
}
.confirmed .panel {
  border-top-color: #15803d;
}
.confirmed h1 {
  color: #146b38;
}
.confirmed .progress .on,
.confirmed .primary {
  background: #15803d;
}

@media (max-width: 760px) {
  main {
    grid-template-columns: 1fr;
    margin: 20px auto;
    padding: 0 16px;
    gap: 16px;
  }
  .panel {
    padding: 23px;
  }
  #summary {
    position: static;
  }
  .fields {
    grid-template-columns: 1fr;
  }
  h1 {
    font-size: 26px;
  }
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}
