/* ==========================================================================
   FinanceFlow — Landing · Sezioni
   ========================================================================== */

.sr-only {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.dim { color: var(--text-2); }
.positivo { color: var(--positive); }

/* ---- Wordmark (specchia BrandHeader dell'app: tutto attaccato, Flow in gradiente) ---- */
.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  color: var(--text-1);
  letter-spacing: -0.01em;
}
.wordmark b { font-weight: 600; }

/* ======================= NAV ======================= */
.nav {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 50;
  background: rgba(0, 4, 43, 0.72);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 64px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-links {
  display: flex;
  gap: 28px;
  margin-inline: auto;
}
.nav-links a {
  color: var(--text-2);
  font-size: 15px;
  font-weight: 500;
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--text-1); }
.nav-cta { height: 40px; padding-inline: 20px; font-size: 14px; }

/* ======================= AURORA (sfondo hero, replica AuroraBackground) ======================= */
.aurora {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.aurora i {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
}
.aurora .a1 {
  width: 60vw; height: 60vw;
  right: -18vw; top: -22vw;
  background: radial-gradient(circle, rgba(8, 255, 255, 0.42), transparent 65%);
  animation: deriva 16s ease-in-out infinite alternate;
}
.aurora .a2 {
  width: 46vw; height: 46vw;
  right: 8vw; top: 6vw;
  background: radial-gradient(circle, rgba(155, 12, 255, 0.36), transparent 65%);
  animation: deriva 20s ease-in-out infinite alternate-reverse;
}
.aurora .a3 {
  width: 34vw; height: 34vw;
  left: -10vw; top: 30%;
  background: radial-gradient(circle, rgba(0, 165, 255, 0.28), transparent 65%);
  animation: deriva 24s ease-in-out infinite alternate;
}
.aurora .a4 {
  width: 30vw; height: 30vw;
  right: 30vw; bottom: -10vw;
  background: radial-gradient(circle, rgba(255, 32, 255, 0.16), transparent 65%);
}
@keyframes deriva {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-4vw, 3vw, 0) scale(1.08); }
}

/* ======================= HERO ======================= */
.hero {
  position: relative;
  padding-top: 150px;
  padding-bottom: 40px;
  background: linear-gradient(180deg, var(--aurora-base) 0%, var(--canvas) 78%);
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: 48px;
}
.hero-copy .lead { margin-top: 22px; max-width: 46ch; }
.hero-copy .eyebrow { margin-bottom: 18px; }

/* Lista d'attesa */
.waitlist {
  display: flex;
  /* Il messaggio di errore va a capo sotto il campo invece di comprimerlo:
     senza `wrap`, un `flex-basis: 100%` su un terzo figlio schiaccia input e
     bottone a pochi pixel. */
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
  max-width: 460px;
}
.waitlist input {
  flex: 1;
  min-width: 0;
  height: 52px;
  padding-inline: 20px;
  border-radius: var(--r-pill);
  border: 1px solid var(--glass-border);
  background: var(--glass-fill);
  color: var(--text-1);
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease;
}
.waitlist input::placeholder { color: var(--text-3); }
.waitlist input:focus { border-color: var(--teal); }
.waitlist .btn { flex-shrink: 0; }
.waitlist.inviata input, .waitlist.inviata .btn { display: none; }
.waitlist .grazie {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 22px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(91, 247, 175, 0.4);
  color: var(--positive);
  font-weight: 500;
}
/* L'invio non riuscito: la form resta compilabile (`.inviata` non viene
   aggiunta) e il messaggio scende sotto, su tutta la larghezza. Non e' una
   pillola come la conferma: e' una riga di testo, perche' contiene un
   indirizzo email che deve poter andare a capo. */
.waitlist .grazie.errore {
  flex-basis: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--pink);
  font-weight: 400;
  line-height: 1.5;
}

