/* Stile allineato alla Suite e a Mini Arcane Suite (frontend/src/index.css): stessi colori, card in vetro,
   pulsanti a gradiente viola/indaco, font Inter e sfondo animato "aurora". */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary: #0b0f17;
  --bg-secondary: #111827;
  --bg-elevated: #1f2937;
  --bg-card: #1e2330;
  --bg-hover: #273042;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #2d3748;
  --border-light: #374151;
  --accent-purple: #7C3AED;
  --accent-indigo: #6366F1;
  --accent-purple-light: #8B5CF6;
  --accent-indigo-light: #818CF8;
  --success: #10b981;
  --radius-card: 16px;
  --radius-button: 10px;
  --max-w: 1120px;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--accent-indigo-light); text-decoration: none; }
a:hover { color: var(--accent-purple-light); }
::selection { background: rgb(124 58 237 / 0.4); }
:focus-visible { outline: 2px solid var(--accent-purple-light); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 200;
  background: var(--accent-purple); color: #fff; padding: .5rem 1rem; border-radius: var(--radius-button);
}
.skip-link:focus { top: 1rem; color: #fff; }

.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 1rem; }
@media (min-width: 640px) { .container { padding: 0 1.5rem; } }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.25rem); font-weight: 700; margin-bottom: .5rem; }
h3 { font-size: 1.1rem; font-weight: 600; }
/* Titoli con il gradiente delle pagine dell'app (.page-title) */
h1, h2 {
  background: linear-gradient(90deg, var(--text-primary) 35%, color-mix(in srgb, var(--text-primary) 45%, var(--accent-purple-light)));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.section-desc { color: var(--text-secondary); margin-bottom: 2rem; max-width: 680px; }

/* ===== SFONDO ANIMATO (come AnimatedBackground.jsx) ===== */
.bg-animated { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-aurora-blob { position: absolute; border-radius: 9999px; filter: blur(100px); will-change: transform; }
.bg-aurora-blob--1 { top: -20vh; left: -10vw; width: 55vw; height: 55vw; background: rgb(124 58 237 / 0.25); animation: aurora-1 26s ease-in-out infinite; }
.bg-aurora-blob--2 { top: 30vh; right: -15vw; width: 50vw; height: 50vw; background: rgb(99 102 241 / 0.2); animation: aurora-2 32s ease-in-out infinite; }
.bg-aurora-blob--3 { bottom: -25vh; left: 20vw; width: 45vw; height: 45vw; background: rgb(139 92 246 / 0.15); animation: aurora-3 22s ease-in-out infinite; }
.bg-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgb(148 163 184 / 0.05) 1px, transparent 1px), linear-gradient(90deg, rgb(148 163 184 / 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 100%);
}
.bg-noise {
  position: absolute; inset: 0; opacity: .035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes aurora-1 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(12vw, 8vh) scale(1.15); } }
@keyframes aurora-2 { 0%, 100% { transform: translate(0, 0) scale(1.1); } 50% { transform: translate(-10vw, -6vh) scale(.9); } }
@keyframes aurora-3 { 0%, 100% { transform: translate(0, 0) scale(.9); } 50% { transform: translate(-6vw, 10vh) scale(1.2); } }

/* ===== CARD (come .card / .card-hover) ===== */
.card {
  background-color: rgb(30 35 48 / 0.75);
  background-image: linear-gradient(180deg, rgb(255 255 255 / 0.03), transparent 40%);
  border: 1px solid rgb(45 55 72 / 0.7);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.2), 0 8px 10px -6px rgb(0 0 0 / 0.2);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: border-color .3s, box-shadow .3s, transform .3s;
}
.card-hover:hover { border-color: rgb(124 58 237 / 0.5); box-shadow: 0 25px 50px -12px rgb(124 58 237 / 0.15); transform: translateY(-2px); }

