/* PALETTE NATURANIMALI (HEX forniti da Simone, 2026-07-11).
   NB: i nomi delle variabili sono quelli originali di TIUC (--blu, --terracotta)
   per non riscrivere tutte le decine di riferimenti: ora CONTENGONO i colori
   Naturanimali. --blu = arancione/rust primario del brand.
   Se preferisci il verde salvia come accento dominante al posto del rust, basta
   scambiare i valori di --blu e --salvia. */
:root {
  --blu: #AF5021;        /* accento primario (arancione/rust brand): bordi selezionati, icone, progresso */
  --terracotta: #E8C285; /* accento caldo secondario (oro/sabbia) */
  --crema: #F5F5F0;      /* base chiara (crema) */
  --salvia: #9EA788;     /* verde salvia del brand (tinte morbide) */
  --cta: #F76F08;        /* arancione CTA (bottone azione) */
  --cta-hover: #FF9D01;
  --text: #3A342E;       /* testo: marrone caldo scuro */
  --footer: #87796E;     /* testo secondario / footer */
  --white: #FFFFFF;
}

* { box-sizing: border-box; }

/* Font: titoli in Libre Franklin (fallback Montserrat), testo in Montserrat.
   Il body imposta Montserrat globale (sotto); qui i titoli usano Libre Franklin. */
.step-title, h1, h2, h3 {
  font-family: "Libre Franklin", "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(60% 50% at 85% 0%, rgba(232, 194, 133, 0.10), transparent 70%),
    radial-gradient(70% 55% at 10% 100%, rgba(175, 80, 33, 0.08), transparent 70%),
    linear-gradient(180deg, var(--crema) 0%, var(--white) 45%, var(--salvia) 100%);
  background-attachment: fixed;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 560px;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.92) 100%);
  box-shadow: 0 24px 60px -20px rgba(175, 80, 33, 0.25);
}

@media (min-width: 600px) {
  html, body { padding: 24px 0; }
  .app {
    min-height: calc(100vh - 48px);
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.6);
  }
}

.app-header {
  padding: 20px 24px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.logo {
  height: 62px;
  object-fit: contain;
}

.header-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Angie e Pamelo insieme nel prato (un'unica illustrazione), presente in
   ogni pagina tranne l'intro che ne mostra una versione piu' grande. */
.header-scene {
  display: flex;
  justify-content: center;
}
.header-scene[hidden] {
  display: none;
}
.header-scene .duo-scene {
  height: 62px;
  width: auto;
  display: block;
}

/* teste ritagliate (tondini nei pulsanti e nell'angolo) */
.head-thumb {
  display: inline-block;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--white), var(--crema));
  box-shadow: inset 0 0 0 1px rgba(175, 80, 33, 0.08), 0 2px 6px rgba(175, 80, 33, 0.12);
  overflow: hidden;
  flex: 0 0 auto;
}
.head-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@keyframes float-up {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(-60px) scale(1); opacity: 0; }
}

/* --- intro: Angie e Pamelo nel prato, in grande --- */

.intro-scene {
  display: flex;
  justify-content: center;
  position: relative;
}
.intro-scene::before {
  content: "";
  position: absolute;
  inset: -10% 10% auto 10%;
  height: 70%;
  background: radial-gradient(closest-side, rgba(245, 245, 240, 0.9), rgba(245, 245, 240, 0));
  z-index: 0;
}
.intro-scene .duo-scene {
  width: 100%;
  max-width: 380px;
  height: auto;
  display: block;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 18px 24px rgba(175, 80, 33, 0.16));
}

/* --- risultato: la stessa scena, piu' piccola, sopra l'esito --- */

.result-mascot {
  position: relative;
  text-align: center;
  margin-bottom: 12px;
}
.result-mascot .duo-scene {
  width: 100%;
  max-width: 280px;
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 14px 18px rgba(175, 80, 33, 0.14));
}
.result-mascot .spark {
  position: absolute;
  font-size: 20px;
  animation: float-up 1.6s ease-out infinite;
}
.result-mascot .spark:nth-child(2) { left: 20%; top: 30%; animation-delay: 0.2s; }
.result-mascot .spark:nth-child(3) { left: 74%; top: 22%; animation-delay: 0.6s; }
.result-mascot .spark:nth-child(4) { left: 50%; top: 12%; animation-delay: 1s; }

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(158, 167, 136, 0.6);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--blu); /* AF5021: parte percorsa in tinta unita rust */
  border-radius: 999px;
  transition: width 0.3s ease;
}

.app-main {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.app-footer {
  padding: 16px 24px 28px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.btn {
  flex: 1;
  padding: 14px 22px;
  border-radius: 999px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12);
  transition: transform 0.08s ease, background 0.15s ease, box-shadow 0.08s ease;
}

.btn:active { transform: translateY(2px) scale(0.98); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12); }

.btn-primary {
  background: linear-gradient(135deg, var(--cta-hover), var(--cta));
  color: var(--white);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--cta-hover), var(--terracotta)); }
.btn-primary:disabled {
  background: var(--salvia);
  color: rgba(255, 255, 255, 0.78); /* "Invia" resta intravvedibile anche da disabilitato */
  box-shadow: none;
  cursor: not-allowed;
}

.btn-ghost {
  background: var(--white);
  border: 2px solid var(--blu);
  color: var(--blu);
  box-shadow: none;
  flex: 0 0 auto;
  min-width: 110px;
}
.btn-ghost:hover { background: #d7dbc9; }

/* suggerimento sotto i campi contatto quando il pulsante Invia è disabilitato */
.submit-hint {
  margin: 14px 0 0;
  text-align: center;
  font-size: 13px;
  line-height: 1.35;
  color: var(--footer);
}

/* --- step --- */

.step-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--blu);
  margin: 0 0 8px;
  line-height: 1.3;
}