/* Il campo trappola per i bot. Non `display:none`: parte degli script lo
   riconosce e salta il campo, mentre un campo fuori schermo lo compilano.
   `tabindex="-1"` e `aria-hidden` lo tolgono a tastiera e screen reader. */
.esca {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.microcopy {
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--text-3);
}
.microcopy strong { color: var(--text-2); }

/* Device mockup */
.hero-devices {
  position: relative;
  height: 620px;
  perspective: 1400px;
}
.phone {
  width: 300px;
  padding: 10px;
  border-radius: 48px;
  background: var(--nav-surface);
  border: 1px solid var(--nav-border);
  box-shadow: 0 24px 44px rgba(0, 2, 20, 0.5);
}
.phone img, .phone video {
  width: 100%;
  height: auto;
  border-radius: 38px;
  aspect-ratio: 720 / 1557;
  object-fit: cover;
}
.hero-devices .phone { position: absolute; }
.hero-devices .phone-front {
  left: 8%;
  top: 0;
  z-index: 2;
  transform: rotateY(-8deg) rotateX(2deg);
}
.hero-devices .phone-back {
  left: 46%;
  top: 72px;
  width: 270px;
  transform: rotateY(-14deg) rotateX(2deg) scale(0.96);
  opacity: 0.85;
}
.hero-devices .phone-back img { filter: brightness(0.8); }

/* ======================= TRUST STRIP ======================= */
.trust {
  padding-block: 44px;
  border-block: 1px solid var(--outline-variant);
  background: var(--background);
}
.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}
.trust-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 14px;
  color: var(--text-3);
  line-height: 1.5;
}
.trust-item strong { color: var(--text-1); font-weight: 600; font-size: 15px; }
.trust-item .icona { color: var(--periwinkle); margin-top: 2px; }

/* ======================= PROBLEMA ======================= */
.problema-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}
.problema em { font-style: normal; color: var(--teal); }

/* ======================= FEATURE TABS ======================= */
.pilastri { background: var(--background); }
.pilastri .h2 { margin-top: 12px; max-width: 22ch; }
.tabs {
  display: flex;
  gap: 6px;
  margin-top: 44px;
  padding: 6px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  border-radius: var(--r-pill);
  border: 1px solid var(--glass-border);
  background: var(--glass-fill);
}
.tab {
  padding: 10px 24px;
  border-radius: var(--r-pill);
  font-weight: 500;
  font-size: 15px;
  color: var(--text-2);
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}
.tab:hover { color: var(--text-1); }
.tab.active {
  background: var(--teal);
  color: var(--on-secondary);
}
.tab-panels { margin-top: 48px; }
.tab-panel {
  display: none;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 64px;
  align-items: center;
}
.tab-panel.active { display: grid; animation: apparizione 0.4s ease; }
@keyframes apparizione {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
.panel-copy .h3 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.02em; }
.checks {
  list-style: none;
  padding: 0;
  margin-top: 24px;
  display: grid;
  gap: 16px;
  color: var(--text-2);
}
.checks li {
  position: relative;
  padding-left: 32px;
}
.checks li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 16px;
  height: 16px;
  background: var(--teal);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M4 12.5l5.5 5.5L20 6.5'/%3E%3C/svg%3E") no-repeat center / contain;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M4 12.5l5.5 5.5L20 6.5'/%3E%3C/svg%3E") no-repeat center / contain;
}
.tab-panel .phone { width: 280px; }

