/* =========================================================
   Webinar genitori – Istituto Piamarta · AFM RIM 4+2
   Stile ripreso da landing.istitutopiamarta.it
   Mobile first
   ========================================================= */

:root {
  --primary: #14695D;   /* verde Piamarta */
  --primary-dark: #08302A;
  --secondary: #0177BE; /* blu RIM 4+2 */
  --accent: #F9EB12;    /* giallo */
  --petrol: #034C68;
  --sage: #A0C2CA;
  --cream: #EFF1BD;
  --bg: #FFFFFF;
  --bg-soft: #F4F8F7;
  --text: #1A1A1A;
  --container: 1240px;
  --gutter: 20px;
  --header-h: 64px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .btn, .eyebrow, .hero-eyebrow, .brand {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
b, strong { font-weight: 700; }

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

/* ---------- Segnaposto ben visibili ---------- */
.ph {
  background: #FFE14D;
  color: #7A1E00 !important;
  outline: 2px dashed #D0021B;
  outline-offset: 1px;
  padding: 0 .3em;
  border-radius: 3px;
  font-weight: 700;
}

/* ---------- Bottoni ---------- */
.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--petrol);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .02em;
  text-decoration: none;
  text-align: center;
  padding: 16px 30px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
  min-height: 48px;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(3, 76, 104, .25); }
.btn:focus-visible { outline: 3px solid var(--secondary); outline-offset: 3px; }

.btn--primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 24px rgba(20, 105, 93, .30);
}
.btn--primary:hover { background: #0F5A4F; }

.btn--sm { padding: 10px 18px; font-size: .85rem; min-height: 40px; }

/* ---------- Header ---------- */
header.site {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--primary);
}
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--header-h);
}
.logo-link { display: inline-flex; }
.logo { height: 46px; width: auto; margin: 8px 0; }

/* ---------- Hero ---------- */
#hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: 56px 0 64px;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: url("../img/quadriennale-1.jpg") center / cover no-repeat;
}
.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 48, 42, .90) 0%, rgba(8, 48, 42, .82) 60%, rgba(20, 105, 93, .78) 100%);
}
.hero-inner { position: relative; z-index: 1; }

.hero-eyebrow {
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: .75rem;
  margin: 0 0 18px;
}
#hero h1 {
  font-weight: 900;
  font-size: clamp(2.4rem, 10vw, 4.6rem);
  line-height: 1;
  letter-spacing: -.03em;
  margin: 0 0 16px;
}
.hero-topic {
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: clamp(1.2rem, 4.4vw, 1.9rem);
  line-height: 1.25;
  letter-spacing: -.01em;
  margin: 0 0 18px;
  max-width: 34ch;
}
.hero-topic em { font-style: normal; color: var(--accent); }
.hero-sub {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, .9);
  margin: 0 0 28px;
}

