/* facile626 — Landing Ferie — style.css
   Mobile-first. Font di sistema, nessuna dipendenza esterna. */

:root {
  --color-primary: #B03A38;
  --color-primary-hover: #8E2E2C;
  --color-primary-tint: #F7E8E7;
  --color-primary-ring: rgba(176, 58, 56, 0.35);
  --color-text: #1A1A1A;
  --color-text-muted: #5A5A5A;
  --color-text-subtle: #6E6462;
  --color-bg: #FFFFFF;
  --color-bg-alt: #FAF7F6;
  --color-border: #E7DEDD;
  --color-border-strong: #D8CBC9;
  --color-verde: #2E7D32;
  --color-verde-bg: #EAF4EA;
  --color-giallo: #ED9C28;
  --color-giallo-bg: #FFF4E5;
  --color-rosso: #C62828;
  --color-whatsapp: #0F7A40;
  --color-whatsapp-hover: #0C6435;
  --color-rosso-bg: #FBEAEA;

  --font-system: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;

  --shadow-xs: 0 1px 2px rgba(26, 15, 15, 0.06);
  --shadow-sm: 0 2px 10px rgba(26, 15, 15, 0.07);
  --shadow-md: 0 10px 28px rgba(26, 15, 15, 0.10);
  --shadow-primary: 0 8px 20px rgba(176, 58, 56, 0.22);
  --shadow-primary-hover: 0 12px 28px rgba(142, 46, 44, 0.28);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-base: 220ms;

  --max-width: 640px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-system);
  font-size: 16px;
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  font-weight: 700;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--color-primary);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

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

main {
  display: block;
}

.section {
  padding: 2.75rem 1.25rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Percorso post-quiz (esito → contatto WhatsApp): più compatto degli altri,
   l'utente ha già investito tempo nel quiz e va portato rapidamente al
   contatto. */
.section--result {
  padding-top: 1.75rem;
  padding-bottom: 1.75rem;
}

.section--result h2 {
  margin-bottom: 0.4em;
}

.section--pain,
.section--result {
  background: var(--color-bg-alt);
  max-width: none;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.section--pain > *,
.section--result > * {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

/* Motion — reveal animations tied to real state changes (quiz step advance,
   post-form reveal). Kept purposeful, not decorative on every element. */

@keyframes f626-reveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes f626-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.quiz-question:not([hidden]),
#contactSection:not([hidden]),
#resultSection:not([hidden]),
#thankyouReady:not([hidden]),
#thankyouFallback:not([hidden]) {
  animation: f626-reveal var(--duration-base) var(--ease-out) both;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 48px;
  padding: 0.85em 1.4em;
  border-radius: var(--radius);
  border: 2px solid transparent;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  text-decoration: none;
  touch-action: manipulation;
  box-shadow: var(--shadow-xs);
  transition: background-color var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}

@keyframes f626-rock {
  0%, 88%, 100% { transform: rotate(0deg); }
  90% { transform: rotate(-2.5deg); }
  92.5% { transform: rotate(2deg); }
  95% { transform: rotate(-1.25deg); }
  97.5% { transform: rotate(1deg); }
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
  transform-origin: 50% 100%;
  animation: f626-rock 4.5s ease-in-out infinite;
}

.btn--primary:hover,
.btn--primary:focus-visible,
.btn--primary:active {
  animation-play-state: paused;
}

.btn--primary:hover {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-primary-hover);
  transform: translateY(-1px);
}

.btn--primary:active {
  transform: translateY(0) scale(0.98);
  box-shadow: var(--shadow-xs);
}

.btn--whatsapp {
  background: var(--color-whatsapp);
  color: #fff;
  box-shadow: 0 8px 20px rgba(15, 122, 64, 0.32);
  transform-origin: 50% 100%;
  animation: f626-rock 4.5s ease-in-out infinite;
}

.btn--whatsapp:hover,
.btn--whatsapp:focus-visible,
.btn--whatsapp:active {
  animation-play-state: paused;
}

.btn--whatsapp:hover {
  background: var(--color-whatsapp-hover);
  box-shadow: 0 12px 28px rgba(12, 100, 53, 0.38);
  transform: translateY(-1px);
}

.btn--whatsapp:active {
  transform: translateY(0) scale(0.98);
  box-shadow: var(--shadow-xs);
}

.btn__icon {
  flex-shrink: 0;
}

.btn--ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
  box-shadow: none;
}

