/* ============================================================================
 * style.css — TEST DEL TIPO · brand corposostenibile
 * Palette Brand Visual Guide v1: 60% neutri caldi · 30% scuro · 10% salvia.
 * Il verde è ACCENTO (bottoni, progress, stati selezionati), mai fondale.
 * ========================================================================== */

:root {
  --salvia: #88B860;      /* Sostenibile — accento primario */
  --foglia: #B8E880;
  --radice: #6B9145;
  --bosco: #4A6B30;
  --sabbia: #F0EDE5;      /* fondale */
  --latte: #FAFAF8;       /* card */
  --nero: #0A0A0A;
  --carbone: #3A3A3A;     /* testo */
  --pietra: #888888;      /* testo secondario */
  --linea: #E3DFD4;
  --errore: #C0533E;
  --font-display: 'Quicksand', 'Trebuchet MS', sans-serif;
  --font-body: 'Nunito', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--sabbia);
  color: var(--carbone);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* ---- header ---- */

header.site {
  padding: 14px 18px 0;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  color: var(--carbone);
  letter-spacing: .2px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.wordmark .sprout-img { height: 24px; width: auto; display: block; }

#step-counter {
  font-size: 13px;
  color: var(--pietra);
  font-variant-numeric: tabular-nums;
  min-width: 54px;
  text-align: right;
}

.progress-track {
  height: 5px;
  background: #E6E2D8;
  border-radius: 999px;
  overflow: hidden;
}
#progress-fill {
  height: 100%;
  width: 0%;
  background: var(--salvia);
  border-radius: 999px;
  transition: width .45s cubic-bezier(.22,.8,.36,1);
}

#btn-back {
  visibility: hidden;
  border: 1px solid var(--linea);
  background: var(--latte);
  color: var(--carbone);
  width: 38px; height: 38px;
  border-radius: 12px;
  font-size: 17px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .15s, background .15s;
}
#btn-back:hover { border-color: var(--salvia); background: #fff; }

/* ---- schermate ---- */

main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 10px 18px 40px;
  display: flex;
  flex-direction: column;
}

.screen { display: none; flex: 1; }
.screen.active { display: flex; flex-direction: column; }

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

#screen-intro { justify-content: center; text-align: center; padding: 26px 0 40px; }

.intro-logo {
  height: 110px;
  width: auto;
  align-self: center;
  margin: 0 0 22px;
}

.intro-kicker {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--pietra);
  margin: 0 0 14px;
}

.intro-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 6vw, 44px);
  margin: 0 0 14px;
  color: var(--nero);
  line-height: 1.15;
}

.intro-sub {
  font-size: 17px;
  color: var(--carbone);
  max-width: 480px;
  margin: 0 auto 8px;
}

.intro-meta {
  font-size: 14px;
  color: var(--pietra);
  margin: 0 0 30px;
}

#btn-start {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  padding: 16px 42px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: var(--salvia);
  color: #fff;
  box-shadow: 0 8px 24px rgba(136, 184, 96, .35);
  transition: transform .12s, background .15s, box-shadow .15s;
  align-self: center;
}
#btn-start:hover { background: var(--radice); transform: translateY(-1px); }
#btn-start:active { transform: translateY(1px); }

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

.step {
  background: var(--latte);
  border: 1px solid var(--linea);
  border-radius: 20px;
  padding: 28px 26px 26px;
  box-shadow: 0 3px 16px rgba(10, 10, 10, .05);
  animation: stepIn .3s cubic-bezier(.22,.8,.36,1);
}
.step.enter-back { animation-name: stepInBack; }

@keyframes stepIn     { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes stepInBack { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }

.section-chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--bosco);
  background: rgba(136, 184, 96, .14);
  border-radius: 999px;
  padding: 5px 12px;
  margin-bottom: 14px;
}

.q-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(20px, 4vw, 25px);
  color: var(--nero);
  margin: 0 0 8px;
  line-height: 1.3;
}

.q-hint { font-size: 14px; color: var(--pietra); margin: 0 0 8px; }

.q-error {
  color: var(--errore);
  font-size: 14px;
  font-weight: 600;
  margin: 12px 0 0;
  min-height: 0;
}
.q-error:empty { display: none; }

/* ---- scelte ---- */

.choices { display: flex; flex-direction: column; gap: 9px; margin-top: 18px; }

