/* ==========================================================================
   Landing «Guida + calcolatore» — composizione delle sezioni.
   Token, bottoni, onde e logotipo arrivano da brand.css.
   Ritmo: miele (hero + modulo) → bianco a quadretti (il problema) →
   inchiostro (la voce del titolare) → bianco (sommario e strumenti) →
   bianco (domande) → miele (chiusura che prosegue nel footer).
   ========================================================================== */

/* --- Header -------------------------------------------------------------- */

/* La linguetta non sta accanto al marchio sui telefoni stretti. */
@media (max-width: 33.99rem) {
  .header-tab { display: none; }
}

/* --- 1 · Hero ------------------------------------------------------------ */

.hero {
  padding-block: clamp(6.5rem, 6vw + 5rem, 9rem) clamp(3.5rem, 7vw, 5.5rem);
}

.hero-grid {
  position: relative;
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: start;
}

@media (min-width: 62rem) {
  .hero-grid { grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr); }
}

.hero-copy { min-width: 0; }

.hero-tag {
  margin-bottom: clamp(1.1rem, 2.5vw, 1.6rem);
  animation: sale 620ms var(--ease) both;
}

.hero-title {
  max-width: 14ch;
  animation: sale 620ms var(--ease) 70ms both;
}

/* «lavora gratis.»: l'evidenziatore degli annunci, portato sul campo miele
   in crema. Si stende una volta da sinistra all'apertura. */
.mark {
  font-style: normal;
  background-image: linear-gradient(var(--cream), var(--cream));
  background-repeat: no-repeat;
  background-position: 0 88%;
  background-size: 100% 0.36em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding-inline: 0.04em;
  animation: evidenzia 720ms var(--ease) 520ms both;
}

@keyframes evidenzia {
  from { background-size: 0% 0.36em; }
}

.hero-lead {
  margin-top: clamp(1.25rem, 2.5vw, 1.75rem);
  max-width: 40ch;
  font-size: var(--step-lead);
  letter-spacing: var(--track-lead);
  line-height: 1.55;
  animation: sale 620ms var(--ease) 160ms both;
}

.hero-lead b { font-weight: 700; }

/* --- Il conto: ritaglio di planning con i quattro reformer ---------------- */

.tally {
  margin-top: clamp(1.75rem, 3.5vw, 2.5rem);
  max-width: 34rem;
  animation: sale 620ms var(--ease) 240ms both;
}

.math {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--bg);
  border-radius: var(--r-panel);
  box-shadow: var(--lift-high);
  overflow: hidden;
}

.seat {
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  padding: 0.95rem 0.35rem 0.9rem;
  text-align: center;
  font-size: var(--step-tiny);
  letter-spacing: var(--track-tiny);
  font-weight: 500;
  color: var(--muted);
}

.seat + .seat { border-left: 1px solid var(--line); }

.seat b {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 0.95rem + 1.4vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.seat.neg { background: var(--loss-soft); }
.seat.neg b { color: var(--loss); }
.seat.zero b { color: var(--honey-deep); }
.seat.pos b { color: var(--pine); }

/* I quattro posti: pieni = presenti. */
.dots {
  display: flex;
  gap: 3px;
  margin-bottom: 0.35rem;
}

.dots i {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px var(--line);
}

.dots i.on { background: var(--ink); box-shadow: none; }

.math-note {
  margin-top: 0.85rem;
  font-size: var(--step-small);
  letter-spacing: var(--track-small);
  line-height: 1.5;
  color: var(--on-honey-muted);
}

/* --- Il modulo: un foglio d'agenda appoggiato sul miele -------------------- */

.form-card {
  position: relative;
  background: var(--bg);
  border-radius: var(--r-panel);
  box-shadow: var(--lift-high);
  padding: clamp(1.6rem, 3vw, 2.25rem);
  animation: sale 720ms var(--ease) 200ms both;
}

@media (min-width: 62rem) {
  .form-card { position: sticky; top: 5.5rem; }
}

/* Gli anelli dell'agenda, come nel simbolo del marchio. */
.rings {
  position: absolute;
  top: -0.7rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 4.5rem;
  pointer-events: none;
}

.rings i {
  width: 0.6rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 0 0 0 3px var(--bg);
}

.form-card h2 {
  font-size: var(--step-h3);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.form-card .small {
  margin-top: 0.4rem;
  font-size: var(--step-small);
  color: var(--muted);
  line-height: 1.5;
}

.gets {
  list-style: none;
  padding: 0;
  margin: 1.1rem 0 1.4rem;
  display: grid;
  gap: 0.55rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--line);
}

.gets li {
  position: relative;
  padding-left: 1.9rem;
  font-size: var(--step-small);
  line-height: 1.45;
}

/* La spunta di conferma del prodotto: verde pino, mai solo colore. */
.gets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 999px;
  background: var(--pine-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5 L 7 11.2 L 12.2 5' fill='none' stroke='%23116b55' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 0.85rem no-repeat;
}

.fields {
  display: grid;
  gap: 0.9rem 0.8rem;
}

@media (min-width: 30rem) {
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-wide { grid-column: 1 / -1; }
}

/* Dentro la colonna del modulo su desktop la riga è stretta: nome e
   studio restano affiancati solo da 70rem, dove il foglio è largo. */
@media (min-width: 62rem) and (max-width: 69.99rem) {
  .fields { grid-template-columns: 1fr; }
}

.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: var(--track-small);
}