.btn--ghost:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-bg-alt);
}

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

.btn--large {
  width: 100%;
  font-size: 1.05rem;
  padding: 1em 1.4em;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Hero */

.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 3.25rem 1.25rem 2.75rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero::before {
  content: "";
  position: absolute;
  top: -140px;
  left: 50%;
  width: 640px;
  height: 320px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(176, 58, 56, 0.09), transparent 75%);
  pointer-events: none;
  z-index: 0;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero__photo {
  display: block;
  width: 100%;
  height: auto;
  max-width: 420px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: 50% 22%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin: 1.1em auto 1.75em;
}

.hero__title {
  font-size: clamp(1.75rem, 1.35rem + 2vw, 2.75rem);
  font-weight: 700;
}

.hero__subtitle {
  color: var(--color-text-muted);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.15rem);
}

.hero__reassurance {
  color: var(--color-text-subtle);
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  margin-top: 0.85em;
}

/* Pain section */

.pain-highlight {
  font-weight: 700;
  border-left: 3px solid var(--color-primary);
  padding-left: 0.9em;
}

/* Quiz */

.quiz-intro p {
  text-align: center;
  color: var(--color-text-muted);
}

.quiz-progress {
  height: 8px;
  background: var(--color-border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.6em;
}

.quiz-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-hover));
  width: 16.6%;
  border-radius: inherit;
  transition: width var(--duration-base) var(--ease-out);
}

.quiz-step-label {
  color: var(--color-text-subtle);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  margin-bottom: 1.6em;
}

.quiz-question legend {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 0;
  margin-bottom: 1.1em;
  text-wrap: balance;
}

.quiz-question {
  border: 0;
  padding: 0;
  margin: 0 0 1.5em;
}

.answer-options {
  display: grid;
  gap: 0.65em;
}

.answer-card {
  display: flex;
  align-items: center;
  gap: 0.75em;
  min-height: 48px;
  padding: 0.9em 1.05em;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--duration-base) var(--ease-out),
              background-color var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}

.answer-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.answer-card:active {
  transform: scale(0.99);
}

.answer-card input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: var(--color-primary);
  flex-shrink: 0;
}

.answer-card:has(input:checked) {
  border-color: var(--color-primary);
  background: var(--color-primary-tint);
  box-shadow: var(--shadow-sm);
}

.answer-card:has(input:focus-visible) {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

#quizBackBtn {
  margin-top: 0.5em;
}

/* Form */

.form-field {
  margin-bottom: 1.3em;
}

.form-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4em;
}

.form-field input[type="text"],
.form-field input[type="tel"],
.form-field input[type="email"],
.form-field select {
  width: 100%;
  min-height: 48px;
  font-size: 1rem;
  font-family: inherit;
  padding: 0.6em 0.8em;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
}

.form-field select {
  appearance: none;
  cursor: pointer;
  padding-right: 2.6em;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%235A5A5A' d='M5.5 7.5l4.5 4.5 4.5-4.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9em center;
  background-size: 14px;
}

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

.form-field input:focus,
.form-field select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-ring);
}

.form-field--checkbox label {
  display: flex;
  align-items: flex-start;
  gap: 0.6em;
  font-weight: 400;
  cursor: pointer;
}

.form-field--checkbox input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  accent-color: var(--color-primary);
  flex-shrink: 0;
  cursor: pointer;
}

.field-error {
  display: block;
  color: var(--color-rosso);
  font-size: 0.85rem;
  margin-top: 0.4em;
  min-height: 1em;
}

.field-error:not(:empty) {
  animation: f626-reveal var(--duration-fast) var(--ease-out) both;
}

/* Result / semaforo */