/* ===== PULSANTI (come .btn-primary / .btn-secondary) ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .625rem 1.1rem; border-radius: var(--radius-button);
  font: inherit; font-weight: 500; font-size: .95rem; line-height: 1.4;
  cursor: pointer; border: 1px solid transparent; text-align: center;
  transition: all .2s;
}
.btn:hover { text-decoration: none; }
.btn--primary {
  color: #fff;
  background-image: linear-gradient(90deg, var(--accent-purple), var(--accent-indigo));
  box-shadow: 0 10px 15px -3px rgb(124 58 237 / 0.25), inset 0 0 0 1px rgb(255 255 255 / 0.1);
}
.btn--primary:hover { color: #fff; background-image: linear-gradient(90deg, var(--accent-purple-light), var(--accent-indigo-light)); box-shadow: 0 10px 15px -3px rgb(124 58 237 / 0.4), inset 0 0 0 1px rgb(255 255 255 / 0.1); }
.btn--outline { color: var(--text-primary); background: var(--bg-elevated); border-color: var(--border); }
.btn--outline:hover { color: var(--text-primary); background: var(--bg-hover); border-color: rgb(124 58 237 / 0.4); }
.btn--lg { padding: .8rem 1.5rem; font-size: 1rem; }
.btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; box-shadow: none; pointer-events: none; }

.badge {
  display: inline-flex; align-items: center; gap: .375rem; padding: .25rem .65rem;
  border-radius: 9999px; font-size: .75rem; font-weight: 500;
  background: rgb(99 102 241 / 0.2); color: var(--accent-indigo-light);
}

/* ===== HEADER / NAV ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgb(11 15 23 / 0.6);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  border-bottom: 1px solid rgb(45 55 72 / 0.7);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 1rem; }
.nav__brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--text-primary); }
.nav__brand:hover { color: var(--text-primary); }
.nav__brand img { width: 32px; height: 32px; filter: drop-shadow(0 0 12px rgb(176 38 255 / 0.4)); }
.nav__links { display: flex; list-style: none; gap: .25rem; }
.nav__links a { display: block; padding: .5rem .75rem; border-radius: var(--radius-button); color: var(--text-secondary); font-size: .9rem; font-weight: 500; }
.nav__links a:hover { color: var(--text-primary); background: var(--bg-hover); }
.nav__actions { display: flex; gap: .75rem; }
.nav__toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; background: none; border: none; cursor: pointer; padding: 8px; border-radius: var(--radius-button);
}
.nav__toggle:hover { background: var(--bg-hover); }
.nav__toggle span { display: block; width: 24px; height: 2px; background: var(--text-primary); border-radius: 2px; }

@media (max-width: 900px) {
  .nav__toggle { display: flex; }
  .nav__links {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; padding: .75rem 1rem 1rem;
    background: var(--bg-primary); border-bottom: 1px solid var(--border); box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.4);
  }
  .nav__links.open { display: flex; }
  .nav__actions { display: none; }
}

/* ===== HERO ===== */
.hero { padding: 4.5rem 0 3rem; text-align: center; }
.hero .badge { margin-bottom: 1.25rem; }
.hero h1 { max-width: 820px; margin: 0 auto; }
.hero__subtitle { color: var(--text-secondary); max-width: 660px; margin: 1.25rem auto 2rem; font-size: 1.1rem; }
.hero__buttons { display: flex; justify-content: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 3.5rem; }

/* Anteprima della dashboard (assets/dashboard-preview.svg) in una cornice tipo finestra */
.hero__preview { max-width: 980px; margin: 0 auto; padding: 0; overflow: hidden; }
.hero__preview-bar { display: flex; gap: 6px; padding: 10px 14px; border-bottom: 1px solid rgb(45 55 72 / 0.7); background: rgb(17 24 39 / 0.6); }
.hero__preview-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--border-light); }
.hero__preview-bar span:first-child { background: var(--accent-purple); }
.hero__preview img { width: 100%; height: auto; }

@media (max-width: 600px) {
  .hero { padding: 3rem 0 2rem; }
  .hero__buttons { flex-direction: column; align-items: stretch; }
}

/* ===== SEZIONI ===== */
main section[id] { padding: 4rem 0; }
.section--alt { background: rgb(17 24 39 / 0.35); border-top: 1px solid rgb(45 55 72 / 0.4); border-bottom: 1px solid rgb(45 55 72 / 0.4); }

/* App */
.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 1.25rem; }
.app-card__icon {
  width: 48px; height: 48px; padding: 10px; margin-bottom: 1rem; border-radius: 12px;
  color: var(--accent-purple-light); background: rgb(124 58 237 / 0.12); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.1);
}
.app-card__icon svg { width: 100%; height: 100%; }
.app-card h3 { margin-bottom: .5rem; }
.app-card p { color: var(--text-secondary); font-size: .92rem; }