/* ======================= BENTO ======================= */
.bento-sezione .h2 { margin-top: 12px; }
.bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 52px;
}
.cella {
  padding: 32px;
  border-radius: var(--r-xl);
  border: 1px solid var(--glass-border);
  background: linear-gradient(180deg, var(--surface-low), var(--surface));
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.6;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.cella:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, 0.2); }
.cella-label {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--periwinkle);
  margin-bottom: 14px;
}
.cella-salute { grid-row: span 1; }
.salute-score {
  font-size: 56px;
  line-height: 1;
  color: var(--text-1);
}
.salute-su { font-size: 22px; color: var(--text-3); }
.salute-barra {
  height: 6px;
  margin-block: 18px;
  border-radius: var(--r-pill);
  background: var(--surface-highest);
  overflow: hidden;
}
.salute-barra i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: var(--grad-budget);
  transform: scaleX(var(--p, 0));
  transform-origin: left;
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.insight-demo {
  margin: 0 0 14px;
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: rgba(33, 228, 223, 0.07);
  color: var(--text-1);
}
.insight-demo cite {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-size: 12px;
  color: var(--text-3);
}
.whatif-demo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.chip {
  padding: 6px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--outline-variant);
  font-size: 13px;
  color: var(--text-2);
}
.chip-attiva {
  border-color: var(--teal);
  color: var(--teal);
}
.delta { font-weight: 700; font-size: 15px; }
.privacy-importo { font-size: 34px; color: var(--text-1); margin-bottom: 12px; }
.privacy-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 8px 18px;
  border-radius: var(--r-pill);
  border: 1px solid var(--glass-border);
  background: var(--glass-fill);
  font-size: 14px;
  color: var(--text-1);
  transition: border-color 0.15s ease;
}
.privacy-toggle:hover { border-color: var(--teal); }
.privacy-toggle[aria-pressed="true"] { border-color: var(--teal); color: var(--teal); }
.advisor-domanda {
  padding: 12px 18px;
  margin-bottom: 14px;
  border-radius: var(--r-lg) var(--r-lg) var(--r-lg) 4px;
  background: var(--surface-highest);
  color: var(--text-1);
  font-size: 14px;
  width: fit-content;
}

/* ======================= RECAP ======================= */
.recap { background: var(--background); }
.recap-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 72px;
  align-items: center;
}
.recap .h2 { margin-top: 12px; }
.recap .lead { margin-top: 20px; max-width: 50ch; }
.recap .btn { margin-top: 28px; }
.recap-card {
  width: 340px;
  padding: 28px;
  border-radius: var(--r-xl);
  background: linear-gradient(160deg, var(--surface-high), var(--surface-low));
  box-shadow: 0 16px 36px rgba(0, 2, 20, 0.45);
}
.recap-card header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}
.recap-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.recap-hero {
  font-size: 44px;
  line-height: 1.15;
  color: var(--text-1);
}
.recap-delta { font-size: 13px; font-weight: 500; margin-top: 4px; }
.recap-righe {
  margin-top: 24px;
  display: grid;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--glass-border);
}
.recap-righe .riga {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-2);
}
.recap-righe b { color: var(--text-1); font-weight: 500; }
.recap-card footer {
  margin-top: 24px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: rgba(33, 228, 223, 0.08);
  border: 1px solid rgba(33, 228, 223, 0.25);
  font-size: 13px;
  color: var(--teal);
}

/* ======================= SICUREZZA ======================= */
.sicurezza-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 72px;
  align-items: center;
}
.sicurezza .phone { width: 280px; }
.sicurezza .h2 { margin-top: 12px; }
.scudi {
  list-style: none;
  padding: 0;
  margin-top: 32px;
  display: grid;
  gap: 18px;
  color: var(--text-2);
  font-size: 15.5px;
  line-height: 1.6;
}
.scudi li {
  padding-left: 34px;
  position: relative;
}
.scudi li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 18px;
  height: 18px;
  background: var(--periwinkle);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M12 3l7 3v6c0 4.4-3 7.6-7 9-4-1.4-7-4.6-7-9V6l7-3z'/%3E%3C/svg%3E") no-repeat center / contain;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M12 3l7 3v6c0 4.4-3 7.6-7 9-4-1.4-7-4.6-7-9V6l7-3z'/%3E%3C/svg%3E") no-repeat center / contain;
}
.scudi b { color: var(--text-1); }