.field input,
.field select {
  width: 100%;
  min-height: 3.125rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  background: var(--surface);
  font-size: 1rem; /* 16px: niente zoom automatico su iOS */
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

.field input::placeholder { color: var(--muted); opacity: 0.75; }

.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6 L 8 10 L 12 6' fill='none' stroke='%23241c14' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 1rem;
  cursor: pointer;
}

.field input:hover,
.field select:hover { border-color: oklch(0.75 0.012 62); }

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--ink);
  background-color: var(--bg);
  box-shadow: 0 0 0 3px oklch(0.795 0.145 74 / 0.45);
}

/* Errore solo dopo che l'utente ci ha provato, mai a modulo vuoto. */
.field input:user-invalid,
.field select:user-invalid {
  border-color: var(--loss);
  background-color: var(--loss-soft);
}

.consent {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  margin-top: 1.2rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--muted);
  cursor: pointer;
}

.consent input {
  flex: none;
  width: 1.3rem;
  height: 1.3rem;
  margin-top: 0.05rem;
  accent-color: var(--ink);
  cursor: pointer;
}

.submit {
  width: 100%;
  margin-top: 1.3rem;
}

.privacy {
  margin-top: 0.85rem;
  text-align: center;
  font-size: 0.875rem;
  letter-spacing: var(--track-tiny);
  color: var(--muted);
}

.privacy a { color: var(--ink); text-underline-offset: 3px; }

/* --- 2 · Il problema -------------------------------------------------------- */

.problem-grid {
  display: grid;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}

@media (min-width: 62rem) {
  .problem-grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
  .problem-head { position: sticky; top: 7rem; }
}

.sec-lead {
  margin-top: clamp(1rem, 2vw, 1.4rem);
  max-width: 44ch;
  font-size: var(--step-lead);
  letter-spacing: var(--track-lead);
  line-height: 1.55;
  color: var(--muted);
}

/* Una pagina d'agenda a righe, non cinque riquadri uguali. */
.paper {
  background: var(--bg);
  border-radius: var(--r-panel);
  box-shadow: var(--lift);
}

.holes {
  list-style: none;
  padding: 0.5rem clamp(1.25rem, 3vw, 2.25rem);
}

.holes li {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 0.25rem 1rem;
  padding-block: clamp(1.1rem, 2.2vw, 1.5rem);
}

.holes li + li { border-top: 1px solid var(--line); }

.holes .n,
.toc .n {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--honey-deep);
}

.holes h3 { font-size: var(--step-h3); }

.holes p {
  margin-top: 0.35rem;
  color: var(--muted);
  line-height: 1.55;
}

/* --- 3 · La voce del titolare -------------------------------------------- */

.quote-band {
  background: var(--ink);
  color: var(--bg);
  padding-block: var(--section-y-tight);
}

.quote {
  position: relative;
  max-width: 50rem;
  margin-inline: auto;
  text-align: center;
}

.quote .qmark {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(5rem, 9vw, 7rem);
  line-height: 0.7;
  height: 0.45em;
  color: var(--honey);
}