/* Online o Desktop */
.compare-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.compare-col { padding: 2rem; display: flex; flex-direction: column; }
.compare-col--online { border-top: 3px solid var(--accent-purple); }
.compare-col--desktop { border-top: 3px solid var(--accent-indigo); }
.compare-col h3 { font-size: 1.3rem; margin-bottom: .75rem; }
.compare-col ul { margin: 1rem 0 1.5rem; list-style: none; }
.compare-col li { position: relative; padding-left: 1.6rem; color: var(--text-secondary); margin-bottom: .5rem; font-size: .95rem; }
.compare-col li::before, .pricing-features li::before {
  content: ""; position: absolute; left: 0; top: .35em; width: 1rem; height: 1rem; border-radius: 50%;
  background: rgb(16 185 129 / 0.15) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 70% no-repeat;
}
.compare-col p { color: var(--text-secondary); font-size: .95rem; margin-bottom: 1rem; }
.compare-col .btn { margin-top: auto; align-self: flex-start; }
@media (max-width: 760px) { .compare-columns { grid-template-columns: 1fr; } .compare-col { padding: 1.5rem; } }

/* Tabella di confronto */
.table-wrapper { padding: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.compare-table { width: 100%; min-width: 620px; border-collapse: collapse; }
.compare-table th, .compare-table td { padding: .9rem 1.1rem; text-align: left; vertical-align: top; border-bottom: 1px solid rgb(45 55 72 / 0.7); font-size: .92rem; }
.compare-table thead th { color: var(--text-primary); font-weight: 600; background: rgb(31 41 55 / 0.6); }
.compare-table tbody th { color: var(--text-primary); font-weight: 500; white-space: nowrap; }
.compare-table td { color: var(--text-secondary); }
.compare-table tbody tr:last-child > * { border-bottom: none; }
.compare-table tbody tr:hover { background: rgb(39 48 66 / 0.5); }
/* Da telefono la tabella diventa un elenco di schede, senza scorrimento orizzontale */
@media (max-width: 640px) {
  .compare-table { min-width: 0; }
  .compare-table thead { display: none; }
  .compare-table tr { display: block; padding: .9rem 1rem; border-bottom: 1px solid rgb(45 55 72 / 0.7); }
  .compare-table tbody tr:last-child { border-bottom: none; }
  .compare-table th, .compare-table td { display: block; padding: .2rem 0; border: none; }
  .compare-table tbody th { white-space: normal; margin-bottom: .25rem; }
  .compare-table td::before { content: attr(data-label) ": "; font-weight: 600; color: var(--text-primary); }
}

/* Piani */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 1.5rem; padding-top: .75rem; }
.pricing-card { padding: 2rem; display: flex; flex-direction: column; position: relative; }
.pricing-card--featured { border-color: rgb(124 58 237 / 0.6); box-shadow: 0 25px 50px -12px rgb(124 58 237 / 0.25); }
.pricing-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background-image: linear-gradient(90deg, var(--accent-purple), var(--accent-indigo)); color: #fff;
  font-size: .75rem; font-weight: 600; padding: .25rem .85rem; border-radius: 9999px;
}
.pricing-price { font-size: 1.6rem; font-weight: 700; margin: .5rem 0 1.25rem; }
.pricing-price small { display: block; font-size: .85rem; font-weight: 400; color: var(--text-secondary); }
.pricing-features { list-style: none; margin-bottom: 1.5rem; flex: 1; }
.pricing-features li { color: var(--text-secondary); font-size: .92rem; margin-bottom: .55rem; padding-left: 1.6rem; position: relative; }
.pricing-note { color: var(--text-muted); font-size: .85rem; margin-top: 1.5rem; text-align: center; }

/* Passaggio tra versioni */
.migration-steps { display: grid; gap: 1.25rem; }
.migration-step { display: flex; gap: 1rem; align-items: flex-start; }
.migration-step__number {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px;
  background-image: linear-gradient(135deg, var(--accent-purple), var(--accent-indigo)); color: #fff;
  font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.migration-step h3 { margin-bottom: .35rem; }
.migration-step p { color: var(--text-secondary); font-size: .95rem; }

/* FAQ */
.faq-list { display: grid; gap: .75rem; max-width: 860px; }
.faq-item { padding: 0; }
.faq-item summary {
  cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 1.4rem; border-radius: var(--radius-card);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--accent-purple-light); font-weight: 600; font-size: 1.3rem; line-height: 1; flex-shrink: 0; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { padding: 0 1.4rem 1.25rem; color: var(--text-secondary); font-size: .95rem; }

/* Footer */
.site-footer { padding: 2.5rem 0; border-top: 1px solid rgb(45 55 72 / 0.7); background: rgb(11 15 23 / 0.6); text-align: center; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.footer-brand { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.footer-links { display: flex; gap: .5rem 1.5rem; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: var(--text-secondary); font-size: .9rem; }
.footer-links a:hover { color: var(--text-primary); }
.site-footer p { color: var(--text-muted); font-size: .85rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bg-aurora-blob { animation: none !important; }
  .card, .btn { transition: none; }
  .card-hover:hover { transform: none; }
}