.step-subtitle {
  font-size: 15px;
  color: #6b7684;
  margin: 0 0 24px;
}

.step-helper {
  font-size: 14px;
  color: #6b7684;
  margin: -12px 0 20px;
}

/* --- intro screen --- */

.intro {
  text-align: center;
}
.intro .step-title { font-size: 26px; }
.intro-emoji { font-size: 48px; margin-bottom: 16px; }

/* --- choice options --- */

.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border: 2px solid var(--salvia);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.6));
  backdrop-filter: blur(6px);
  cursor: pointer;
  font-size: 16px;
  text-align: left;
  box-shadow: 0 4px 14px -6px rgba(175, 80, 33, 0.14);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease;
}

.option:hover { border-color: var(--terracotta); transform: translateY(-1px); box-shadow: 0 8px 18px -6px rgba(232, 194, 133, 0.22); }
.option:active { transform: translateY(1px); }

.option.selected {
  border-color: var(--terracotta);
  background: linear-gradient(135deg, #FBF0EB, #F7EBD6);
  box-shadow: 0 6px 16px -6px rgba(232, 194, 133, 0.28);
}
.option.selected .option-icon { transform: scale(1.15); }

.option-icon {
  font-size: 24px;
  line-height: 1;
  display: inline-flex;
  color: var(--terracotta);
  transition: transform 0.15s ease;
}
.option-icon svg { width: 24px; height: 24px; display: block; }
.option.selected .option-icon { color: var(--blu); }

.option-label { font-weight: 600; }

/* --- opzioni Cane/Gatto: sfondo pieno colorato, testa nel tondino --- */

.option.option-species {
  padding: 18px;
  border-width: 0;
  color: var(--white);
  justify-content: flex-start;
  min-height: 84px;
}
.option.option-species .option-label { font-size: 18px; letter-spacing: 0.02em; }

.option.species-cane { background: var(--blu); }        /* AF5021 rust, tinta unita */
.option.species-gatto { background: #6E7D57; }          /* verde profondo, tinta unita */

.option.species-cane:hover,
.option.species-gatto:hover { transform: translateY(-2px); border-color: transparent; }

.option.option-species .head-thumb {
  width: 52px;
  height: 52px;
  border: 3px solid rgba(255, 255, 255, 0.85);
}

.option.option-species.selected {
  outline: 3px solid var(--cta);
  outline-offset: 2px;
}
.option.species-cane.selected { background: var(--blu); }
.option.species-gatto.selected { background: #6E7D57; }
.option-sublabel { display: block; font-size: 13px; font-weight: 400; color: #6b7684; }

.option-note {
  margin-top: 8px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--salvia);
  border-radius: 10px;
  font-size: 14px;
}

/* --- opzioni a elenco con cerchietto (checkbox), niente icona grande --- */

.option.option-checkbox {
  padding: 14px 18px;
  border-radius: 14px;
  gap: 14px;
}
.checkbox-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--salvia);
  flex: 0 0 auto;
  position: relative;
  transition: border-color 0.15s ease;
}
.option.option-checkbox.selected .checkbox-circle {
  border-color: var(--terracotta);
}
.option.option-checkbox.selected .checkbox-circle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--terracotta);
  transform: translate(-50%, -50%);
}

.trailing-note {
  margin-top: 14px;
}

/* --- text / number inputs --- */

.field-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--salvia);
  border-radius: 12px;
  font-size: 17px;
  outline: none;
}
.field-input:focus { border-color: var(--terracotta); }

.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 8px;
}
.stepper-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--salvia);
  background: var(--white);
  font-size: 22px;
  cursor: pointer;
  color: var(--blu);
}
.stepper-btn:hover { border-color: var(--terracotta); }
.stepper-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--blu);
  min-width: 90px;
  text-align: center;
}

/* --- contact step --- */

.field-group { margin-bottom: 16px; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--blu); margin-bottom: 6px; }

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #6b7684;
  margin-top: 12px;
}
.consent-row input { margin-top: 3px; }

/* --- result screen --- */

.result { text-align: left; }

.result-header { text-align: center; margin-bottom: 24px; }
.result-header .step-title { font-size: 24px; margin-bottom: 4px; }

.result-text p {
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 14px;
}

.result-teaser {
  background: linear-gradient(160deg, var(--crema), #EFE0C4);
  border: 1px solid rgba(232, 194, 133, 0.15);
  box-shadow: 0 6px 18px -10px rgba(175, 80, 33, 0.2);
  border-radius: 14px;
  padding: 16px;
  font-size: 14px;
  line-height: 1.6;
  margin: 20px 0;
}
.result-teaser p { margin: 0 0 10px; }
.result-teaser p:last-child { margin-bottom: 0; }

.result-cta {
  display: block;
  width: 100%;
  text-align: center;
  padding: 16px;
  border-radius: 12px;
  background: var(--cta);
  color: var(--white);
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  margin-bottom: 12px;
}
.result-cta:hover { background: var(--cta-hover); }

.result-secondary {
  display: flex;
  gap: 12px;
}
.result-secondary .btn { padding: 12px; font-size: 14px; }

.error-banner {
  background: #FDECEA;
  color: #A33;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

@media (max-width: 420px) {
  .app-main { padding: 20px; }
  .step-title { font-size: 20px; }
}
