/* ==========================================================================
   Open Day Liceo Foppa — stili (v2, look moderno)
   ========================================================================== */

:root {
  /* Palette originale della landing */
  --blue: #2568ae;
  --blue-dark: #1a4a7b;
  --cta: #0071ba;
  --cta-dark: #005287;
  --ink: #13141c;
  --white: #fff;
  /* Tinte chiare del blu per gli sfondi */
  --blue-50: #eef4fb;
  --blue-100: #dce8f6;

  --text: var(--ink);
  --radius-sm: 16px;
  --radius: 28px;
  --radius-lg: 40px;
  --shadow: 0 24px 48px -24px rgba(19, 20, 28, .35);
  --shadow-sm: 0 10px 24px -12px rgba(19, 20, 28, .25);
  --container: 1200px;
  --gutter: 20px;
  --section-y: clamp(64px, 9vw, 120px);
  --font: "Mulish", "Muli", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

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

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

body {
  margin: 0;
  overflow-x: hidden;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3 {
  margin: 0 0 .5em;
  font-family: var(--font);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.015em;
  color: var(--ink);
}

p { margin: 0 0 1.1em; }

a { color: inherit; }

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

.text-center { text-align: center; }

/* Evidenziatore stile "pennarello" */
.hl {
  background: linear-gradient(transparent 60%, rgba(37, 104, 174, .22) 60%, rgba(37, 104, 174, .22) 92%, transparent 92%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding: 0 .08em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 14px 28px;
  border: 2px solid transparent;
  border-radius: 999px;
  font-family: var(--font);
  font-weight: 800;
  font-size: 17px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease),
              transform .25s var(--ease), box-shadow .25s var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn--large { min-height: 60px; padding: 18px 34px; font-size: 19px; }

.btn-icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .25s var(--ease);
}
.btn:hover .btn-icon { transform: translateX(4px); }

.btn--primary { background: var(--cta); border-color: var(--cta); color: var(--white); }
.btn--primary:hover { background: var(--cta-dark); border-color: var(--cta-dark); }

.btn--light { background: var(--white); border-color: var(--white); color: var(--blue); }
.btn--light:hover { background: var(--blue-50); border-color: var(--blue-50); }

.btn--outline { background: transparent; border-color: var(--blue); color: var(--blue); }
.btn--outline:hover { background: var(--blue); color: var(--white); }

.btn:focus-visible,
a:focus-visible { outline: 3px solid var(--cta); outline-offset: 3px; }
.section--blue .btn:focus-visible,
.hero .btn:focus-visible { outline-color: var(--white); }

/* ---------- Barra di avanzamento ---------- */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: 4px;
  pointer-events: none;
}
.scroll-progress span {
  display: block;
  height: 100%;
  background: var(--cta);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  transition: box-shadow .3s ease;
}
.site-header.is-scrolled { box-shadow: 0 6px 24px -12px rgba(19, 20, 28, .25); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 84px;
}
.header-inner--center { justify-content: center; }
.logo img { width: auto; height: 68px; }
.header-cta { min-height: 48px; padding: 12px 22px; font-size: 16px; }

/* ---------- Hero ---------- */
.hero { padding: 0 clamp(8px, 1.5vw, 20px); }
.hero-card {
  position: relative;
  display: flex;
  align-items: flex-end;
  max-width: 1440px;
  min-height: max(560px, calc(100vh - 110px));
  min-height: max(560px, calc(100svh - 110px));
  margin: 4px auto 0;
  padding: clamp(28px, 6vw, 88px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background:
    linear-gradient(105deg, rgba(19, 20, 28, .82) 0%, rgba(37, 104, 174, .5) 55%, rgba(15, 12, 9, .15) 100%),
    url("../assets/img/hero.jpg") center / cover no-repeat;
  color: var(--white);
}
.hero-content { max-width: 820px; padding-bottom: 24px; }
.hero-title {
  margin-bottom: .45em;
  font-size: clamp(40px, 7vw, 88px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -.03em;
  color: var(--white);
}
.hero-title .hl {
  background: linear-gradient(transparent 62%, var(--cta) 62%, var(--cta) 90%, transparent 90%);
}
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 32px;
  font-size: clamp(15px, 1.6vw, 19px);
  font-weight: 700;
  letter-spacing: 0;
  color: var(--white);
}
.chip {
  display: inline-block;
  padding: 8px 16px;
  border: 1.5px solid rgba(255, 255, 255, .55);
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.scroll-hint {
  position: absolute;
  right: clamp(24px, 4vw, 56px);
  bottom: clamp(24px, 4vw, 56px);
  width: 30px;
  height: 48px;
  border: 2px solid rgba(255, 255, 255, .8);
  border-radius: 999px;
}
.scroll-hint span {
  position: absolute;
  top: 9px;
  left: 50%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--white);
  animation: scroll-dot 1.8s ease-in-out infinite;
}
@keyframes scroll-dot {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ---------- Nastro animato ---------- */
.marquee {
  position: relative;
  z-index: 2;
  width: 110%;
  margin: -28px 0 0 -5%;
  padding: 16px 0;
  overflow: hidden;
  background: var(--cta);
  color: var(--white);
  transform: rotate(-1.5deg);
  box-shadow: var(--shadow-sm);
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 28px;
  width: max-content;
  font-size: clamp(20px, 2.6vw, 30px);
  font-weight: 800;
  white-space: nowrap;
  animation: marquee 32s linear infinite;
}
.marquee-track i { font-style: normal; opacity: .7; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sezioni ---------- */
.section { position: relative; padding: var(--section-y) 0; }
.section--flush-top { padding-top: 0; }
.section--blue { background: var(--blue); color: var(--white); }
.section--blue h2,
.section--blue p { color: var(--white); }
.section--blue .hl { background: linear-gradient(transparent 60%, rgba(255, 255, 255, .22) 60%, rgba(255, 255, 255, .22) 92%, transparent 92%); }
.section--rounded {
  margin: 0 clamp(8px, 1.5vw, 20px);
  border-radius: var(--radius-lg);
}

.section-title {
  font-size: clamp(30px, 4.2vw, 50px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -.025em;
}
.section-title--xl { font-size: clamp(34px, 5vw, 60px); }

.section-head {
  max-width: 720px;
  margin: 0 auto clamp(36px, 5vw, 56px);
  text-align: center;
}

.lead { font-size: clamp(17px, 1.6vw, 20px); }

/* Layout testo + immagine */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(36px, 6vw, 88px);
}
.split--wide-text { grid-template-columns: 5fr 6fr; }
.split-text > .btn { margin-top: 8px; }

/* Foto con angoli arrotondati e forme decorative */
.photo { position: relative; isolation: isolate; }
.photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.photo--blob::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -28px;
  right: -28px;
  width: 62%;
  height: 72%;
  background: var(--blue-100);
  border-radius: 42% 58% 60% 40% / 45% 40% 60% 55%;
  animation: blob 12s ease-in-out infinite alternate;
}
.photo--blob-left::before { right: auto; left: -28px; top: auto; bottom: -28px; background: var(--blue); opacity: .9; }
.photo--dots::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -24px;
  bottom: -24px;
  width: 55%;
  height: 55%;
  background-image: radial-gradient(var(--cta) 2.2px, transparent 2.6px);
  background-size: 18px 18px;
  opacity: .55;
}
@keyframes blob {
  0% { border-radius: 42% 58% 60% 40% / 45% 40% 60% 55%; transform: rotate(0); }
  100% { border-radius: 58% 42% 38% 62% / 55% 60% 40% 45%; transform: rotate(8deg); }
}

/* ---------- Bento (sede / università) ---------- */
.bento {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.bento-card {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: clamp(24px, 3.5vw, 40px);
  border-radius: var(--radius-lg);
  background: var(--blue-50);
}
.bento-card p {
  flex: 1;
  margin: 0;
  font-size: clamp(17px, 1.6vw, 20px);
  font-weight: 600;
  line-height: 1.55;
}
.bento-card--blue { background: var(--blue); }
.bento-card--blue p { color: var(--white); }
.bento-card .photo img { box-shadow: none; border-radius: var(--radius-sm); }

/* ---------- Percorsi ---------- */
.courses {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: clamp(36px, 5vw, 56px);
}
.course {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--white);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.course:hover { transform: translateY(-8px); box-shadow: 0 30px 50px -24px rgba(0, 0, 0, .45); }
.course-img { display: block; overflow: hidden; }
.course-img img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform .6s var(--ease);
}
.course:hover .course-img img { transform: scale(1.06); }
.course-body { padding: 24px 28px 32px; }
.course-num {
  display: inline-block;
  margin-bottom: 14px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--blue-50);
  color: var(--cta);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .08em;
}
.section--blue .course h2 { color: var(--ink); font-size: 22px; line-height: 1.25; }
.section--blue .course p { color: var(--ink); font-size: 16px; margin: 0; }

/* ---------- Statement ---------- */
.statement {
  max-width: 1000px;
  margin: 0 auto clamp(56px, 8vw, 104px);
  font-size: clamp(36px, 6.2vw, 76px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -.03em;
  text-align: center;
}
.statement .hl { color: var(--blue); }

/* ---------- Polaroid gallery ---------- */
.polaroids {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(16px, 4vw, 56px);
  margin-top: clamp(28px, 4vw, 48px);
}
.polaroid {
  width: min(44%, 440px);
  margin: 0;
  padding: clamp(8px, 1.2vw, 14px) clamp(8px, 1.2vw, 14px) clamp(32px, 4vw, 56px);
  border-radius: 10px;
  background: var(--white);
  box-shadow: 0 24px 48px -20px rgba(0, 0, 0, .5);
  transition: transform .45s var(--ease);
}
.polaroid img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; }
.polaroid--left { transform: rotate(-4deg); }
.polaroid--right { transform: rotate(3deg) translateY(32px); }
.polaroid:hover { transform: rotate(0) scale(1.03); }

/* ---------- Form ---------- */
.section--form { padding-bottom: clamp(32px, 5vw, 64px); }
.form-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 64px);
  padding: clamp(24px, 5vw, 64px);
  border-radius: var(--radius-lg);
  background: var(--blue-50);
}
.form-intro .photo { margin-top: 28px; }
.form-wrap {
  position: relative;
  min-height: 676px;
  padding: 8px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}
