/* Polaris – homepage dell'associazione.
   Stessi colori, carattere e sfondo animato dell'app, sempre in versione notte ("Notte stellata"). */
:root {
  --navy: #0B2350;
  --text: #EEF3FA;
  --soft: #C4D2E6;
  --accent: #8ED2F5;
  --accent-hover: #B5E1F8;
  --on-accent: #0B2350;
  --line: rgba(142, 210, 245, .28);
  --panel: rgba(11, 35, 80, .9);   /* riquadri quasi pieni: il cielo animato resta intorno, non dietro al testo */
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--navy); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: transparent;
}
/* Immagine ferma: resta se il mare animato non parte o se si riduce il movimento */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--navy) url("img/sfondo.webp") center bottom / cover no-repeat;
}
@media (max-width: 600px) { body::before { background-image: url("img/sfondo-small.webp"); } }
/* Mare in movimento (js/sea.js): quando parte, sostituisce l'immagine */
#sea-bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; pointer-events: none; }
html.sea-on body::before { display: none; }

/* Una sola lingua alla volta */
html[data-lang="it"] [lang="en"],
html[data-lang="en"] [lang="it"] { display: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

a, button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* Barra in alto */
.bar {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 1rem clamp(1.25rem, 5vw, 3.5rem);
}
.bar-home { display: block; line-height: 0; border-radius: 6px; }
.bar-name { display: block; height: 2.75rem; width: auto; padding: .3rem .5rem; background: #1F55B5; border-radius: 4px; }  /* scritta su fondo blu reale, come nel logo */
.bar-nav { margin-left: auto; display: flex; gap: .25rem; }
.bar-nav a {
  color: var(--soft); text-decoration: none; font-size: .9375rem;
  padding: .5rem .75rem; border-radius: 999px; min-height: 44px; display: inline-flex; align-items: center;
}
.bar-nav a:hover { color: var(--text); background: rgba(255, 255, 255, .08); }

.lang { display: flex; gap: .25rem; }
.lang button {
  font: inherit;
  font-size: .9375rem;
  color: var(--soft);
  background: none;
  border: 0;
  padding: .5rem .75rem;
  min-height: 44px;
  border-radius: 999px;
  cursor: pointer;
}
.lang button[aria-pressed="true"] { color: var(--on-accent); background: var(--accent); font-weight: 500; }
.lang button:not([aria-pressed="true"]):hover { color: var(--text); }

/* Prima schermata */
main { flex: 1; width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 clamp(1.25rem, 5vw, 3.5rem); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
  padding: clamp(2rem, 7vw, 5.5rem) 0 clamp(3rem, 8vw, 6rem);
}
h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2.125rem, 5.2vw, 3.75rem);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.lead { margin: 0 0 2.25rem; max-width: 34rem; color: var(--soft); font-size: 1.1875rem; }

.actions { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; }
.button {
  display: inline-block;
  padding: .9rem 1.6rem;
  font-weight: 500;
  font-size: 1.0625rem;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 999px;
  text-decoration: none;
  transition: background-color .15s;
}
.button:hover { background: var(--accent-hover); }
.note { margin: 0; color: var(--soft); font-size: .9375rem; }

@keyframes rise {
  from { transform: translateY(14px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

/* Sezioni: ogni blocco è un pannello di vetro, così il testo resta leggibile sul mare */
html { scroll-behavior: smooth; }
.block, .closing { scroll-margin-top: 1rem; }
.block {
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1.25rem, 4vw, 3rem);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.block-head { max-width: 40rem; margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
h2 { margin: 0 0 .75rem; font-size: clamp(1.625rem, 3.4vw, 2.375rem); line-height: 1.15; font-weight: 600; letter-spacing: -.015em; }
.block-head p { margin: 0; color: var(--soft); font-size: 1.125rem; }

/* Una funzione: schermata dell'app e spiegazione, a lati alterni */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 23rem) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 5vw, 4rem);
  padding: clamp(1.25rem, 3vw, 2rem) 0;
  border-top: 1px solid var(--line);
}
.feature:nth-of-type(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 23rem); }
.feature:nth-of-type(even) .phone { order: 2; }
.feature-text h3 { margin: 0 0 .6rem; font-size: clamp(1.25rem, 2.4vw, 1.625rem); line-height: 1.2; font-weight: 500; }
.feature-text p { margin: 0; max-width: 34rem; color: var(--soft); }

.phone { margin: 0; justify-self: center; width: 100%; max-width: 23rem; }
.phone img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 780 / 1520;
  background: #0B2350;
  border: 7px solid #060f24;
  border-radius: 34px;
  box-shadow: 0 0 0 1px var(--line), 0 24px 50px rgba(0, 0, 0, .4);
}

