:root {
  --deep: #0d3d4d;
  --primary: #1a5f7a;
  --primary-soft: #2d8cb8;
  --accent: #4ecdc4;
  --ink: #2d2f31;
  --muted: #6b6d70;
  --cream: #f5f3f0;
  --line: #e8e4df;
  --white: #ffffff;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(13, 61, 77, .10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  line-height: 1.5;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); }

/* ---------- topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 20px 12px;
  background: var(--deep);
  color: var(--white);
}
.brand {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -.02em;
  color: var(--white);
  text-decoration: none;
}
.topbar-note {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- blocco unico: immagine + copy + form ---------- */
.landing {
  background: var(--white);
}
.landing-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--deep), var(--primary) 55%, var(--primary-soft));
  overflow: hidden;
}
.landing-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .35s ease;
}
.landing-media img.is-loaded { opacity: 1; }
.landing-media-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .92);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .02em;
  text-align: center;
  padding: 24px;
}
.landing-media-fallback[hidden] { display: none; }

.landing-body { padding: 24px 20px 32px; }

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary-soft);
}
h1 {
  margin: 0 0 12px;
  font-size: clamp(27px, 7.4vw, 38px);
  line-height: 1.15;
  letter-spacing: -.02em;
  font-weight: 800;
  color: var(--deep);
}
.sub {
  margin: 0 0 20px;
  font-size: 17px;
  color: var(--muted);
}
.benefits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.benefits li {
  position: relative;
  padding-left: 26px;
  font-size: 15.5px;
  font-weight: 500;
}
.benefits li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 14px;
  height: 8px;
  border-left: 2.5px solid var(--accent);
  border-bottom: 2.5px solid var(--accent);
  transform: rotate(-45deg);
}

/* ---------- form, nello stesso blocco ---------- */
.form-block {
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.form-block h2 {
  margin: 0 0 6px;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -.01em;
  color: var(--deep);
}
.form-sub {
  margin: 0 0 18px;
  font-size: 14.5px;
  color: var(--muted);
}
.progress {
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  margin-bottom: 22px;
}
.progress-bar {
  height: 100%;
  width: 25%;
  border-radius: 999px;
  background: var(--accent);
  transition: width .3s ease;
}

.hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
}

.step { display: none; }
.step.is-active {
  display: block;
  animation: stepIn .28s ease;
}
@keyframes stepIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.q {
  display: block;
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--deep);
}
.q-hint {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--muted);
}
.step input[type="text"],
.step input[type="email"],
.step input[type="tel"] {
  width: 100%;
  font-family: inherit;
  font-size: 17px;
  padding: 15px 16px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fbfaf8;
  color: var(--ink);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.step input:focus {
  border-color: var(--primary-soft);
  box-shadow: 0 0 0 3px rgba(45, 140, 184, .15);
  background: var(--white);
}

.recap {
  margin: 0 0 16px;
  padding: 14px 16px;
  background: #fbfaf8;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 8px;
}
.recap div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 15px;
}
.recap dt {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
  align-self: center;
}
.recap dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

.privacy {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.45;
  cursor: pointer;
}
.privacy input[type="checkbox"] {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--primary);
}

.error {
  margin: 12px 0 0;
  min-height: 18px;
  font-size: 14px;
  font-weight: 500;
  color: #c0392b;
}
.error:empty { margin: 0; min-height: 0; }

.actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.btn {
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  border-radius: 999px;
  padding: 15px 22px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .08s ease, opacity .15s ease;
}
.btn:active { transform: scale(.985); }
.btn-primary {
  flex: 1;
  background: var(--primary);
  color: var(--white);
}
.btn-primary[disabled] { opacity: .6; cursor: default; }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
  padding-inline: 18px;
}

.done { text-align: center; padding: 8px 0 4px; }
.done-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
  color: var(--deep);
}
.done-text {
  margin: 0;
  font-size: 16px;
  color: var(--muted);
}

/* ---------- calendly ---------- */
.calendly-wrap {
  position: relative;
  margin: 20px -20px 0;
  height: 1060px;           /* spazio pieno finché Calendly non comunica la sua altezza */
  transition: height .25s ease;
}
.calendly-wrap[hidden] { display: none; }
.calendly-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  transition: opacity .3s ease;
}
.calendly-wrap.is-ready .calendly-frame { opacity: 1; }
.calendly-loading {
  position: absolute;
  inset: 0;
  margin: 0;
  padding-top: 60px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}
.calendly-fallback {
  margin: 12px 0 0;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
}
/* ---------- richiamo agli altri servizi, sopra il form ---------- */
.altri {
  margin-top: 22px;
}
.altri[hidden] { display: none; }
.altri h3 {
  margin: 0 0 10px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
.altri ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.altri li {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: #fbfaf8;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
}

/* Con il calendario aperto la pagina è solo calendario */
body.is-booking .landing-media,
body.is-booking .eyebrow,
body.is-booking h1,
body.is-booking .sub,
body.is-booking .benefits,
body.is-booking .altri { display: none; }
body.is-booking .form-block {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.scheduled {
  margin-top: 8px;
  padding: 22px 4px 6px;
  text-align: center;
}

.reassure {
  margin: 16px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}

/* ---------- footer ---------- */
.footer {
  padding: 22px 20px calc(28px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  background: var(--cream);
  border-top: 1px solid var(--line);
}
.footer p { margin: 0 0 6px; }

/* ---------- desktop ---------- */
@media (min-width: 860px) {
  .landing {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 44px;
    max-width: 1080px;
    margin: 36px auto 48px;
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
  }
  .landing-media {
    position: sticky;
    top: 32px;
    aspect-ratio: 1 / 1;
    border-radius: 16px;
  }
  .landing-body { padding: 0; }
  .calendly-wrap { margin: 20px 0 0; height: 800px; }

  body.is-booking .landing {
    grid-template-columns: 1fr;
    max-width: 940px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