/* Dettagli evento (data / ora / piattaforma) */
.event-info {
  list-style: none;
  padding: 0;
  margin: 0 0 30px;
  display: grid;
  gap: 10px;
}
.event-info li {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 10px;
  padding: 12px 16px;
}
.event-info svg {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.event-info small {
  display: block;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .8;
  line-height: 1.3;
}
.event-info strong { font-size: 1.05rem; line-height: 1.35; }

#hero .btn { width: 100%; }

/* ---------- Percorso quadriennale ---------- */
section { padding: 64px 0; }

.banner {
  background: var(--secondary);
  color: #fff;
  text-align: center;
  padding: 28px 20px;
  border-radius: 6px;
  margin-bottom: 28px;
}
.banner h2 {
  margin: 0 auto;
  font-weight: 900;
  font-size: clamp(1.4rem, 4.6vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -.01em;
  max-width: 26ch;
}
.lead {
  font-family: "Inter", sans-serif;
  font-weight: 700;
  color: var(--secondary);
  font-size: clamp(1.1rem, 3.6vw, 1.45rem);
  line-height: 1.35;
  text-align: center;
  margin: 0 auto 36px;
  max-width: 40ch;
}

.q-photos {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 36px;
}
.q-text { text-align: left; }
.q-text p { margin: 0 0 1.6em; color: var(--text); }
.photo-frame {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .12);
  background: var(--bg-soft);
  aspect-ratio: 3 / 2;
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }

.cta-inline {
  margin-top: 44px;
  text-align: center;
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 28px 20px;
}
.cta-inline p {
  font-family: "Inter", sans-serif;
  font-weight: 700;
  color: var(--petrol);
  font-size: 1.1rem;
  margin: 0 0 16px;
}

/* ---------- Cosa significa 4+2 ---------- */
#cosa-significa-4piu2 { background: var(--petrol); color: #fff; }

h2.sec {
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1.08;
  font-size: clamp(1.9rem, 6vw, 3.2rem);
  margin: 0 0 .6em;
}
h2.sec--sm { font-size: clamp(1.4rem, 4.4vw, 2.3rem); margin-top: 52px; }

.cols { display: grid; gap: 16px; }
.compare-card {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  padding: 28px 24px;
}
.compare-card .big {
  font-family: "Inter", sans-serif;
  font-weight: 900;
  font-size: clamp(3.2rem, 12vw, 5.5rem);
  line-height: .9;
  letter-spacing: -.03em;
  color: var(--accent);
  margin-bottom: .12em;
}
.compare-card h3 { font-weight: 900; font-size: 1.2rem; margin: 0 0 .5em; }
.compare-card p { margin: 0; color: rgba(255, 255, 255, .82); }

.after-text p { color: rgba(255, 255, 255, .88); margin: 0 0 1em; }
.btnwrap { text-align: center; margin-top: 36px; }
.btnwrap .btn { width: 100%; }

/* ---------- Form ---------- */
#form { background: var(--bg-soft); }
.form-wrap { display: grid; gap: 28px; }

.eyebrow {
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--primary);
  font-size: .75rem;
  margin: 0 0 12px;
}
#form h2.sec { color: var(--primary); }
.form-intro > p { margin: 0 0 18px; }
.form-recap { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.form-recap li { line-height: 1.5; }

/* Form di iscrizione in iframe: altezza fissa per evitare la barra di scorrimento interna */
.form-iframe {
  display: block;
  width: 100%;
  height: 1100px;
  border: 0;
  background: #fff;
  border-radius: 10px;
}

/* ---------- Footer ---------- */
footer.site { background: var(--sage); padding: 40px 0 110px; }
footer.site .inner {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
}
footer.site .brand { font-weight: 900; font-size: 1.25rem; color: var(--petrol); }
footer.site p { margin: 0; color: var(--petrol); font-size: .92rem; }

/* ---------- CTA fissa mobile ---------- */
.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 -6px 20px rgba(0, 0, 0, .12);
  transform: translateY(110%);
  transition: transform .3s ease;
}
.sticky-cta .btn { width: 100%; background: var(--primary); color: #fff; }
.sticky-cta.is-visible { transform: none; }

/* ---------- Pagina grazie ---------- */
.page-thanks { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.page-thanks footer.site { padding-bottom: 40px; }
#thanks {
  flex: 1;
  padding: 48px 0 64px;
  background: linear-gradient(180deg, var(--bg-soft) 0%, #fff 100%);
}
.thanks-card {
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  border-top: 6px solid var(--primary);
  box-shadow: 0 18px 40px rgba(3, 76, 104, .12);
  padding: 36px 22px;
  text-align: center;
}
.thanks-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.thanks-icon svg {
  width: 38px;
  height: 38px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.thanks-card h1 {
  font-weight: 900;
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  line-height: 1.12;
  letter-spacing: -.02em;
  color: var(--primary);
  margin: 0 0 14px;
}
.thanks-lead { margin: 0 auto 24px; max-width: 52ch; }

.thanks-card h1 + .event-info--light { margin-top: 24px; }
.event-info--light li { justify-content: center; text-align: left; }
.event-info--light li { background: var(--bg-soft); border-color: rgba(20, 105, 93, .18); }
.event-info--light svg { stroke: var(--primary); }

.meet-box {
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  padding: 26px 20px;
  margin: 0 0 20px;
}
.meet-title {
  font-family: "Inter", sans-serif;
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--accent);
  margin: 0 0 8px;
}
.meet-box p { margin: 0 0 18px; }
.meet-box .btn { width: 100%; }
@media (min-width: 600px) {
  .meet-box { padding: 30px 32px; }
  .meet-box .btn { width: auto; }
}

.thanks-notice {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  text-align: left;
  background: var(--cream);
  border-radius: 10px;
  padding: 16px 18px;
  margin: 0 0 28px;
  color: var(--petrol);
}
.thanks-notice svg {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--petrol);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-top: 2px;
}
.thanks-notice p { margin: 0; }
.thanks-notice small { display: inline-block; margin-top: 6px; opacity: .85; }

/* =========================================================
   Effetti
   ========================================================= */

/* Header: ombra leggera dopo lo scroll + barra di avanzamento */
header.site { transition: box-shadow .3s ease; }
header.site.is-scrolled { box-shadow: 0 6px 20px rgba(3, 76, 104, .10); }
.scroll-progress {
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

/* Hero: entrata a cascata dei contenuti e lento zoom dello sfondo */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
@keyframes heroZoom {
  from { transform: scale(1.08); }
  to   { transform: scale(1); }
}
.hero-bg { animation: heroZoom 9s ease-out both; }
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.hero-inner > * { animation: fadeUp .7s cubic-bezier(.2, .7, .2, 1) backwards; }
.hero-inner > :nth-child(1) { animation-delay: .10s; }
.hero-inner > :nth-child(2) { animation-delay: .20s; }
.hero-inner > :nth-child(3) { animation-delay: .32s; }
.hero-inner > :nth-child(4) { animation-delay: .44s; }
.hero-inner > :nth-child(5) { animation-delay: .56s; }
.hero-inner > :nth-child(6) { animation-delay: .68s; }

/* Invito a scorrere */
#hero { padding-bottom: 110px; }
@keyframes cueBounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(6px); }
}
.scroll-cue {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: rgba(255, 255, 255, .85);
  text-decoration: none;
  font-family: "Inter", sans-serif;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  animation: fadeIn .8s .9s backwards;
}
.scroll-cue svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: cueBounce 1.8s ease-in-out 1.6s infinite;
}
.scroll-cue:hover { color: #fff; }

/* Comparsa delle sezioni allo scroll */
.js-on .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1);
}
.js-on .reveal.is-in { opacity: 1; transform: none; }