.facts { margin: 0; padding: 0; list-style: none; max-width: 44rem; }
.facts li { padding: 1rem 0; border-top: 1px solid var(--line); color: var(--soft); }
.facts li:first-child { border-top: 0; padding-top: 0; }

/* Invito finale */
.closing {
  margin-bottom: clamp(3rem, 8vw, 6rem);
  padding: clamp(1rem, 3vw, 2rem) 0;
  display: flex; flex-direction: column; align-items: flex-start; gap: 1rem;
}
.closing h2 { margin: 0; }

footer {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem clamp(1.25rem, 5vw, 3.5rem) 2rem;
  color: var(--soft);
  font-size: .9375rem;
}

/* telefono e tablet: le voci del menu vanno su una riga sotto il logo, scorrevole col dito */
@media (max-width: 900px) {
  .bar { flex-wrap: wrap; row-gap: .4rem; }
  .bar-home { margin-right: auto; }
  .bar-nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    padding-bottom: .1rem; mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .bar-nav::-webkit-scrollbar { display: none; }
  .bar-nav a { flex: none; background: rgba(255, 255, 255, .06); }
}
@media (max-width: 760px) {
  .bar-name { height: 2rem; }
  .hero { grid-template-columns: 1fr; }
  .feature, .feature:nth-of-type(even) { grid-template-columns: 1fr; gap: 1.25rem; }
  .feature:nth-of-type(even) .phone { order: 0; }
  .phone { max-width: 15rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button { transition: none; }
}

/* pulsante secondario (contatti) e titolo dei contatti */
.button.secondary { background: transparent; color: var(--text, #fff); border: 1.5px solid currentColor; }
.button.secondary:hover { background: rgba(255, 255, 255, .08); }
.contact-title { margin: 1.5rem 0 0; font-size: 1.25rem; }
footer p { margin: .25rem 0; }
footer a { color: inherit; }
/* Apertura in una colonna: emblema, titolo evidenziato in blu reale, testo e pulsante */
.hero-text { max-width: 42rem; }
.hero-emblem { display: block; width: clamp(9rem, 22vw, 16rem); height: auto; margin: 0 0 1.75rem;
  filter: drop-shadow(0 18px 30px rgba(5, 18, 48, .5)); animation: rise 1.2s cubic-bezier(.2, .7, .2, 1) both; }
.hero .lead { margin-top: 0; }
@media (prefers-reduced-motion: reduce) { .hero-emblem { animation: none; } }

/* Salto al contenuto, per chi usa la tastiera o un lettore di schermo */
.skip { position: absolute; left: -999px; top: .5rem; z-index: 10; padding: .5rem 1rem; background: var(--accent); color: var(--on-accent); border-radius: .5rem; }
.skip:focus { left: .5rem; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Come funziona: tre passi numerati, perché sono davvero una sequenza */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: clamp(1.25rem, 3vw, 2.5rem); }
.steps li { counter-increment: step; position: relative; padding-left: 3.25rem; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 2.25rem; height: 2.25rem; border-radius: 50%; border: 1.5px solid var(--accent); color: var(--accent); display: grid; place-items: center; font-weight: 600; }
.steps h3 { margin: .3rem 0 .4rem; font-size: 1.1875rem; font-weight: 500; }
.steps p { margin: 0; color: var(--soft); }
.install { margin: 1.75rem 0 0; max-width: 40rem; color: var(--soft); }

/* Domande frequenti */
.faq details { max-width: 44rem; border-top: 1px solid var(--line); }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 1rem 2.25rem 1rem 0; font-weight: 500; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: .25rem; top: .8rem; font-size: 1.4rem; line-height: 1; color: var(--accent); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 1.1rem; color: var(--soft); max-width: 40rem; }
.privacy .more { margin-top: 1.25rem; }
.privacy .more a { color: var(--accent); }

/* Piè di pagina */
.foot-cols { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem 3rem; }
.foot-links { display: flex; flex-direction: column; gap: .4rem; }
.foot-links a { text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }
footer .copy { margin-top: 1.25rem; opacity: .75; }

/* Pagine legali: informativa privacy e condizioni d'uso */
.legal { max-width: 46rem; margin: 0 auto; padding: 1rem clamp(1rem, 4vw, 2rem) 3rem; }
.legal h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); line-height: 1.15; margin: 1.5rem 0 .5rem; }
.legal h2 { font-size: 1.25rem; margin: 2.25rem 0 .5rem; scroll-margin-top: 5rem; }
.legal h3 { font-size: 1.0625rem; margin: 1.25rem 0 .25rem; }
.legal p, .legal li { color: var(--soft); }
.legal strong { color: var(--text); font-weight: 500; }
.legal a { color: var(--accent); }
.legal .meta { font-size: .9375rem; }
.legal .toc { padding-left: 1.75rem; columns: 2 16rem; column-gap: 3rem; }
.legal .toc li { break-inside: avoid; margin-bottom: .2rem; }
.legal table { width: 100%; border-collapse: collapse; margin: .75rem 0 1rem; font-size: .9375rem; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: .55rem .6rem; border-bottom: 1px solid var(--line); color: var(--soft); }
.legal th { color: var(--text); font-weight: 500; }
.legal .box { border-left: 3px solid var(--accent); padding: .6rem 1rem; background: var(--panel); border-radius: .25rem; }
@media (max-width: 640px) {
  .legal table, .legal tbody, .legal tr, .legal td { display: block; width: 100%; }
  .legal thead { display: none; }
  .legal tr { border-bottom: 1px solid var(--line); padding: .5rem 0; }
  .legal td { border: 0; padding: .15rem 0; }
  .legal td:first-child { color: var(--text); font-weight: 500; }
}
/* Pagine di testo: sfondo pieno, il mare disturberebbe la lettura */
body.plain::before { background: var(--navy); }

