/* ============================================================
   Landing "Budget Control" — premium / futuristic / dark
   Caricata SOLO sulla homepage pubblica (vedi public_home.html).
   Tutte le classi sono prefissate con .lp- per non toccare il resto.
   ============================================================ */

:root {
  /* Palette (richiesta) */
  --lp-bg: #050816;
  --lp-bg-2: #0B1020;
  --lp-glass: rgba(255, 255, 255, 0.06);
  --lp-glass-2: rgba(255, 255, 255, 0.09);
  --lp-border: rgba(255, 255, 255, 0.12);
  --lp-text: #F8FAFC;
  --lp-text-2: #94A3B8;
  --lp-cyan: #22D3EE;
  --lp-violet: #8B5CF6;
  --lp-green: #22C55E;
  --lp-yellow: #FACC15;
  --lp-red: #FB7185;

  --lp-radius: 18px;
  --lp-radius-sm: 12px;
  --lp-maxw: 1120px;
  --lp-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Override del layout globale solo per la landing ---- */
body.landing {
  background: var(--lp-bg);
  color: var(--lp-text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* la .main globale ha max-width/padding pensati per l'app: li azzeriamo */
body.landing .main.landing-main {
  max-width: none;
  margin: 0;
  padding: 0;
  overflow: clip;
}
body.landing a { color: inherit; text-decoration: none; }

/* =============== Sfondo futuristico (decorativo) =============== */
.lp-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(1200px 700px at 78% -10%, rgba(139, 92, 246, 0.18), transparent 60%),
    radial-gradient(1000px 600px at 10% 0%, rgba(34, 211, 238, 0.12), transparent 55%),
    linear-gradient(180deg, var(--lp-bg) 0%, var(--lp-bg-2) 100%);
}
.lp-grid {
  position: absolute;
  inset: -2px;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 46px 46px;
  /* dissolvenza verso i bordi per non avere una griglia "piatta" */
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 35%, transparent 80%);
          mask-image: radial-gradient(120% 90% at 50% 0%, #000 35%, transparent 80%);
}
.lp-orb {
  position: absolute;
  width: 46vw;
  max-width: 620px;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
}
.lp-orb--cyan { top: -8%; right: -6%; background: radial-gradient(circle, var(--lp-cyan), transparent 65%); }
.lp-orb--violet { bottom: -16%; left: -10%; background: radial-gradient(circle, var(--lp-violet), transparent 65%); }

/* ===================== Tipografia landing ===================== */
.lp-h1 {
  margin: 0;
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: var(--lp-text);
}
.lp-h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3.6vw, 2.3rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: var(--lp-text);
}
.lp-grad {
  background: linear-gradient(100deg, var(--lp-cyan), var(--lp-violet));
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.lp-sub { font-size: clamp(1.02rem, 1.7vw, 1.2rem); color: var(--lp-text); opacity: 0.92; margin: 0; }
.lp-micro { font-size: 0.95rem; color: var(--lp-text-2); margin: 0; }

/* ======================= Sezioni / layout ===================== */
.lp-section {
  position: relative;
  z-index: 1;
  max-width: var(--lp-maxw);
  margin-inline: auto;
  padding: clamp(56px, 9vw, 110px) 20px;
}
.lp-section__head { max-width: 720px; margin: 0 auto clamp(28px, 4vw, 48px); text-align: center; }
.lp-section__sub { margin: 14px 0 0; color: var(--lp-text-2); font-size: clamp(1rem, 1.6vw, 1.12rem); line-height: 1.55; }

/* =========================== HERO ============================= */
.lp-hero {
  position: relative;
  z-index: 1;
  max-width: var(--lp-maxw);
  margin-inline: auto;
  min-height: min(92vh, 860px);
  display: grid;
  grid-template-columns: 1fr;
  align-content: center;
  gap: clamp(34px, 6vw, 56px);
  padding: clamp(84px, 12vh, 132px) 20px clamp(48px, 7vw, 72px);
}
.lp-hero__text { display: flex; flex-direction: column; gap: 18px; max-width: 620px; }

.lp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 7px 14px;
  border: 1px solid var(--lp-border);
  background: var(--lp-glass);
  border-radius: 999px;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--lp-text-2);
  backdrop-filter: blur(8px);
}
.lp-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--lp-green);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}