/* Foto: leggero zoom-out mentre compaiono, una dopo l'altra */
.js-on .reveal .photo-frame img {
  transform: scale(1.1);
  transition: transform 1.4s cubic-bezier(.2, .7, .2, 1);
}
.js-on .reveal.is-in .photo-frame img { transform: scale(1); }
.js-on .reveal .photo-frame:nth-child(2),
.js-on .reveal .photo-frame:nth-child(2) img { transition-delay: .15s; }

/* Numeri 4 e +2: piccolo "pop" all'arrivo */
@keyframes pop {
  0%   { transform: scale(.6); opacity: 0; }
  70%  { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); }
}
.compare-card .big { transform-origin: left bottom; }
.js-on .compare-card.is-in .big { animation: pop .7s .15s cubic-bezier(.2, .7, .2, 1) both; }

/* Hover discreto su card e foto (solo dispositivi con mouse) */
@media (hover: hover) {
  .compare-card { transition: transform .3s ease, border-color .3s ease, background-color .3s ease; }
  .compare-card:hover {
    transform: translateY(-4px);
    border-color: rgba(249, 235, 18, .45);
    background: rgba(255, 255, 255, .09);
  }
  .js-on .reveal.is-in .photo-frame:hover img { transform: scale(1.04); }
}

@media (min-width: 900px) {
  #hero { padding-bottom: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-bg, .hero-inner > *, .scroll-cue, .scroll-cue svg,
  .js-on .compare-card.is-in .big { animation: none; }
  .js-on .reveal, .js-on .reveal .photo-frame img { opacity: 1; transform: none; transition: none; }
  .btn, .sticky-cta, .compare-card { transition: none; }
}

/* =========================================================
   Tablet / desktop
   ========================================================= */
@media (min-width: 600px) {
  :root { --gutter: 28px; }
  .event-info { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .event-info--light { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #hero .btn, .btnwrap .btn { width: auto; }
  .cols { grid-template-columns: 1fr 1fr; gap: 24px; }
  .q-photos { grid-template-columns: 1fr 1fr; gap: 20px; }
  .thanks-card { padding: 48px 44px; }
}

@media (min-width: 900px) {
  :root { --header-h: 84px; }
  body { font-size: 18px; }
  .logo { height: 64px; }
  .btn--sm { padding: 12px 24px; font-size: .92rem; }
  section { padding: 96px 0; }

  #hero { padding: 110px 0 120px; }
  .hero-scrim {
    background: linear-gradient(100deg, rgba(8, 48, 42, .90) 0%, rgba(8, 48, 42, .74) 62%, rgba(20, 105, 93, .35) 100%);
  }
  .hero-sub { font-size: 1.25rem; }
  .event-info { max-width: 860px; }

  .banner { padding: 44px 40px; margin-bottom: 36px; }
  .q-photos { gap: 28px; margin-bottom: 52px; }

  .form-wrap { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 56px; align-items: start; }
  .form-iframe { height: 900px; }

  footer.site { padding-bottom: 40px; }
  .sticky-cta { display: none; }
}