.choice {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--carbone);
  background: #fff;
  border: 1.5px solid var(--linea);
  border-radius: 14px;
  padding: 13px 16px;
  cursor: pointer;
  transition: border-color .13s, background .13s, transform .08s;
}
.choice:hover { border-color: var(--salvia); }
.choice:active { transform: scale(.99); }
.choice.selected {
  border-color: var(--salvia);
  background: rgba(136, 184, 96, .12);
  font-weight: 700;
}

.choice-key {
  flex: 0 0 auto;
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--linea);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--pietra);
  background: var(--latte);
}
.choice.selected .choice-key { border-color: var(--salvia); color: var(--bosco); background: #fff; }

.choice-check {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  border: 1.5px solid var(--linea);
  border-radius: 6px;
  background: #fff;
  position: relative;
}
.choice.selected .choice-check { border-color: var(--salvia); background: var(--salvia); }
.choice.selected .choice-check::after {
  content: '';
  position: absolute; inset: 0;
  background: center / 12px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5 6.5 12 13 4.5' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ---- picture choice ---- */

.picture-row { display: flex; gap: 14px; margin-top: 18px; }

.picture-choice {
  flex: 1;
  border: 1.5px solid var(--linea);
  border-radius: 16px;
  background: #fff;
  padding: 10px 10px 12px;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color .13s, transform .1s, box-shadow .15s;
}
.picture-choice:hover { border-color: var(--salvia); box-shadow: 0 6px 18px rgba(10,10,10,.07); }
.picture-choice.selected { border-color: var(--salvia); background: rgba(136, 184, 96, .1); }
.picture-choice img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 11px;
  display: block;
}
.picture-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--carbone);
  text-align: center;
  text-transform: lowercase;
}

/* ---- number ---- */

.number-wrap { display: flex; align-items: baseline; gap: 10px; margin-top: 18px; }

.input-big {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  color: var(--nero);
  background: transparent;
  border: none;
  border-bottom: 2.5px solid var(--linea);
  outline: none;
  padding: 4px 2px 8px;
  width: 180px;
  border-radius: 0;
  transition: border-color .15s;
}
.input-big:focus { border-color: var(--salvia); }
.input-big::placeholder { color: #C9C4B6; }
.input-big::-webkit-outer-spin-button, .input-big::-webkit-inner-spin-button { -webkit-appearance: none; }
.input-big[type=number] { -moz-appearance: textfield; appearance: textfield; }

.number-suffix { font-size: 18px; font-weight: 700; color: var(--pietra); }

/* ---- form contatti ---- */

.contact-form { margin-top: 16px; }
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; color: var(--carbone); }

.input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--carbone);
  background: #fff;
  border: 1.5px solid var(--linea);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  transition: border-color .15s;
}
.input:focus { border-color: var(--salvia); }

.privacy-note { font-size: 12.5px; color: var(--pietra); margin: 4px 0 0; }
.privacy-note a { color: var(--radice); }

/* ---- bottoni ---- */

.btn-row { display: flex; margin-top: 18px; }

.btn-primary {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--salvia);
  border: none;
  border-radius: 999px;
  padding: 13px 34px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(136, 184, 96, .3);
  transition: background .15s, transform .1s;
}
.btn-primary:hover { background: var(--radice); }
.btn-primary:active { transform: translateY(1px); }
.btn-final { width: 100%; padding: 15px 34px; font-size: 17px; }

/* ---- processing ---- */

#screen-processing { justify-content: center; align-items: center; text-align: center; }

.spinner {
  width: 46px; height: 46px;
  border: 4px solid rgba(136, 184, 96, .25);
  border-top-color: var(--salvia);
  border-radius: 50%;
  animation: spin .9s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.processing-title { font-family: var(--font-display); font-weight: 600; font-size: 22px; color: var(--nero); margin: 0 0 6px; }
.processing-sub { font-size: 15px; color: var(--pietra); margin: 0; }

/* ---- footer ---- */

footer.site {
  text-align: center;
  font-size: 12px;
  color: var(--pietra);
  padding: 14px 18px 22px;
  max-width: 720px;
  margin: 0 auto;
}

/* ---- mobile ---- */

@media (max-width: 480px) {
  .step { padding: 22px 18px 20px; border-radius: 16px; }
  .picture-row { gap: 10px; }
  .input-big { font-size: 28px; width: 140px; }
  .choice { padding: 12px 14px; font-size: 15px; }
}
