/* StiVeg · Landing carbonara veg
   Palette e forme ricavate dal PDF del cliente.
   Raggi: pannelli e immagini 20px, campi 12px, pulsanti a pillola. */

:root {
  --paper: #F5F4E7;        /* fondo pagine PDF */
  --sage: #ECEEDB;         /* card consigli PDF */
  --sage-deep: #DFE4CB;
  --forest: #0C4433;       /* verde logo / fascia PDF */
  --ink: #0F3118;          /* verde titoli */
  --ochre: #B0760A;        /* ocra titoli, scurito per contrasto su carta */
  --cta: #E58F03;          /* arancio pulsante PDF */
  --cta-hover: #D48203;
  --text: #22322A;
  --muted: #4B5A51;
  --line: #D6DAC2;
  --white: #FFFEF8;
  --error: #B42318;

  --f-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --f-body: "Figtree", "Segoe UI", system-ui, sans-serif;

  --r-panel: 20px;
  --r-field: 12px;
  --shadow: 0 1px 0 rgba(15, 49, 24, .04), 0 18px 40px -18px rgba(15, 49, 24, .28);

  --gutter: clamp(1rem, 4vw, 2.5rem);
  --section: clamp(4rem, 9vw, 7.5rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
picture { display: block; }
[hidden] { display: none !important; }

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

:focus-visible {
  outline: 3px solid var(--forest);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

h1, h2, h3 { margin: 0; color: var(--ink); }
p { margin: 0; }

/* ---------- Pulsanti ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 48px;
  padding: .8rem 1.6rem;
  border: 0;
  border-radius: 999px;
  font: 700 1.0625rem/1 var(--f-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .18s ease, transform .12s ease, box-shadow .18s ease;
}
.btn .ph { font-size: 1.3em; }
.btn:active { transform: translateY(1px) scale(.985); }

.btn--cta {
  background: var(--cta);
  color: var(--ink);
  box-shadow: 0 10px 22px -10px rgba(229, 143, 3, .75), inset 0 -2px 0 rgba(15, 49, 24, .12);
}
.btn--cta:hover { background: var(--cta-hover); color: var(--ink); }
.btn--cta[aria-busy="true"] { opacity: .8; cursor: progress; }

.btn--small {
  min-height: 44px;
  padding: .6rem 1.15rem;
  font-size: .95rem;
  background: var(--forest);
  color: var(--white);
}
.btn--small:hover { background: var(--ink); color: var(--white); }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.topbar.is-scrolled { border-bottom-color: var(--line); }
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
  color: var(--ink);
}
.brand img { width: 44px; height: auto; }
.brand__name {
  display: flex;
  flex-direction: column;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.1;
}
.brand__name span { font-weight: 500; font-size: .8rem; color: var(--muted); }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(2rem, 5vw, 4rem) clamp(3rem, 6vw, 5rem); overflow: clip; }

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
}

.hero__kicker {
  display: inline-block;
  margin-bottom: 1rem;
  padding: .3rem .8rem;
  border-radius: 999px;
  background: var(--sage-deep);
  color: var(--forest);
  font-weight: 600;
  font-size: .9rem;
}

.hero__title {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 3.4vw, 3.15rem);
  line-height: 1.06;
  letter-spacing: -.015em;
}
.hero__title, .section-title, .closing__title, .success__title { font-variant-numeric: lining-nums; }
.hero__title span { display: block; }
.t-green { color: var(--ink); }
.t-ochre { color: var(--ochre); }

.hero__lead {
  margin-top: 1.1rem;
  max-width: 34ch;
  font-size: clamp(1.08rem, 1.5vw, 1.25rem);
  color: var(--muted);
}

/* ---------- Form ---------- */
.form-card {
  margin-top: 1.9rem;
  padding: clamp(1.25rem, 2.6vw, 1.75rem);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  box-shadow: var(--shadow);
  max-width: 560px;
}

.lead-form { display: grid; gap: 1rem; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.field { display: grid; gap: .35rem; align-content: start; }

.field label {
  font-weight: 600;
  font-size: .95rem;
  color: var(--ink);
}

.field input {
  width: 100%;
  min-height: 48px;
  padding: .7rem .9rem;
  border: 1.5px solid #B9C0A6;
  border-radius: var(--r-field);
  background: #FFFFFF;
  color: var(--text);
  font: 500 1rem/1.3 var(--f-body);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:hover { border-color: #8E9A7E; }
.field input:focus {
  outline: none;
  border-color: var(--forest);
  box-shadow: 0 0 0 4px rgba(12, 68, 51, .16);
}
.field input[aria-invalid="true"] {
  border-color: var(--error);
  box-shadow: 0 0 0 4px rgba(180, 35, 24, .1);
}

.field__help { font-size: .85rem; color: var(--muted); line-height: 1.4; }
.field__error {
  font-size: .875rem;
  font-weight: 600;
  color: var(--error);
  line-height: 1.4;
}
.field__error--check { margin-top: -.5rem; padding-left: 2.1rem; }

.check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .7rem;
  align-items: start;
  font-size: .9rem;
  line-height: 1.45;
  color: var(--muted);
}
.check input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--forest);
  cursor: pointer;
}
.check label { cursor: pointer; }

.lead-form .btn--cta { width: 100%; min-height: 54px; font-size: 1.125rem; }

.success { display: grid; gap: .8rem; justify-items: start; outline: none; }
.success__icon { font-size: 2.4rem; color: var(--forest); }
.success__title { font-family: var(--f-display); font-size: 1.7rem; line-height: 1.15; }
.success p { color: var(--muted); max-width: 44ch; }
.success .btn { margin-top: .4rem; }
.success.is-in { animation: rise .45s cubic-bezier(.16, 1, .3, 1) both; }

/* ---------- Libretto sfogliato (elemento memorabile) ---------- */
.hero__visual { position: relative; display: grid; place-items: center; }
.hero__visual::before {
  content: "";
  position: absolute;
  inset: 8% 2% 4% 6%;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--sage-deep), transparent 72%);
}

.booklet {
  position: relative;
  width: min(76%, 410px);
  aspect-ratio: 900 / 1273;
}
.booklet__page {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--white);
  box-shadow: 0 30px 60px -28px rgba(15, 49, 24, .55), 0 2px 6px rgba(15, 49, 24, .12);
  transform-origin: 50% 100%;
}
.booklet__page img { width: 100%; height: 100%; object-fit: cover; }