/* ---- Bottoni ---- */
.lp-cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; }
.lp-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  overflow: hidden;
  transition: transform 0.25s var(--lp-ease), box-shadow 0.25s var(--lp-ease),
    background 0.25s var(--lp-ease), border-color 0.25s var(--lp-ease);
  will-change: transform;
}
.lp-btn--primary {
  color: #04121a;
  background: linear-gradient(100deg, var(--lp-cyan), var(--lp-violet));
  box-shadow: 0 10px 30px -10px rgba(34, 211, 238, 0.6);
}
/* effetto "shine" che attraversa il bottone all'hover */
.lp-btn--primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.55) 50%, transparent 75%);
  transform: translateX(-130%);
  transition: transform 0.7s var(--lp-ease);
}
.lp-btn--ghost {
  color: var(--lp-text);
  background: var(--lp-glass);
  border-color: var(--lp-border);
  backdrop-filter: blur(8px);
}
.lp-btn--lg { padding: 16px 34px; font-size: 1.06rem; }
.lp-btn:hover { transform: translateY(-2px); }
.lp-btn--primary:hover { box-shadow: 0 16px 40px -10px rgba(139, 92, 246, 0.75); }
.lp-btn--primary:hover::before { transform: translateX(130%); }
.lp-btn--ghost:hover { background: var(--lp-glass-2); border-color: rgba(255, 255, 255, 0.25); }
.lp-btn span { position: relative; z-index: 1; }

/* ====================== Mockup dashboard ====================== */
.lp-mockup {
  position: relative;
  border: 1px solid var(--lp-border);
  background: linear-gradient(160deg, var(--lp-glass-2), var(--lp-glass));
  border-radius: var(--lp-radius);
  padding: 18px;
  backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.lp-mockup__bar { display: flex; align-items: center; gap: 7px; margin-bottom: 16px; }
.lp-mockup__dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); }
.lp-mockup__dot:nth-child(1) { background: var(--lp-red); opacity: 0.7; }
.lp-mockup__dot:nth-child(2) { background: var(--lp-yellow); opacity: 0.7; }
.lp-mockup__dot:nth-child(3) { background: var(--lp-green); opacity: 0.7; }

.lp-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--lp-border);
}
.lp-badge__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.lp-badge--ok { color: var(--lp-green); background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.3); }
.lp-badge--track { color: var(--lp-cyan); background: rgba(34, 211, 238, 0.12); border-color: rgba(34, 211, 238, 0.3); }

.lp-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lp-kpi {
  border: 1px solid var(--lp-border);
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--lp-radius-sm);
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.lp-kpi__label { font-size: 0.74rem; color: var(--lp-text-2); }
.lp-kpi__value { font-size: 1.18rem; font-weight: 700; letter-spacing: -0.01em; }
.lp-kpi__value--ok { color: var(--lp-green); }

.lp-cats { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.lp-cat__top { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--lp-text-2); margin-bottom: 6px; }

/* ---- Barre (riutilizzate ovunque) ---- */
.lp-bar { height: 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.lp-bar--mini { height: 7px; margin-top: 10px; }
.lp-bar__fill {
  display: block;
  height: 100%;
  width: var(--w, 50%);
  border-radius: inherit;
  transform-origin: left center;
  background: linear-gradient(90deg, var(--lp-cyan), var(--lp-violet));
}
.lp-bar__fill--alt { background: linear-gradient(90deg, var(--lp-violet), var(--lp-cyan)); }
.lp-bar__fill--warn { background: linear-gradient(90deg, var(--lp-yellow), var(--lp-red)); }

/* ========================= BENEFICI =========================== */
.lp-grid3 { display: grid; grid-template-columns: 1fr; gap: 18px; }
.lp-card {
  position: relative;
  border: 1px solid var(--lp-border);
  background: var(--lp-glass);
  border-radius: var(--lp-radius);
  padding: 24px 22px;
  backdrop-filter: blur(10px);
  transition: transform 0.3s var(--lp-ease), border-color 0.3s var(--lp-ease),
    box-shadow 0.3s var(--lp-ease), background 0.3s var(--lp-ease);
}
.lp-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.22);
  background: var(--lp-glass-2);
  box-shadow: 0 24px 60px -28px rgba(34, 211, 238, 0.35);
}
.lp-icon {
  display: inline-flex;
  width: 44px; height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  margin-bottom: 16px;
  color: var(--lp-cyan);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.22);
}
.lp-icon svg { width: 22px; height: 22px; }
.lp-card__title { margin: 0 0 8px; font-size: 1.12rem; font-weight: 700; color: var(--lp-text); }
.lp-card__text { margin: 0; color: var(--lp-text-2); line-height: 1.55; font-size: 0.96rem; }

