/* ==========================================================================
   facile626 — Landing Alta Stagione
   Mobile-first. Font di sistema, nessuna dipendenza esterna.
   ========================================================================== */

:root {
  --red: #B03A38;
  --red-dark: #8E2E2C;
  --text: #1A1A1A;
  --muted: #5A5A5A;
  --bg: #FFFFFF;
  --bg-alt: #FAF7F6;
  --green: #2E7D32;
  --yellow: #ED9C28;
  --red-status: #C62828;
  --border: #E7DEDD;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(26, 16, 15, 0.06);
  --shadow-md: 0 10px 24px rgba(26, 16, 15, 0.08);
  --shadow-lg: 0 24px 56px rgba(26, 16, 15, 0.20);
}

* { box-sizing: border-box; }

/* L'attributo [hidden] deve sempre vincere: senza questa regola, elementi con
   classi che impostano `display` (es. .btn { display: inline-flex }) restano
   visibili nonostante hidden, perché a parità di specificità l'ultima regola
   dichiarata nel foglio di stile sovrascrive lo user-agent stylesheet. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.6em; }
p { margin: 0 0 1em; }
a { color: var(--red); }
a:hover { color: var(--red-dark); }

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

/* ---------------------------------------------------------------- Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.btn--primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 6px 16px rgba(176, 58, 56, 0.28);
}
.btn--primary:hover { background: var(--red-dark); box-shadow: 0 8px 20px rgba(142, 46, 44, 0.32); }
.btn--primary:active { transform: translateY(1px); box-shadow: 0 3px 10px rgba(142, 46, 44, 0.28); }
.btn--primary:disabled,
.btn--primary[disabled] {
  background: var(--muted);
  cursor: not-allowed;
  opacity: 0.7;
  box-shadow: none;
}

.btn--ghost {
  background: transparent;
  border-color: var(--muted);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--text); }

/* Stesso peso visivo di .btn--primary (pieno, stesse dimensioni): usato per
   "Rifiuta" nel banner cookie, che per normativa non deve risultare meno
   prominente di "Accetta". */
.btn--neutral {
  background: var(--text);
  color: #fff;
}
.btn--neutral:hover { background: #000; }

.btn--text {
  background: none;
  border: none;
  color: var(--muted);
  min-height: 44px;
  padding: 8px 4px;
  text-decoration: underline;
}
.btn--text:hover { color: var(--text); }

.btn--large { width: 100%; font-size: 17px; padding: 14px 24px; }

.btn--loading { opacity: 0.75; }

/* ---------------------------------------------------------- Cookie banner */

.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1000;
  background: var(--bg);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
  padding: 16px 20px;
}

.cookie-banner__body {
  max-width: 640px;
  margin: 0 auto;
}

.cookie-banner__text {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
}

.cookie-banner__actions {
  display: flex;
  gap: 12px;
}

.cookie-banner__actions .btn {
  flex: 1;
  min-height: 48px;
}

/* ------------------------------------------------------------------- Hero */

.hero {
  background: var(--bg-alt);
  padding: 40px 0 0;
  text-align: center;
  overflow: hidden;
}

.hero__inner {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.hero h1 {
  font-size: 28px;
  letter-spacing: -0.01em;
  color: var(--text);
}

.hero__subtitle {
  font-size: 17px;
  color: var(--muted);
  margin-bottom: 1.5em;
}

.micro-reassurance {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

/* Leggero effetto di richiamo sul CTA principale: rimane fermo la maggior
   parte del ciclo e oscilla appena per 1-2 secondi, non un'animazione
   continua invadente. In pausa su hover/focus per non disturbare l'input. */
@keyframes cta-rock {
  0%, 82%, 100% { transform: rotate(0deg); }
  85% { transform: rotate(-2deg); }
  88% { transform: rotate(2deg); }
  91% { transform: rotate(-1.5deg); }
  94% { transform: rotate(1deg); }
  97% { transform: rotate(0deg); }
}

#cta-start {
  transform-origin: 50% 100%;
  animation: cta-rock 5s ease-in-out infinite;
}
#cta-start:hover,
#cta-start:focus-visible {
  animation-play-state: paused;
}

.hero__media {
  position: relative;
  padding: 0 20px 40px;
  margin: 0 auto;
  max-width: 420px;
  width: 100%;
}

.hero__media::before {
  content: "";
  position: absolute;
  inset: 14px -10px -26px 26px;
  background: var(--red);
  border-radius: var(--radius-lg);
  z-index: 0;
}

.hero__media picture {
  position: relative;
  z-index: 1;
  display: block;
}

.hero__image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 25%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* ------------------------------------------------------------------- Pain */

.pain {
  padding: 40px 0;
}

.pain h2 {
  font-size: 22px;
}

.pain p {
  color: var(--muted);
  font-size: 16px;
}

.pain__highlight {
  color: var(--text);
  font-weight: 700;
  font-size: 18px;
  border-left: 4px solid var(--red);
  padding-left: 14px;
  margin-top: 1.5em;
}

/* ------------------------------------------------------------------- Quiz */

.quiz-section {
  padding: 32px 0 40px;
  background: var(--bg-alt);
}

.quiz-intro {
  color: var(--muted);
  font-size: 15px;
}

.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 24px;
}