.booklet__page--front  { transform: rotate(-2deg); z-index: 3; }
.booklet__page--back1  { transform: translate(16%, 2%) rotate(7deg) scale(.94); z-index: 2; }
.booklet__page--back2  { transform: translate(-14%, 5%) rotate(-11deg) scale(.9); z-index: 1; }

@media (prefers-reduced-motion: no-preference) {
  .booklet__page--front { animation: page-front .9s .1s cubic-bezier(.16, 1, .3, 1) both; }
  .booklet__page--back1 { animation: page-b1 1s .35s cubic-bezier(.16, 1, .3, 1) both; }
  .booklet__page--back2 { animation: page-b2 1s .45s cubic-bezier(.16, 1, .3, 1) both; }
}

@keyframes page-front { from { opacity: 0; transform: translateY(24px) rotate(0deg); } }
@keyframes page-b1    { from { transform: translate(0, 0) rotate(-2deg) scale(.94); } }
@keyframes page-b2    { from { transform: translate(0, 0) rotate(-2deg) scale(.9); } }
@keyframes rise       { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Fascia contenuti PDF ---------- */
.facts { background: var(--sage); border-block: 1px solid var(--line); }
.facts__list {
  list-style: none;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-block: 1.4rem;
}
.facts__list li {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: var(--muted);
  font-size: 1rem;
}
.facts__list strong { color: var(--ink); font-weight: 700; }
.facts__list .ph {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--forest);
  font-size: 1.35rem;
  flex: none;
}

/* ---------- Titoli di sezione ---------- */
.section-title {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1.08;
  letter-spacing: -.01em;
  text-wrap: balance;
}
.section-lead {
  margin-top: .9rem;
  max-width: 52ch;
  font-size: 1.125rem;
  color: var(--muted);
}

/* ---------- Cosa imparerai ---------- */
.learn { padding-block: var(--section); }
.learn__grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 6vw, 5.5rem);
  align-items: center;
}
.learn__photo { margin: 0; }
.learn__photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--r-panel);
  box-shadow: var(--shadow);
}

.outcomes {
  list-style: none;
  margin: 2.2rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.6rem;
}
.outcomes li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
}
.outcomes .ph {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--sage-deep);
  color: var(--forest);
  font-size: 1.4rem;
}
.outcomes h3 { font-size: 1.15rem; font-weight: 700; line-height: 1.3; }
.outcomes p { margin-top: .2rem; color: var(--muted); max-width: 50ch; }

/* ---------- Dentro la guida ---------- */
.inside {
  padding-block: var(--section);
  background: linear-gradient(180deg, var(--sage) 0%, var(--paper) 100%);
}
.pages {
  list-style: none;
  margin: 2.6rem auto 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1rem, 2.4vw, 2rem);
}
.pages__item img {
  width: 100%;
  aspect-ratio: 640 / 905;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: var(--shadow);
  background: var(--white);
}
.pages__item:nth-child(even) { margin-top: 2.5rem; }
.pages__item h3 { margin-top: 1.1rem; font-size: 1.1rem; font-weight: 700; }
.pages__item p { margin-top: .25rem; font-size: .975rem; color: var(--muted); }

