:root {
  --page-bg: #363636;
  --bg: #454545;
  --text: #EDEDEC;
  --text-soft: #C8C8C6;
  --accent: #7957FF;
  --accent-soft: rgba(121, 87, 255, 0.18);
  --accent-text: #FFFFFF;
  --field-bg: #525252;
  --field-border: #666666;
  --error: #FF9A9A;

  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--text);
  font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-font-smoothing: antialiased;
}

.page {
  width: 100%;
  max-width: 560px;
  padding: 40px 20px 60px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
  text-align: center;
  align-items: center;
  animation: card-enter 0.5s var(--ease-out) forwards;
}

@keyframes card-enter {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }
}

h1 {
  font-size: 1.65rem;
  font-weight: 800;
  margin: 8px 0 12px;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 4px 0 10px;
  letter-spacing: -0.01em;
}

.benefit-heading {
  align-self: flex-start;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  margin: 14px 0 2px;
}

p { line-height: 1.6; margin: 6px 0; color: var(--text-soft); }

p strong { color: var(--text); }

.hint {
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Foto intatta: nessun ritaglio, nessuna distorsione, nessun overlay sopra —
   larghezza piena, altezza naturale in base al rapporto reale del file. */
.hero-mimmo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}

/* Forza lo stesso formato quadrato delle altre foto hero del sito (index e
   grazie), anche quando la sorgente non è quadrata: va bene se restano
   bande vuote o se l'immagine rimpicciolisce, l'importante è la coerenza
   di formato tra le pagine. */
.hero-mimmo-square {
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: contain;
  background: var(--bg);
}

.thumbs-badge {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

a { color: #A995FF; }

.benefit-list {
  list-style: none;
  margin: 8px 0 4px;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.benefit-list li {
  position: relative;
  padding: 12px 16px 12px 44px;
  background: var(--field-bg);
  border-radius: var(--radius-md);
  color: var(--text-soft);
  line-height: 1.5;
}

.benefit-list li::before {
  content: "✓";
  position: absolute;
  left: 14px;
  top: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 0.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.field-label {
  font-size: 1.05rem;
  margin: 16px 0 6px;
  font-weight: 700;
  color: var(--text);
}

input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 14px 16px;
  background: var(--field-bg);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  margin: 4px 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--field-bg);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.2s var(--ease-out), transform 0.15s var(--ease-out), background 0.2s ease;
  margin: 12px 0 4px;
}

.choice:hover {
  transform: translateY(-1px);
  background: #585858;
}

.choice:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.choice input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin: 0;
  flex-shrink: 0;
  border: 2px solid var(--field-border);
  background: var(--field-bg);
  border-radius: 7px;
  cursor: pointer;
  display: inline-grid;
  place-content: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.choice input[type="checkbox"]::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent-text);
  transform: scale(0);
  transition: transform 0.15s var(--ease-out);
}

.choice input:checked {
  border-color: var(--accent);
  background: var(--accent);
}

.choice input:checked::after {
  transform: scale(1);
}

.choice input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.choice span { font-size: 0.9rem; color: var(--text-soft); }

.error-msg {
  color: var(--error);
  font-size: 0.85rem;
  min-height: 1em;
  margin: 2px 0 0;
}

button, .btn-main, .btn-skip {
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 16px 28px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: transform 0.15s var(--ease-out), filter 0.15s ease, box-shadow 0.15s ease;
}

/* .btn-main può essere anche un <a> (link diretto al quiz): serve lo stesso
   box di un bottone (display, allineamento testo) che un <a> non ha di suo. */
a.btn-main {
  display: block;
  text-decoration: none;
  text-align: center;
  box-sizing: border-box;
}

.btn-main {
  background: var(--accent);
  color: var(--accent-text);
  margin-top: 22px;
  width: 100%;
  box-shadow: 0 8px 20px rgba(121, 87, 255, 0.35);
}

.btn-main:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(121, 87, 255, 0.45);
}

.btn-main:active { transform: translateY(0) scale(0.98); }

.btn-main:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: transparent;
  color: var(--text-soft);
  border: 2px solid var(--field-border);
}

.btn-secondary:hover {
  border-color: var(--text-soft);
  color: var(--text);
}

.status-msg {
  min-height: 1.2em;
  font-size: 0.9rem;
  margin-top: 10px;
}

.status-msg.error { color: var(--error); }
.status-msg.success { color: #A6E3A1; }

/* Bottone secondario "ghost": stessa forma a pillola del primario, ma vuoto
   dentro (bordo colorato, sfondo trasparente) così l'occhio va comunque
   prima sul bottone pieno. */
.btn-skip {
  background: transparent;
  border: 2px solid var(--field-border);
  color: var(--text-soft);
  width: 100%;
  margin-top: 12px;
  box-shadow: none;
}

.btn-skip:hover {
  border-color: var(--text-soft);
  color: var(--text);
}

.btn-skip:active { transform: scale(0.98); }

a.btn-skip {
  display: block;
  text-decoration: none;
  text-align: center;
  box-sizing: border-box;
}

.fork-question {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 18px 0 20px;
}

@media (max-width: 480px) {
  .card { padding: 28px 20px; border-radius: var(--radius-md); }
}

/* Blocco del quiz nella pagina "grazie": stessa spaziatura della card; nascosto se il quiz e' gia' stato compilato. */
#quizInvite { display: flex; flex-direction: column; gap: 8px; }
[hidden] { display: none !important; }

/* Campo trappola antispam: fuori schermo, invisibile alle persone. */
.hp-field { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
