/* Landing page pubblica — Mensa Scolastica
   Palette: verde istituzionale (marchio) + ambra calda come accento. Contrasti testo >= 4.5:1.
   Gli effetti grafici sono in fondo al file, nella sezione EFFETTI, e rispettano prefers-reduced-motion. */

:root {
  --g-900: #062f26; --g-800: #073f33; --g-700: #0b5c4a; --g-600: #0f7a62; --g-100: #e3f1ec; --g-50: #f2f8f5;
  --amber: #f2a71b; --amber-ink: #7a4b00; --amber-soft: #fff3d6;
  --ink: #16201d; --muted: #4f5d58; --line: #dbe4e0; --bg: #ffffff; --bg-alt: #f5f8f6;
  --ok: #17663a; --ok-bg: #e4f3ea; --off: #a1251b; --off-bg: #fbe6e4;
  --radius: 18px; --shadow: 0 18px 40px -18px rgba(6, 47, 38, .35); --focus: #ffbf47;
  font-family: "Titillium Web", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body.lp { margin: 0; line-height: 1.6; font-size: 1.0625rem; background: var(--bg); overflow-x: hidden; }
a { color: var(--g-700); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
img, svg { display: block; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .6rem; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }
.skip { position: absolute; left: -999px; top: 0; background: var(--focus); color: #000; padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
main:focus { outline: none; }
.lp-wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.lp-muted { color: var(--muted); font-size: .9rem; }

/* ------------------------------------------------------------------ header */
.lp-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid rgba(219, 228, 224, .7); }
.lp-header-in { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; }
.lp-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.15rem; color: var(--g-800); text-decoration: none; }
.lp-brand img { border-radius: 8px; }
.lp-nav { margin-left: auto; }
.lp-nav ul { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.lp-nav a { display: block; padding: .5rem .8rem; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; }
.lp-nav a:hover { background: var(--g-50); color: var(--g-700); }
.lp-menu { display: none; margin-left: auto; position: relative; }
.lp-menu summary { list-style: none; cursor: pointer; padding: .5rem .9rem; border: 1px solid var(--line); border-radius: 999px; font-weight: 600; }
.lp-menu summary::-webkit-details-marker { display: none; }
.lp-menu ul { position: absolute; right: 0; top: calc(100% + 8px); list-style: none; margin: 0; padding: .5rem; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); min-width: 220px; }
.lp-menu a { display: block; padding: .65rem .9rem; border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 600; }
.lp-menu a:hover { background: var(--g-50); }
@media (max-width: 920px) { .lp-nav, .lp-header-cta { display: none; } .lp-menu { display: block; } }

/* ------------------------------------------------------------------ bottoni */
.lp-btn { display: inline-flex; align-items: center; gap: .5rem; padding: .85rem 1.4rem; border-radius: 999px; font-weight: 700; text-decoration: none; border: 2px solid transparent; min-height: 48px; line-height: 1.1; }
.lp-btn-primary { background: var(--g-700); color: #fff; box-shadow: 0 10px 24px -10px rgba(11, 92, 74, .7); }
.lp-btn-primary:hover { background: var(--g-800); color: #fff; }
.lp-btn-ghost { color: var(--g-800); border-color: var(--g-700); background: #fff; }
.lp-btn-ghost:hover { background: var(--g-50); }
.lp-btn-light { background: #fff; color: var(--g-800); }
.lp-btn-light:hover { background: var(--amber-soft); color: var(--g-900); }
.ico { width: 26px; height: 26px; flex: none; }
.ico-sm { width: 20px; height: 20px; }
.ico-xs { width: 18px; height: 18px; }
.ico-lg { width: 40px; height: 40px; color: var(--g-700); margin-bottom: .8rem; }

/* ------------------------------------------------------------------ hero */
.lp-hero { position: relative; padding: clamp(3rem, 7vw, 6rem) 0 clamp(3rem, 6vw, 5rem); background: radial-gradient(1200px 500px at 85% -10%, var(--g-100), transparent 60%), linear-gradient(180deg, var(--g-50), #fff 70%); overflow: hidden; }
.lp-hero-in { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }
@media (max-width: 920px) { .lp-hero-in { grid-template-columns: 1fr; } }
.lp-eyebrow { display: inline-block; font-size: .82rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--g-700); background: var(--g-100); padding: .3rem .75rem; border-radius: 999px; margin-bottom: 1rem; }
.lp-hero h1 { font-size: clamp(2.3rem, 5.6vw, 4rem); color: var(--g-900); }
.lp-accent { background: linear-gradient(90deg, var(--g-700), var(--g-600) 60%, #2c8f5a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lp-lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 38rem; }
.lp-cta-row { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.6rem 0 1.2rem; }
.lp-checks { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; color: var(--muted); font-weight: 600; font-size: .95rem; }
.lp-checks li { display: flex; align-items: center; gap: .35rem; }
.lp-checks .ico { color: var(--g-600); }

/* telefono illustrativo */
.lp-hero-visual { position: relative; display: flex; justify-content: center; padding: 1rem 0 2rem; }
.lp-phone { width: min(320px, 82vw); border-radius: 36px; background: #0d1714; padding: 12px; box-shadow: 0 40px 80px -30px rgba(6, 47, 38, .55), inset 0 0 0 2px #2a3a35; }
.lp-phone-bar { display: flex; justify-content: space-between; align-items: center; background: var(--g-700); color: #fff; padding: .9rem 1rem; border-radius: 24px 24px 0 0; font-weight: 700; font-size: .9rem; }
.lp-pill { background: rgba(255, 255, 255, .18); border-radius: 999px; padding: .1rem .5rem; font-size: .8rem; }
.lp-phone-body { background: #fff; border-radius: 0 0 24px 24px; padding: 1rem; }
.lp-m-title { font-weight: 700; font-size: 1.15rem; margin: 0; }
.lp-m-sub { color: var(--muted); font-size: .85rem; margin: 0 0 .8rem; }
.lp-m-credit { display: grid; grid-template-columns: 1fr auto; align-items: baseline; background: var(--g-100); border-radius: 14px; padding: .7rem .9rem; margin-bottom: .9rem; }
.lp-m-credit span { font-size: .8rem; color: var(--muted); }
.lp-m-credit strong { font-size: 1.5rem; color: var(--g-800); grid-row: 2; }
.lp-m-credit em { font-style: normal; font-size: .8rem; color: var(--muted); grid-row: 2; }
.lp-m-h { font-weight: 700; font-size: .9rem; margin: 0 0 .3rem; }
.lp-m-day { display: flex; justify-content: space-between; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.lp-m-day b { font-size: .75rem; padding: .15rem .55rem; border-radius: 999px; border: 1px solid; }
.lp-m-day .ok { color: var(--ok); background: var(--ok-bg); }
.lp-m-day .off { color: var(--off); background: var(--off-bg); }
.lp-m-btn { margin-top: .9rem; background: var(--g-700); color: #fff; text-align: center; border-radius: 999px; padding: .7rem; font-weight: 700; font-size: .9rem; }
.lp-float { position: absolute; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: .7rem 1rem; display: flex; align-items: center; gap: .6rem; font-size: .85rem; font-weight: 600; max-width: 210px; }
.lp-float strong { font-size: 1.6rem; color: var(--g-700); }
.lp-float-a { left: 0; top: 18%; }
.lp-float-b { right: 0; bottom: 14%; }
.lp-float .dot { width: 10px; height: 10px; border-radius: 50%; background: #1baf7a; box-shadow: 0 0 0 4px rgba(27, 175, 122, .2); flex: none; }
@media (max-width: 520px) { .lp-float-a { left: -4px; top: 4%; } .lp-float-b { right: -4px; bottom: 2%; } }

/* ------------------------------------------------------------------ fascia normativa */
.lp-trust { border-block: 1px solid var(--line); background: #fff; padding: 1.1rem 0; }
.lp-trust .lp-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.4rem; }
.lp-trust p { margin: 0; font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.lp-trust ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.lp-trust li { font-size: .88rem; font-weight: 600; color: var(--g-800); background: var(--g-50); border: 1px solid var(--g-100); border-radius: 999px; padding: .25rem .8rem; }

/* ------------------------------------------------------------------ sezioni */
.lp-section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.lp-alt { background: var(--bg-alt); }
.lp-intro { color: var(--muted); max-width: 46rem; font-size: 1.1rem; margin-bottom: 2.2rem; }
.lp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.lp-two-center { align-items: center; }
@media (max-width: 860px) { .lp-two { grid-template-columns: 1fr; gap: 2rem; } }

.lp-problem h2 { color: var(--g-900); }
.lp-before-after { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.lp-before-after li { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1rem; display: grid; grid-template-columns: auto 1fr; gap: .25rem .7rem; font-size: .98rem; align-items: baseline; }
.lp-ba-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; border-radius: 6px; padding: .1rem .45rem; }
.lp-ba-before { color: var(--off); background: var(--off-bg); }
.lp-ba-after { color: var(--ok); background: var(--ok-bg); }

/* ruoli */
.lp-roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
@media (max-width: 1000px) { .lp-roles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .lp-roles { grid-template-columns: 1fr; } }
.lp-role { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.lp-role-ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--g-100); color: var(--g-700); margin-bottom: 1rem; }
.lp-role-sub { color: var(--muted); font-weight: 600; }
.lp-role ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; font-size: .97rem; }
.lp-role li { display: grid; grid-template-columns: auto 1fr; gap: .5rem; align-items: start; }
.lp-role li .ico { color: var(--g-600); margin-top: .2rem; }

/* timeline */
.lp-timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; counter-reset: passo; position: relative; }
.lp-timeline::before { content: ""; position: absolute; left: 2%; right: 2%; top: 22px; height: 3px; background: linear-gradient(90deg, var(--g-100), var(--g-600), var(--g-100)); border-radius: 3px; }
.lp-timeline li { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 3.2rem 1.1rem 1.2rem; }
.lp-timeline li::before { counter-increment: passo; content: counter(passo); position: absolute; top: 4px; left: 1.1rem; width: 38px; height: 38px; border-radius: 50%; background: var(--g-700); color: #fff; display: grid; place-items: center; font-weight: 700; box-shadow: 0 0 0 6px var(--bg-alt); }
.lp-time { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 700; color: var(--amber-ink); background: var(--amber-soft); border-radius: 999px; padding: .15rem .6rem; margin-bottom: .6rem; }
.lp-timeline p { color: var(--muted); font-size: .95rem; margin: 0; }
@media (max-width: 1000px) {
  .lp-timeline { grid-template-columns: 1fr; padding-left: 0; }
  .lp-timeline::before { left: 34px; right: auto; top: 10px; bottom: 10px; width: 3px; height: auto; background: linear-gradient(180deg, var(--g-100), var(--g-600), var(--g-100)); }
  .lp-timeline li { padding: 1.1rem 1.1rem 1.1rem 4.6rem; }
  .lp-timeline li::before { top: 1rem; left: 15px; }
}

/* liste e card */
.lp-list { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: .9rem; }
.lp-list li { display: grid; grid-template-columns: auto 1fr; gap: .7rem; align-items: start; }
.lp-list .ico { color: var(--g-700); margin-top: .2rem; }
.lp-card-visual { background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 1.6rem; position: relative; max-width: 420px; justify-self: center; width: 100%; }
.lp-cv-title { font-weight: 700; color: var(--g-800); }
.lp-card-visual dl { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; margin: 0 0 1rem; font-size: .95rem; }
.lp-card-visual dt { color: var(--muted); }
.lp-card-visual dd { margin: 0; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .03em; }
.lp-qr { width: 96px; height: 96px; border-radius: 10px; background:
  conic-gradient(from 90deg at 30% 30%, var(--ink) 25%, transparent 0) 0 0 / 24px 24px,
  conic-gradient(from 0deg at 70% 70%, var(--ink) 25%, transparent 0) 6px 12px / 18px 18px, #fff; border: 6px solid #fff; outline: 1px solid var(--line); }
.lp-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
@media (max-width: 900px) { .lp-features { grid-template-columns: 1fr; } }
.lp-features article { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem; }
.lp-features p { color: var(--muted); margin: 0; }

/* sicurezza */
.lp-sec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem 2rem; margin-top: 2rem; }
@media (max-width: 900px) { .lp-sec-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .lp-sec-grid { grid-template-columns: 1fr; } }
.lp-sec-grid > div { border-top: 3px solid var(--g-100); padding-top: 1.1rem; }
.lp-sec-grid .ico { color: var(--g-700); margin-bottom: .6rem; }
.lp-sec-grid p { color: var(--muted); margin: 0; font-size: .97rem; }
.lp-soon { display: inline-block; font-size: .75rem; font-weight: 700; color: var(--amber-ink); background: var(--amber-soft); border-radius: 999px; padding: .05rem .5rem; }

/* integrazioni */
.lp-integr { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
@media (max-width: 900px) { .lp-integr { grid-template-columns: repeat(2, 1fr); } }
.lp-integr li { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 1.1rem; display: flex; flex-direction: column; gap: .3rem; }
.lp-integr span { color: var(--muted); font-size: .9rem; }
.lp-integr .lp-soon { align-self: flex-start; }

/* faq */
.lp-faq-wrap { display: grid; grid-template-columns: .8fr 1.2fr; gap: 3rem; }
@media (max-width: 860px) { .lp-faq-wrap { grid-template-columns: 1fr; gap: 1.5rem; } }
.lp-faq-wrap > div:first-child p { color: var(--muted); }
.lp-faq details { border-bottom: 1px solid var(--line); }
.lp-faq summary { cursor: pointer; list-style: none; padding: 1.1rem 2.2rem 1.1rem 0; font-weight: 700; position: relative; }
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary::after { content: "+"; position: absolute; right: .3rem; top: .85rem; font-size: 1.5rem; color: var(--g-700); font-weight: 400; transition: transform .2s; }
.lp-faq details[open] summary::after { transform: rotate(45deg); }
.lp-faq details p { color: var(--muted); padding-bottom: 1.1rem; margin: 0; }

/* chiusura */
.lp-final { position: relative; overflow: hidden; background: radial-gradient(600px 300px at 15% 0%, rgba(242, 167, 27, .25), transparent 70%), linear-gradient(135deg, var(--g-800), var(--g-700) 55%, var(--g-600)); color: #fff; text-align: center; padding: clamp(3.5rem, 8vw, 5.5rem) 0; }
.lp-final h2 { font-size: clamp(2rem, 4vw, 3rem); }
.lp-final p { max-width: 38rem; margin: 0 auto 1.8rem; color: rgba(255, 255, 255, .9); font-size: 1.1rem; }
.lp-footer { background: var(--g-900); color: rgba(255, 255, 255, .85); padding: 2rem 0; font-size: .92rem; }
.lp-footer-in { display: flex; flex-wrap: wrap; gap: .5rem 2rem; justify-content: space-between; }
.lp-footer p { margin: 0; }
.lp-footer a { color: #fff; }
.lp-footer .lp-muted { color: rgba(255, 255, 255, .7); }

/* sfondi animati HorizonX (canvas WebGL dietro ai contenuti; senza WebGL resta il gradiente CSS) */
.lp-shader { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: 0; transition: opacity 1.2s ease; pointer-events: none; }
.lp-shader.is-ready { opacity: 1; }
.lp-hero-in, .lp-final .lp-wrap { position: relative; z-index: 1; }

/* ================================================================== EFFETTI
   Effetti grafici in CSS nativo, senza dipendenze. Disattivati con prefers-reduced-motion. */
@media (prefers-reduced-motion: no-preference) {
  /* ingresso del titolo e del telefono */
  .lp-hero-text > * { animation: lp-up .8s cubic-bezier(.2, .7, .2, 1) both; }
  .lp-hero-text > :nth-child(2) { animation-delay: .08s; }
  .lp-hero-text > :nth-child(3) { animation-delay: .16s; }
  .lp-hero-text > :nth-child(4) { animation-delay: .24s; }
  .lp-hero-text > :nth-child(5) { animation-delay: .32s; }
  .lp-phone { animation: lp-up 1s .2s cubic-bezier(.2, .7, .2, 1) both, lp-tilt 9s 1.2s ease-in-out infinite alternate; transform-origin: 50% 80%; }
  @keyframes lp-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
  @keyframes lp-tilt { from { transform: rotate(-1.5deg) translateY(0); } to { transform: rotate(1.5deg) translateY(-8px); } }

  /* schede fluttuanti */
  .lp-float-a { animation: lp-float 6s ease-in-out infinite; }
  .lp-float-b { animation: lp-float 7s 1s ease-in-out infinite reverse; }
  @keyframes lp-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
  .lp-float .dot { animation: lp-pulse 2s ease-out infinite; }
  @keyframes lp-pulse { 0% { box-shadow: 0 0 0 0 rgba(27, 175, 122, .5); } 100% { box-shadow: 0 0 0 10px rgba(27, 175, 122, 0); } }

  /* titolo con sfumatura in movimento */
  .lp-accent { background-size: 200% 100%; animation: lp-shine 8s linear infinite; }
  @keyframes lp-shine { to { background-position: -200% 0; } }

  /* sollevamento al passaggio */
  .lp-role, .lp-features article, .lp-integr li, .lp-timeline li, .lp-before-after li { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
  .lp-role:hover, .lp-features article:hover, .lp-integr li:hover, .lp-timeline li:hover, .lp-before-after li:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--g-100); }
  .lp-role:hover .lp-role-ico { background: var(--g-700); color: #fff; transition: background .25s, color .25s; }
  .lp-btn { transition: transform .15s ease, background .2s, box-shadow .2s; }
  .lp-btn:hover { transform: translateY(-2px); }
  .lp-btn .ico { transition: transform .2s; }
  .lp-btn:hover .ico { transform: translateX(3px); }

  /* comparsa allo scorrimento (browser con scroll-driven animations; altrove gli elementi sono già visibili) */
  @supports (animation-timeline: view()) {
    .lp-section h2, .lp-intro, .lp-role, .lp-timeline li, .lp-features article, .lp-sec-grid > div, .lp-integr li, .lp-before-after li, .lp-card-visual, .lp-faq details {
      animation: lp-reveal linear both; animation-timeline: view(); animation-range: entry 5% cover 25%;
    }
    @keyframes lp-reveal { from { opacity: 0; transform: translateY(32px) scale(.98); } to { opacity: 1; transform: none; } }
    .lp-header { animation: lp-header linear both; animation-timeline: scroll(); animation-range: 0 120px; }
    @keyframes lp-header { to { box-shadow: 0 8px 24px -16px rgba(6, 47, 38, .4); } }
  }
}

@media (forced-colors: active) { .lp-accent { color: CanvasText; background: none; } }