/* ======================= FUNZIONALITÀ ========================= */
.lp-grid2 { display: grid; grid-template-columns: 1fr; gap: 18px; }
.lp-feature {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid var(--lp-border);
  background: var(--lp-glass);
  border-radius: var(--lp-radius);
  padding: 24px 22px;
  backdrop-filter: blur(10px);
  transition: transform 0.3s var(--lp-ease), border-color 0.3s var(--lp-ease),
    box-shadow 0.3s var(--lp-ease), background 0.3s var(--lp-ease);
}
.lp-feature:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.22);
  background: var(--lp-glass-2);
  box-shadow: 0 24px 60px -28px rgba(139, 92, 246, 0.4);
}
.lp-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--lp-cyan);
  margin-bottom: 10px;
}
.lp-feature__viz { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
.lp-chip {
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--lp-text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--lp-border);
}

/* ========================= CTA FINALE ========================= */
.lp-cta { padding-top: clamp(20px, 4vw, 40px); }
.lp-cta-card {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
  padding: clamp(36px, 6vw, 64px) clamp(24px, 5vw, 56px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 28px;
  background: linear-gradient(160deg, var(--lp-glass-2), rgba(11, 16, 32, 0.6));
  backdrop-filter: blur(16px);
  overflow: hidden;
  box-shadow: 0 40px 120px -40px rgba(139, 92, 246, 0.55);
}
/* bordo glow */
.lp-cta-glow {
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, var(--lp-cyan), var(--lp-violet), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
.lp-cta-card .lp-h2 { position: relative; }
.lp-cta-card .lp-section__sub { max-width: 560px; margin-inline: auto; }
.lp-cta-card .lp-btn { margin-top: 26px; }
.lp-cta-micro { margin-top: 16px; }

/* ============================================================
   ANIMAZIONI — attive solo se l'utente non ha richiesto
   "riduci movimento". Tutto basato su transform + opacity.
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  /* griglia di sfondo: movimento lentissimo e impercettibile */
  .lp-grid { animation: lp-grid-pan 32s linear infinite; }
  .lp-orb--cyan { animation: lp-float-a 18s ease-in-out infinite; }
  .lp-orb--violet { animation: lp-float-b 22s ease-in-out infinite; }

  /* scroll reveal: stato iniziale nascosto + transizione */
  [data-reveal] {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s var(--lp-ease), transform 0.7s var(--lp-ease);
    transition-delay: calc(var(--d, 0) * 80ms);
  }
  [data-reveal].is-visible { opacity: 1; transform: none; }

  /* mockup: entrata con leggero scale */
  .lp-mockup { transform: translateY(26px) scale(0.97); }
  .lp-mockup.is-visible { transform: none; }

  /* barre: riempimento animato quando il contenitore entra in viewport */
  .lp-bar__fill { transform: scaleX(0); transition: transform 0.9s var(--lp-ease); transition-delay: calc(0.15s + var(--d, 0) * 0.12s); }
  .is-visible .lp-bar__fill,
  .lp-card.is-visible .lp-bar__fill { transform: scaleX(1); }
  /* le barre statiche dentro le card benefici/feature si riempiono col reveal della card */
}

@keyframes lp-grid-pan {
  from { background-position: 0 0, 0 0; }
  to { background-position: 46px 46px, 46px 46px; }
}
@keyframes lp-float-a {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-26px, 30px); }
}
@keyframes lp-float-b {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(30px, -24px); }
}

/* ===================== Accessibilità focus ==================== */
body.landing a:focus-visible,
body.landing .lp-btn:focus-visible,
.lp-features:focus-visible {
  outline: 2px solid var(--lp-cyan);
  outline-offset: 3px;
  border-radius: 12px;
}
.lp-features:focus { outline: none; } /* target dello smooth-scroll: niente bordo "click" */

/* ========================= Responsive ========================= */
/* Tablet+: hero a 2 colonne, benefici a 3, feature 2x2 */
@media (min-width: 760px) {
  .lp-grid2 { grid-template-columns: 1fr 1fr; }
  .lp-feature { flex-direction: row; align-items: stretch; }
  .lp-feature__main { flex: 1; }
  .lp-feature__viz { justify-content: center; min-width: 132px; margin-top: 0; }
}
@media (min-width: 900px) {
  .lp-hero { grid-template-columns: 1.05fr 0.95fr; align-items: center; }
  .lp-grid3 { grid-template-columns: repeat(3, 1fr); }
}

/* Mobile: bottoni quasi a tutta larghezza */
@media (max-width: 540px) {
  .lp-cta-row { flex-direction: column; }
  .lp-cta-row .lp-btn { width: 100%; }
  .lp-kpi__value { font-size: 1.05rem; }
}

/* Riduzione movimento: niente float/parallax, tutto subito visibile.
   (Le regole "nascondi/anima" stanno nel blocco no-preference qui sopra,
   quindi in reduce gli elementi restano nel loro stato finale naturale.) */
@media (prefers-reduced-motion: reduce) {
  .lp-btn, .lp-card, .lp-feature { transition: none; }
}