.result-urgenza,
.result-callout {
  background: var(--color-giallo-bg);
  border-left: 3px solid var(--color-giallo);
  padding: 0.9em 1.05em;
  border-radius: var(--radius-sm);
}

.semaforo-grid {
  list-style: none;
  margin: 0 0 1.5em;
  padding: 0;
  display: grid;
  gap: 0.6em;
}

.semaforo-grid li {
  display: flex;
  align-items: center;
  gap: 0.75em;
  padding: 0.75em 1em;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  animation: f626-reveal var(--duration-base) var(--ease-out) both;
}

.semaforo-grid li:nth-child(1) { animation-delay: 0ms; }
.semaforo-grid li:nth-child(2) { animation-delay: 40ms; }
.semaforo-grid li:nth-child(3) { animation-delay: 80ms; }
.semaforo-grid li:nth-child(4) { animation-delay: 120ms; }
.semaforo-grid li:nth-child(5) { animation-delay: 160ms; }
.semaforo-grid li:nth-child(6) { animation-delay: 200ms; }

.semaforo-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px var(--dot-ring, transparent);
}

.semaforo-dot--verde { background: var(--color-verde); --dot-ring: var(--color-verde-bg); }
.semaforo-dot--giallo { background: var(--color-giallo); --dot-ring: var(--color-giallo-bg); }
.semaforo-dot--rosso { background: var(--color-rosso); --dot-ring: var(--color-rosso-bg); }

.result-bridge {
  font-weight: 600;
}

/* Schedule / contatto */

.schedule-subtitle {
  color: var(--color-text-muted);
  margin-top: 1.3em;
}

.schedule-note {
  color: var(--color-text-subtle);
  font-size: 0.88rem;
  text-align: center;
  margin-top: 0.85em;
}

.schedule-status {
  text-align: center;
  min-height: 1.2em;
  font-size: 0.95rem;
}

.schedule-status[data-state="error"] {
  color: var(--color-rosso);
}

.schedule-status[data-state="pending"] {
  color: var(--color-text-muted);
  animation: f626-pulse 1.2s ease-in-out infinite;
}

/* Cookie banner */

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  background: var(--color-bg);
  border-top: 2px solid var(--color-border);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-md);
}

.cookie-banner__text {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 0 0 0.85em;
}

.cookie-banner__actions {
  display: flex;
  gap: 0.75em;
}

.cookie-banner__actions .btn {
  flex: 1;
}

/* Footer */

.site-footer {
  text-align: center;
  padding: 2.75rem 1.25rem;
  color: var(--color-text-subtle);
  font-size: 0.85rem;
  border-top: 1px solid var(--color-border);
}

.site-footer__logo {
  max-width: 180px;
  height: auto;
  margin-bottom: 1em;
}

.site-footer__logo-fallback:not([hidden]) {
  display: block;
  font-weight: 700;
  color: var(--color-primary);
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  margin-bottom: 1em;
}

.site-footer a {
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--duration-base) var(--ease-out);
}

.site-footer a:hover {
  color: var(--color-primary);
}

/* Thank you page */

.thankyou {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3.75rem 1.25rem;
  text-align: center;
}

.thankyou h1 {
  font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
}

/* Legal stub pages */

.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.75rem 1.25rem;
}

.legal-page h2 {
  font-size: 1.15rem;
  margin-top: 1.5em;
}

.cookie-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5em;
  font-size: 0.9rem;
}

.cookie-table th,
.cookie-table td {
  text-align: left;
  padding: 0.6em;
  border: 1px solid var(--color-border);
  vertical-align: top;
}

.cookie-table th {
  background: var(--color-bg-alt);
}

/* Desktop */

@media (min-width: 768px) {
  .hero {
    padding: 5.5rem 1.25rem 4rem;
  }

  .hero__photo {
    max-width: 520px;
  }

  .section {
    padding: 4rem 1.25rem;
  }

  .section--result {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }

  .btn--large {
    width: auto;
  }

  .answer-options {
    grid-template-columns: 1fr 1fr;
  }
}