.progress-bar__fill {
  height: 100%;
  background: var(--red);
  width: 0%;
  transition: width 0.25s ease;
}

.quiz-card-wrap {
  position: relative;
}

.quiz-back {
  position: absolute;
  top: -14px;
  left: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.quiz-back:hover { border-color: var(--red); color: var(--red); transform: translateX(-2px); }

.quiz-container {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.quiz-question__label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4em;
}

.quiz-question__title {
  font-size: 19px;
  margin-bottom: 1em;
}

.quiz-options {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-option {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease,
    transform 0.15s ease, box-shadow 0.15s ease;
}

.quiz-option:hover { border-color: var(--red); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.quiz-option:disabled { cursor: default; }

.quiz-option[aria-pressed="true"] {
  border-color: var(--red);
  background: var(--bg-alt);
  font-weight: 700;
  transform: none;
}

/* --------------------------------------------------------------- Contact */

.contact-section {
  padding: 40px 0;
}

.contact-section h2 {
  font-size: 22px;
}

.form-field {
  margin-bottom: 18px;
}

.form-field label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}

.form-field .optional {
  font-weight: 400;
  color: var(--muted);
}

.form-field input,
.form-field select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  font-size: 16px;
  font-family: inherit;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}

.form-field input:focus,
.form-field select:focus {
  border-color: var(--red);
}

.form-field--checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.form-field--checkbox input {
  width: 22px;
  height: 22px;
  min-height: 22px;
  flex-shrink: 0;
  margin-top: 2px;
}

.form-field--checkbox label {
  font-weight: 400;
  font-size: 14px;
  margin-bottom: 0;
}

.field-error {
  color: var(--red-status);
  font-size: 13px;
  margin: 6px 0 0;
  min-height: 1em;
}
.field-error:empty { display: none; }

.form-general-error {
  color: var(--red-status);
  background: #FCEBEA;
  border: 1px solid var(--red-status);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 16px;
}

/* --------------------------------------------------------- Result / TY page */

.result-section {
  padding: 32px 0 20px;
  background: var(--bg-alt);
}

.result-title {
  font-size: 22px;
}

.result-text {
  color: var(--muted);
  font-size: 15px;
}

.semaphore-list {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.semaphore-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.semaphore-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.semaphore-dot--verde { background: var(--green); }
.semaphore-dot--giallo { background: var(--yellow); }
.semaphore-dot--rosso { background: var(--red-status); }

.result-bridge {
  font-weight: 600;
  margin-top: 16px;
}

/* -------------------------------------------------------------- Final CTA */

.final-cta {
  padding: 28px 0 36px;
  text-align: center;
}

.final-cta h2 { font-size: 24px; }

#whatsapp-cta-wrap { margin-top: 16px; }

.whatsapp-fallback-note {
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
}

/* Verde WhatsApp: riconoscibile come azione "scrivimi", coerente con
   l'identità del canale su cui l'utente sta per essere indirizzato. */
.btn--whatsapp {
  background: #25D366;
  color: #fff;
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.32);
}
.btn--whatsapp:hover { background: #1DA851; box-shadow: 0 8px 20px rgba(29, 168, 81, 0.36); }
.btn--whatsapp:active { transform: translateY(1px); box-shadow: 0 3px 10px rgba(29, 168, 81, 0.3); }
.btn--whatsapp:disabled,
.btn--whatsapp[disabled] {
  background: var(--muted);
  cursor: not-allowed;
  opacity: 0.7;
  box-shadow: none;
}

/* ------------------------------------------------------------------ Footer */

.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
  text-align: center;
}

.footer-logo-img {
  display: block;
  height: 36px;
  width: auto;
  margin: 0 auto 14px;
}

.site-footer p {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 6px;
}

.footer-legal {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
}

/* ------------------------------------------------------------- Breakpoint */

@media (min-width: 768px) {
  .container { max-width: 720px; }

  .hero { padding: 64px 0 48px; }
  .hero h1 { font-size: 38px; }
  .hero__subtitle { font-size: 19px; }

  .hero__inner {
    max-width: 980px;
    flex-direction: row;
    align-items: center;
    gap: 48px;
    text-align: left;
  }
  .hero__content { flex: 1 1 52%; }
  .hero__media {
    flex: 1 1 44%;
    max-width: 380px;
    padding: 0;
  }

  .pain h2 { font-size: 28px; }

  .btn--large { width: auto; }

  .cookie-banner__body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    max-width: 900px;
  }
  .cookie-banner__text { margin-bottom: 0; }
  .cookie-banner__actions { flex-shrink: 0; }
  .cookie-banner__actions .btn { flex: none; min-width: 130px; }
}

@media (min-width: 1024px) {
  .hero__inner { max-width: 1080px; gap: 64px; }
  .hero h1 { font-size: 42px; }
  .hero__media { max-width: 440px; }
}

/* Va dichiarato per ultimo: a parità di specificità, le regole `transition`
   di .btn/.quiz-option dichiarate sopra vincerebbero altrimenti sulla
   cascata anche quando l'utente ha richiesto meno movimento. */
@media (prefers-reduced-motion: reduce) {
  .btn,
  .quiz-option,
  .quiz-back,
  .progress-bar__fill {
    transition: none;
  }
  #cta-start {
    animation: none;
  }
}