/* Velo dietro il testo d'apertura: le navi dello sfondo passano dietro senza disturbare la lettura */
.hero-text { position: relative; }
.hero-text::before { content: ""; position: absolute; inset: -1rem -1.25rem; z-index: -1; border-radius: 1.25rem;
  background: radial-gradient(ellipse at 40% 50%, rgba(8, 26, 61, .62), rgba(8, 26, 61, .38) 70%, rgba(8, 26, 61, 0)); pointer-events: none; }
.hero h1, .hero .lead { text-shadow: 0 1px 10px rgba(4, 14, 36, .65); }

/* Schermate ingrandibili */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.phone .zoom { display: block; position: relative; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 34px; }
.phone .zoom-hint { position: absolute; right: .9rem; bottom: .9rem; width: 2.75rem; height: 2.75rem; border-radius: 50%; display: grid; place-items: center;
  font-size: 1.25rem; color: var(--text); background: rgba(11, 35, 80, .78); border: 1px solid var(--line); }
.lightbox { padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; cursor: zoom-out; }
.lightbox::backdrop { background: rgba(4, 12, 30, .9); }
.lightbox img { display: block; margin: 0 auto; height: 100vh; max-width: 100vw; object-fit: contain; padding: 3.5rem 1rem 1rem; box-sizing: border-box; }
.lightbox-close { position: fixed; top: 1rem; right: 1rem; min-height: 44px; padding: .5rem 1rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--navy); color: var(--text); font: inherit; cursor: pointer; }

/* "Avvisami all'apertura" (fino al lancio) */
.notify { margin: 1.25rem 0 0; max-width: 32rem; }
.notify label { display: block; font-weight: 500; margin-bottom: .45rem; }
.notify-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.notify input[type="email"] { flex: 1 1 14rem; min-height: 44px; padding: .5rem .85rem; border-radius: .6rem; border: 1px solid var(--line);
  background: rgba(4, 14, 36, .6); color: var(--text); font: inherit; }
.notify input[type="email"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.notify .button { min-height: 44px; }
.notify .trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.notify-note { margin: .5rem 0 0; font-size: .875rem; color: var(--soft); }
.notify-note a { color: var(--accent); display: inline-block; padding: .35rem 0; }
.notify-msg { margin: .5rem 0 0; min-height: 1.4em; font-weight: 500; }
.notify-msg.ok { color: #7EE2A8; }
.notify-msg.err { color: #FFB4A8; }

/* Link comodi da toccare col dito (almeno 44 px di altezza), anche con le mani fredde o con la nave che si muove */
footer a, .foot-links a, .privacy .more a, .notify-note a, .legal .toc a { display: inline-flex; align-items: center; min-height: 44px; }
.foot-links { gap: 0; }
footer p { margin: .25rem 0; }