.form-wrap iframe { display: block; position: relative; z-index: 1; border: 0; }
.iframe-loader {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.iframe-loader span {
  width: 42px;
  height: 42px;
  border: 4px solid var(--blue-100);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
.form-wrap.is-loaded .iframe-loader { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Altre scuole ---------- */
.schools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: clamp(36px, 5vw, 56px);
}
.school {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--blue-100);
  border-radius: var(--radius);
  background: var(--white);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.school:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.school-img { overflow: hidden; }
.school-img img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .6s var(--ease); }
.school:hover .school-img img { transform: scale(1.05); }
.school-body { display: flex; flex-direction: column; flex: 1; padding: 28px 32px 32px; }
.school-body h2 { font-size: 26px; }
.school-body p { flex: 1; }
.school-body .btn { align-self: flex-start; }

/* ---------- Footer ---------- */
.site-footer {
  margin: clamp(32px, 5vw, 64px) clamp(8px, 1.5vw, 20px) 0;
  padding: 32px 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--blue);
  text-align: center;
}
.site-footer p { margin: 0; font-size: 14px; color: var(--white); }
.site-footer a { color: var(--white); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ---------- CTA flottante (mobile) ---------- */
.floating-cta {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 55;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 20px;
  border-radius: 999px;
  background: var(--cta);
  color: var(--white);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 12px 30px -8px rgba(0, 113, 186, .6);
  transform: translateY(160%);
  transition: transform .35s var(--ease);
}
.floating-cta.is-visible { transform: translateY(0); }

/* ---------- Thank you page ---------- */
.hero-card--center { align-items: center; justify-content: center; min-height: 0; text-align: center; padding-top: clamp(56px, 9vw, 120px); padding-bottom: clamp(56px, 9vw, 120px); }
.hero-card--center .hero-content { margin: 0 auto; padding: 0; }
.ty-title { font-size: clamp(34px, 5.5vw, 64px); }
.ty-lead { font-size: clamp(17px, 2vw, 20px); color: var(--white); }

.ty-check { width: 88px; height: 88px; margin: 0 auto 28px; }
.ty-check svg { width: 100%; height: 100%; }
.ty-check circle { fill: var(--cta); }
.ty-check path {
  fill: none;
  stroke: var(--white);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: ty-draw .6s .4s ease forwards;
}
@keyframes ty-draw { to { stroke-dashoffset: 0; } }

.ty-card {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  max-width: 860px;
  margin: 0 auto;
}
.ty-card h2 { font-size: 26px; margin-bottom: .3em; }
.ty-card p { font-weight: 400; }

.ty-gallery { margin-bottom: clamp(36px, 5vw, 56px); }
.ty-gallery .photo img { box-shadow: 0 24px 48px -20px rgba(0, 0, 0, .45); }

/* ---------- Animazioni reveal ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .courses .reveal:nth-child(2),
.js .schools .reveal:nth-child(2),
.js .bento .reveal:nth-child(2) { transition-delay: .12s; }
.js .courses .reveal:nth-child(3) { transition-delay: .24s; }
.js .polaroid--left.reveal { transform: rotate(-4deg) translateY(28px); }
.js .polaroid--right.reveal { transform: rotate(3deg) translateY(60px); }
.js .polaroid--left.reveal.is-visible { transform: rotate(-4deg); }
.js .polaroid--right.reveal.is-visible { transform: rotate(3deg) translateY(32px); }
.js .polaroid.reveal.is-visible:hover { transform: rotate(0) scale(1.03); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .marquee-track,
  .photo--blob::before,
  .scroll-hint span { animation: none; }
  .ty-check path { animation: none; stroke-dashoffset: 0; }
  .btn, .course, .school, .polaroid, .course-img img, .school-img img, .floating-cta { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .courses { grid-template-columns: 1fr; max-width: 560px; margin-left: auto; margin-right: auto; }
  .split,
  .split--wide-text,
  .form-panel { grid-template-columns: 1fr; }
  .split-media { max-width: 640px; }
}

@media (max-width: 767px) {
  body { font-size: 16px; }
  :root { --gutter: 16px; }
  html { scroll-padding-top: 72px; }
  .header-inner { min-height: 68px; }
  .logo img { height: 52px; }
  .header-cta { min-height: 42px; padding: 10px 16px; font-size: 14px; }
  .header-cta .btn-icon { display: none; }
  .hero-card { min-height: 78svh; border-radius: var(--radius); }
  .hero-content .btn { width: 100%; }
  .scroll-hint { display: none; }
  .marquee { margin-top: -20px; padding: 12px 0; }
  .bento,
  .schools { grid-template-columns: 1fr; }
  .section--rounded { border-radius: var(--radius); }
  .split-text > .btn,
  .section--blue .btn--large { width: 100%; }
  .photo--blob::before { top: -16px; right: -12px; }
  .photo--blob-left::before { left: -12px; bottom: -16px; top: auto; }
  .photo--dots::before { left: -12px; bottom: -12px; }
  .polaroid--right { transform: rotate(3deg) translateY(20px); }
  .form-panel { border-radius: var(--radius); padding: 16px; }
  .form-intro { padding: 12px 8px 0; }
  .ty-card { flex-direction: column; align-items: flex-start; }
  .ty-card .btn,
  .ty-actions .btn { width: 100%; }
  .floating-cta { display: flex; }
  .site-footer { padding-bottom: 96px; border-radius: var(--radius) var(--radius) 0 0; }
  .page-thankyou .site-footer { padding-bottom: 32px; }
}