/* ======================= PIANI ======================= */
.piani { background: var(--background); text-align: center; }
.piani .h2 { margin-top: 12px; margin-inline: auto; }
.piani-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 420px));
  justify-content: center;
  gap: 24px;
  margin-top: 52px;
  text-align: left;
}
.piano {
  padding: 36px;
  border-radius: var(--r-xl);
}
.piano-sub { color: var(--text-3); font-size: 14px; margin-top: 6px; }
.piano .checks { margin-top: 26px; font-size: 15px; }
.piano-pro {
  border-color: rgba(33, 228, 223, 0.4);
  background: linear-gradient(180deg, rgba(33, 228, 223, 0.06), var(--glass-fill));
}
.piani-nota {
  margin-top: 36px;
  font-size: 14px;
  color: var(--text-3);
  max-width: 62ch;
  margin-inline: auto;
}

/* ======================= FAQ ======================= */
.faq-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 64px;
  align-items: start;
}
.faq-lista { display: grid; gap: 12px; }
.faq details {
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  background: var(--glass-fill);
  overflow: hidden;
}
.faq summary {
  padding: 20px 24px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 52px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  font-weight: 300;
  color: var(--teal);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p {
  padding: 0 24px 22px;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.65;
}

/* ======================= FINALE ======================= */
.finale {
  position: relative;
  text-align: center;
  background: linear-gradient(180deg, var(--canvas) 0%, var(--aurora-base) 100%);
  overflow: hidden;
}
.aurora-bassa .a1 { top: auto; bottom: -30vw; right: 10vw; opacity: 0.35; }
.aurora-bassa .a2 { top: auto; bottom: -20vw; right: auto; left: 5vw; opacity: 0.3; }
.finale-inner { position: relative; display: grid; justify-items: center; }
.finale-logo { margin-bottom: 28px; }
.finale .lead { margin-top: 16px; }
.finale .waitlist { margin-top: 32px; width: min(460px, 100%); }

/* ======================= FOOTER ======================= */
.footer {
  padding-block: 48px;
  border-top: 1px solid var(--outline-variant);
  background: var(--background);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.footer-brand p { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.footer-links { display: flex; gap: 24px; }
.footer-links a { color: var(--text-3); font-size: 14px; }
.footer-links a:hover { color: var(--text-1); }
.footer-note { font-size: 13px; color: var(--text-3); }

/* ======================= STICKY CTA (solo mobile) ======================= */
.sticky-cta {
  display: none;
  position: fixed;
  inset-inline: 16px;
  bottom: 16px;
  z-index: 40;
}
.sticky-cta .btn { width: 100%; }

/* ======================= RESPONSIVE ======================= */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-devices { height: auto; min-height: 560px; margin-top: 24px; }
  .hero-devices .phone-front { left: 4%; }
  .hero-devices .phone-back { left: 50%; }
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
  .problema-inner, .recap-inner, .sicurezza-inner, .faq-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .sicurezza-inner .phone { order: 2; justify-self: center; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .tab-panel { grid-template-columns: 1fr; gap: 40px; }
  .tab-panel .phone { justify-self: center; }
  .recap-card { justify-self: center; }
}

@media (max-width: 640px) {
  :root { --section-y: 72px; }
  .nav-links { display: none; }
  .nav-cta { margin-left: auto; }
  .hero { padding-top: 116px; }
  .waitlist { flex-direction: column; }
  .waitlist .btn { width: 100%; }
  .hero-devices { min-height: 480px; }
  .phone { width: 240px !important; }
  .hero-devices .phone-back { top: 56px; opacity: 0.6; }
  .trust-grid { grid-template-columns: 1fr; gap: 20px; }
  .bento { grid-template-columns: 1fr; }
  .piani-grid { grid-template-columns: 1fr; }
  .recap-card { width: 100%; max-width: 340px; }
  .sticky-cta { display: block; }
  .footer { padding-bottom: 96px; } /* spazio per la sticky CTA */
}