/* ---------- Chi siamo ---------- */
.about { padding-block: var(--section); }
.about__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: center;
}
.about__photo { grid-column: 1 / 8; grid-row: 1; margin: 0; }
.about__photo img {
  width: 100%;
  aspect-ratio: 1200 / 1091;
  object-fit: cover;
  border-radius: var(--r-panel);
}
.about__panel {
  grid-column: 7 / 13;
  grid-row: 1;
  position: relative;
  padding: clamp(1.75rem, 3.5vw, 3rem);
  background: var(--forest);
  color: #E6ECDD;
  border-radius: var(--r-panel);
  box-shadow: 0 30px 60px -30px rgba(12, 68, 51, .7);
}
.about__panel .section-title { color: var(--white); font-size: clamp(1.9rem, 3.2vw, 2.6rem); }
.about__panel p { margin-top: 1rem; max-width: 46ch; }
.about__sign {
  position: absolute;
  top: -28px;
  right: 28px;
  width: 64px;
  filter: drop-shadow(0 6px 12px rgba(15, 49, 24, .3));
}

/* ---------- Chiusura ---------- */
.closing { padding-block: 0 clamp(2.5rem, 5vw, 4rem); }
.closing__inner {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 1rem;
  padding-block: clamp(3rem, 6vw, 4.5rem) 0;
  border-top: 1px solid var(--line);
}
.closing__title {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(2rem, 4.2vw, 3.3rem);
  line-height: 1.08;
  text-wrap: balance;
}
.closing p { color: var(--muted); max-width: 46ch; font-size: 1.125rem; }
.closing .btn { margin-top: .6rem; min-height: 54px; padding-inline: 2rem; font-size: 1.125rem; }

/* ---------- Footer ---------- */
.footer { background: var(--forest); color: #C9D5C4; font-size: .925rem; }
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.5rem;
  padding-block: 1.6rem calc(1.6rem + env(safe-area-inset-bottom, 0px));
}
.footer nav { display: flex; gap: 1.25rem; }
.footer a { color: #E6ECDD; }
.footer a:hover { color: var(--white); }
.footer :focus-visible { outline-color: var(--cta); }

/* ---------- Responsive ---------- */
@media (max-width: 1140px) {
  .facts__list { grid-template-columns: repeat(2, auto); justify-content: start; column-gap: 3rem; }
}

@media (max-width: 1023px) {
  .pages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pages__item:nth-child(even) { margin-top: 0; }
  .about__photo { grid-column: 1 / 13; }
  .about__panel { grid-column: 2 / 12; grid-row: 2; margin-top: -4rem; }
}

@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__visual { order: -1; }
  .booklet { width: min(40%, 200px); }
  .hero__lead { max-width: 40ch; }
  .form-card { max-width: none; }
  .learn__grid { grid-template-columns: 1fr; }
  .learn__photo img { aspect-ratio: 16 / 11; }
}

@media (max-width: 640px) {
  .topbar__inner { height: 60px; }
  .brand__name span { display: none; }
  .field-row { grid-template-columns: 1fr; }
  .facts__list { grid-template-columns: 1fr; gap: .8rem; }
  .pages {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 68%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    padding-bottom: 1rem;
    scrollbar-width: thin;
  }
  .pages__item { scroll-snap-align: start; }
  .about__panel { grid-column: 1 / 13; margin-top: -2.5rem; margin-inline: .5rem; }
  .about__sign { width: 52px; top: -22px; right: 20px; }
  .btn--small { padding-inline: .95rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- WordPress ---------- */

/* Honeypot antispam: fuori schermo, non display:none (alcuni bot lo saltano). */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Barra admin visibile solo da loggati. */
.admin-bar .topbar { top: 32px; }
@media (max-width: 782px) { .admin-bar .topbar { top: 46px; } }
@media (max-width: 600px) { .admin-bar .topbar { top: 0; } }

/* Pagine di testo (privacy, cookie...). */
.page-content { padding-block: var(--section); }
.page-content .wrap { max-width: 760px; }
.prose > * + * { margin-top: 1em; }
.prose h2, .prose h3 { font-family: var(--f-display); color: var(--ink); line-height: 1.2; margin-top: 1.8em; }
.prose a { color: var(--forest); }

/* Il pulsante "Apri il PDF" compare solo quando arriva il link personale. */
.btn[hidden] { display: none; }

/* Pagina grazie */
.thanks-cta { display: grid; gap: 1rem; justify-items: start; margin-top: 2rem; }
.thanks-cta .btn { min-height: 56px; padding-inline: 2rem; font-size: 1.125rem; }
.thanks-note { display: flex; gap: .5rem; align-items: flex-start; margin: 0; max-width: 46ch; color: var(--muted); font-size: .95rem; }
.thanks-note i { margin-top: .2rem; color: var(--forest); }