.quote blockquote p {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.35rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.quote figcaption {
  margin-top: 1.4rem;
  font-size: var(--step-small);
  color: oklch(0.82 0.02 75);
}

/* --- 4 · Cosa trovi dentro ------------------------------------------------- */

.inside-band { padding-bottom: var(--section-y-tight); }

.inside-grid {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: center;
}

@media (min-width: 62rem) {
  .inside-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* La scrivania: il foglio Excel dietro, la copertina della guida davanti. */
.desk {
  position: relative;
  min-height: clamp(20rem, 52vw, 27rem);
  max-width: 34rem;
  width: 100%;
  margin-inline: auto;
}

.sheet {
  position: absolute;
  top: 8%;
  right: 0;
  width: min(80%, 24rem);
  background: var(--bg);
  border-radius: var(--r-panel);
  box-shadow: var(--lift-high);
  overflow: hidden;
  rotate: 2.5deg;
  font-size: 0.75rem;
}

.sheet-bar {
  padding: 0.5rem 0.8rem;
  background: var(--pine);
  color: var(--bg);
  font-weight: 600;
  letter-spacing: var(--track-tiny);
}

.sheet table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.sheet th,
.sheet td {
  padding: 0.5rem 0.6rem;
  text-align: left;
  white-space: nowrap;
}

.sheet th {
  background: var(--surface);
  font-weight: 600;
  color: var(--muted);
}

.sheet td + td,
.sheet th + th { text-align: right; }

.sheet tr + tr td { border-top: 1px solid var(--line); }

.st {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.st.ok { background: var(--pine-soft); color: var(--pine); }
.st.even { background: oklch(0.95 0.06 90); color: var(--honey-deep); }
.st.loss { background: var(--loss-soft); color: var(--loss); }

.cover {
  position: absolute;
  left: 2%;
  bottom: 0;
  width: min(52%, 15rem);
  height: auto;
  border-radius: 6px;
  box-shadow: var(--lift-high);
  rotate: -4deg;
}

.desk-note {
  position: absolute;
  right: 6%;
  bottom: 2%;
  color: var(--honey-deep);
  rotate: -3deg;
}

.toc {
  list-style: none;
  padding: 0;
  margin-top: clamp(1.5rem, 3vw, 2rem);
  border-top: 2px solid var(--ink);
}

.toc li {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 1rem;
  padding-block: 1.1rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.55;
}

.toc b {
  display: block;
  margin-bottom: 0.2rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}

/* --- 5 · Domande: note di carta, si aprono al tocco ------------------------- */

.faq-band { padding-top: var(--section-y-tight); }

.faq h2 { text-align: center; }

.notes {
  display: grid;
  gap: 1.25rem;
  max-width: 46rem;
  margin: clamp(2rem, 4vw, 2.75rem) auto 0;
}

.note {
  position: relative;
  border-radius: var(--r-panel);
  box-shadow: var(--lift);
  background: var(--bg);
  transition: box-shadow var(--t-base) var(--ease);
}

/* Tutte uguali; l'unica differenza è lo stato: quella aperta porta il
   filetto miele a sinistra e si alza appena. */
.note::before {
  content: "";
  position: absolute;
  inset: 0.9rem auto 0.9rem 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--honey);
  opacity: 0;
  transition: opacity var(--t-base) var(--ease);
}

.note[open] { box-shadow: var(--lift-high); }
.note[open]::before { opacity: 1; }

.note summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
  padding: 1.15rem 1.4rem;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.05rem + 0.45vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.note summary::-webkit-details-marker { display: none; }

/* Il «+» che diventa «−»: un tratto ruota, l'altro resta. */
.note summary::after {
  content: "";
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background:
    linear-gradient(var(--ink), var(--ink)) center / 0.8rem 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) center / 2px 0.8rem no-repeat,
    var(--bg);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: rotate var(--t-base) var(--ease);
}

.note[open] summary::after {
  background:
    linear-gradient(var(--ink), var(--ink)) center / 0.8rem 2px no-repeat,
    var(--bg);
  rotate: 180deg;
}

.note p {
  padding: 0 1.4rem 1.3rem;
  max-width: 62ch;
  color: oklch(0.36 0.02 62);
  line-height: 1.6;
}

.note[open] p { animation: sale 360ms var(--ease) both; }

/* --- 6 · Chiusura sul miele --------------------------------------------- */

.final {
  background: var(--honey);
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(1rem, 3vw, 2rem);
}

.final-inner {
  display: grid;
  justify-items: center;
  gap: clamp(1.5rem, 3vw, 2rem);
  text-align: center;
}

.final h2 { max-width: 18ch; }

.footer { border-top: 1px solid oklch(0.36 0.055 62 / 0.18); }
.footer-end { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; }
.footer-company { text-decoration: none; }
.footer-company:hover { opacity: 0.75; }

/* Telefono: prima il sommario, poi la scrivania; nel foglio la colonna
   «Giorno» (comunque coperta dalla copertina) lascia spazio a «Stato». */
@media (max-width: 61.99rem) {
  .desk { order: 2; }
}

@media (max-width: 35.99rem) {
  .sheet { width: 78%; }
  .sheet th:first-child,
  .sheet td:first-child { display: none; }
  .sheet th, .sheet td { padding-inline: 0.5rem; }
}
