/* PROGOL3D – registrazione evento */
:root {
  --ink: #1d1d1b;
  --ink-soft: #4a4a48;
  --red: #c8102e;          /* rosso brand, contrasto 5.9:1 su bianco */
  --red-dark: #9e0c24;
  --line: #d4d4d2;
  --paper: #ffffff;
  --paper-soft: #f6f6f4;
  --focus: #1a5fd0;
  --ok: #1e6b3a;
  --radius: 10px;
  --font: "Avenir Next", "Montserrat", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background-color: #000;   /* fallback finché non c'è l'immagine di sfondo */
  /* Immagine di sfondo a tutta pagina: caricare il file in assets/bg.jpg (se manca resta il nero) */
  background-image: linear-gradient(rgba(20, 20, 20, .35), rgba(20, 20, 20, .35)), url("bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
}

/* iOS non supporta background-attachment: fixed */
@supports (-webkit-touch-callout: none) {
  body { background-attachment: scroll; }
}

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 6px;
}
.skip:focus { top: 1rem; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

a { color: var(--red-dark); text-underline-offset: 2px; }
a:hover { color: var(--ink); }

.page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(16px, 5vw, 64px) 16px;
}

.card {
  width: 100%;
  max-width: 760px;
  background: rgba(255, 255, 255, .97);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
  padding: clamp(20px, 5vw, 56px);
}

/* Hero */
.hero { text-align: center; }
.logo { margin: 0; }
.logo img { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto; }
.edition {
  margin: .75rem 0 0;
  font-size: .8rem; letter-spacing: .3em; text-transform: uppercase; color: var(--ink-soft);
}
.event-meta {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 2.5rem;
  margin: 1.5rem 0 0; padding: 1rem 0; border-block: 1px solid var(--line);
}
.event-meta div { text-align: center; }
.event-meta dt { font-size: .75rem; letter-spacing: .15em; text-transform: uppercase; color: var(--ink-soft); }
.event-meta dd { margin: .15rem 0 0; font-weight: 600; }

/* Foto sotto l'intestazione */
.photo { margin: 1.75rem 0 0; }
.photo img { display: block; width: 100%; height: auto; border-radius: var(--radius); }

.intro { margin-top: 1.75rem; }
.intro p { margin: 0 0 .9rem; }
.en { color: var(--ink-soft); }
p.en, span.en { font-size: .94em; }
.cta { font-weight: 700; color: var(--red-dark); }
.cta span { display: block; font-weight: 600; color: var(--ink-soft); }

/* Form */
.reg-form { margin-top: 2rem; }
.req-note { font-size: .9rem; color: var(--ink-soft); margin: 0 0 1.25rem; }
.req { color: var(--red); font-weight: 700; }
.opt { font-weight: 400; color: var(--ink-soft); font-size: .9em; }

.grid-2 { display: grid; gap: 0 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 600px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.field { margin: 0 0 1.4rem; }
fieldset.field { border: 0; padding: 0; min-width: 0; }
.field > label, legend { display: block; font-weight: 600; margin-bottom: .4rem; padding: 0; }
.field > label .en, legend .en { display: block; font-weight: 400; font-size: .88em; }
.hint { margin: -.2rem 0 .45rem; font-size: .9rem; color: var(--ink-soft); }

input[type="text"], input[type="email"], input[type="number"], input[type="password"], input[type="search"], select, textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid #8a8a88;   /* 3.4:1 contro bianco – WCAG 1.4.11 */
  border-radius: 8px;
  padding: .7rem .85rem;
  min-height: 48px;
}
input:hover, select:hover { border-color: var(--ink); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--focus); outline-offset: 0; }
.narrow input { max-width: 9rem; }

.choices { display: grid; gap: .35rem; }
.choice {
  display: flex; gap: .7rem; align-items: flex-start;
  padding: .55rem .7rem; border-radius: 8px; cursor: pointer;
}
.choice:hover { background: var(--paper-soft); }
.choice input { width: 1.3rem; height: 1.3rem; margin: .15rem 0 0; flex: none; accent-color: var(--red); }
.choice .en { display: block; margin-top: .2rem; }

.other-wrap { margin: .5rem 0 0 2.7rem; }
.js .other-wrap[data-hidden] { display: none; }

.consent { background: var(--paper-soft); border-radius: var(--radius); padding: 1rem !important; }
.consent legend { float: left; width: 100%; margin-bottom: .5rem; }
.consent legend + * { clear: both; }
.consent .choice { font-size: .95rem; }

/* Errori */
.has-error input[type="text"], .has-error input[type="email"], .has-error input[type="number"] {
  border-color: var(--red); border-width: 2px;
}
.field-error {
  margin: 0 0 .4rem; color: var(--red-dark); font-weight: 600; font-size: .92rem;
}
.field-error::before { content: "⚠ "; }
.error-summary {
  border: 3px solid var(--red); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.5rem;
}
.error-summary h2 { margin: 0 0 .5rem; font-size: 1.1rem; }
.error-summary ul { margin: 0; padding-left: 1.2rem; }
.error-summary a { color: var(--red-dark); font-weight: 600; }

/* Honeypot anti-spam */
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.actions { margin-top: 1.75rem; }
.btn {
  appearance: none; border: 0; cursor: pointer;
  font: inherit; font-weight: 700; letter-spacing: .04em;
  background: var(--red); color: #fff;
  padding: .95rem 2rem; border-radius: 999px; min-height: 48px;
  width: 100%;
}
@media (min-width: 600px) { .btn { width: auto; } }
.btn:hover { background: var(--red-dark); }
.btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.btn span { font-weight: 400; }

.done { margin-top: 2rem; text-align: center; }
.done h2 { color: var(--ok); margin: 0 0 .25rem; }
.done h2:focus { outline: none; }

.site-footer {
  margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line);
  font-size: .85rem; color: var(--ink-soft); text-align: center;
}

/* Pagina informativa */
.legal h1 { font-size: 1.6rem; margin: 1.5rem 0 .5rem; }
.legal h2 { font-size: 1.15rem; margin: 1.75rem 0 .4rem; }
.legal p, .legal li { font-size: 1rem; }
.legal hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

@media print {
  body { background: #fff; }
  .card { box-shadow: none; }
}
