/* Pagine di atterraggio (public/pages/): stessi colori e stesso logo della home
   (style.css), ma un foglio piccolo e niente app.js, cosi' si aprono subito anche
   da telefono. Prima il telefono, poi gli schermi larghi. Chiaro e scuro seguono
   il sistema. Cambiato questo file? python tests/test_seo.py --aggiorna */

:root {
  color-scheme: light dark;
  --brand: #6c63ff;
  --brand-strong: #5a52e0;   /* pulsanti e link: 5.6:1 sul bianco */
  --brand-light: #a89fff;
  --navy: #1e1b3a;
  --hero: linear-gradient(140deg, #1e1b3a 0%, #2c2757 45%, #1b2044 100%);
  --ink: #1e1b3a;
  --text: #3f3d56;
  --muted: #5f5f6e;
  --bg: #ffffff;
  --bg-alt: #f8f9fc;
  --card: #ffffff;
  --border: #e4e4ee;
  --link: #5a52e0;
  --header-bg: rgba(255, 255, 255, 0.96);
  --focus: #5a52e0;
  --font: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f3f2ff;
    --text: #d6d4ea;
    --muted: #b0aec8;
    --bg: #13122a;
    --bg-alt: #1a1834;
    --card: #1f1d3c;
    --border: #322f57;
    --link: #b9b3ff;
    --header-bg: rgba(19, 18, 42, 0.96);
    --focus: #b9b3ff;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.65; background: var(--bg); color: var(--text); }
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.3px; }
p { margin: 0 0 14px; }

.pg-wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

.pg-skip { position: absolute; left: -9999px; top: 8px; z-index: 20; padding: 10px 14px; border-radius: 8px; background: var(--brand-strong); color: #fff; }
.pg-skip:focus { left: 16px; }

/* Header: logo + accesso + "Start free" */
.pg-header { position: sticky; top: 0; z-index: 10; background: var(--header-bg); border-bottom: 1px solid var(--border); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.pg-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.pg-logo { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; color: var(--ink); font-size: 19px; font-weight: 700; }
.pg-logo em { color: var(--brand); font-style: normal; }
.pg-logo-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--brand); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pg-header-nav { display: flex; align-items: center; gap: 4px; }
.pg-signin { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--text); font-size: 15px; font-weight: 500; text-decoration: none; }
.pg-signin:hover { color: var(--link); }

/* Pulsanti (link veri: funzionano anche senza JavaScript) */
.pg-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 20px; border-radius: 10px; background: var(--brand-strong); color: #fff; font-size: 15px; font-weight: 600; text-decoration: none; text-align: center; }
.pg-btn:hover { background: #4a43c9; }
.pg-btn-lg { min-height: 52px; padding: 14px 28px; font-size: 17px; font-weight: 700; border-radius: 12px; box-shadow: 0 4px 20px rgba(108, 99, 255, 0.4); }
.pg-btn-light { background: #fff; color: #4a43c9; }
.pg-btn-light:hover { background: #f0eeff; }

/* Briciole di pane (la stessa traccia del JSON-LD BreadcrumbList) */
.pg-breadcrumb { padding-top: 12px; font-size: 14px; color: var(--muted); }
.pg-breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pg-breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--muted); }
.pg-breadcrumb a { color: var(--link); display: inline-block; padding: 10px 0; }
.pg-breadcrumb [aria-current] { padding: 10px 0; }

/* Testata della pagina */
.pg-hero { background: var(--hero); color: #fff; text-align: center; padding: 40px 0 48px; }
.pg-hero h1 { color: #fff; font-size: 30px; font-weight: 800; margin-bottom: 16px; }
.pg-lead { font-size: 17px; color: rgba(255, 255, 255, 0.85); max-width: 640px; margin: 0 auto 28px; }
.pg-cta-row { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pg-cta-note { font-size: 14px; color: rgba(255, 255, 255, 0.78); }

/* Sezioni */
.pg-section { padding: 48px 0; }
.pg-section-alt { background: var(--bg-alt); }
.pg-section h2 { font-size: 24px; font-weight: 800; text-align: center; }
.pg-section-sub { text-align: center; color: var(--muted); max-width: 620px; margin: 0 auto 28px; }
.pg-prose { max-width: 720px; margin: 0 auto; }
.pg-prose h2 { text-align: left; }

/* Passi numerati */
.pg-steps { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 16px; counter-reset: pg-step; }
.pg-steps li { counter-increment: pg-step; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px 20px 18px 68px; position: relative; }
.pg-steps li::before { content: counter(pg-step); position: absolute; left: 18px; top: 18px; width: 36px; height: 36px; border-radius: 50%; background: var(--brand-strong); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.pg-steps h3 { font-size: 17px; margin-bottom: 6px; }
.pg-steps p { margin: 0; color: var(--muted); font-size: 15px; }

/* Schede */
.pg-cards { display: grid; gap: 16px; margin-top: 24px; }
.pg-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 22px 20px; }
.pg-card h3 { font-size: 17px; margin-bottom: 6px; }
.pg-card p { margin: 0; color: var(--muted); font-size: 15px; }

/* Domande frequenti: <details class="faq-item"> (il JSON-LD FAQPage si genera da qui) */
.pg-faq { max-width: 760px; margin: 24px auto 0; display: flex; flex-direction: column; gap: 8px; }
.faq-item { background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 14px 18px; font-size: 16px; font-weight: 600; color: var(--ink); cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 22px; font-weight: 300; color: var(--brand); flex-shrink: 0; }
.faq-item[open] summary::after { content: "\2212"; }
.faq-answer { padding: 0 18px 16px; color: var(--muted); font-size: 15px; }
.faq-answer p:last-child { margin-bottom: 0; }

/* Strumenti collegati */
.pg-related { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.pg-related a { display: inline-block; padding: 10px 0; font-weight: 600; }

/* Invito finale */
.pg-cta-band { background: var(--hero); color: #fff; text-align: center; padding: 48px 0; }
.pg-cta-band h2 { color: #fff; font-size: 24px; font-weight: 800; }
.pg-cta-band p { color: rgba(255, 255, 255, 0.82); margin-bottom: 24px; }

/* Footer: sempre scuro, come quello della home */
.pg-footer { background: var(--navy); color: rgba(255, 255, 255, 0.78); padding: 32px 0 24px; font-size: 14px; }
.pg-footer a { color: rgba(255, 255, 255, 0.85); text-decoration: none; display: inline-block; padding: 10px 0; }
.pg-footer a:hover { color: #fff; text-decoration: underline; }
.pg-footer .pg-logo { color: #fff; }
.pg-footer .pg-logo em { color: var(--brand-light); }
.pg-footer-cols { display: grid; gap: 20px; }
.pg-footer-title { margin: 0 0 4px; font-size: 13px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: rgba(255, 255, 255, 0.78); }
.pg-footer ul { list-style: none; margin: 0; padding: 0; }
.pg-footer-copy { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.14); font-size: 13px; color: rgba(255, 255, 255, 0.7); }

@media (min-width: 640px) {
  .pg-cards { grid-template-columns: repeat(2, 1fr); }
  .pg-footer-cols { grid-template-columns: 2fr 1.2fr 1fr 1fr; }
}

@media (min-width: 900px) {
  .pg-wrap { padding: 0 32px; }
  .pg-hero { padding: 72px 0 80px; }
  .pg-hero h1 { font-size: 46px; }
  .pg-lead { font-size: 19px; }
  .pg-section { padding: 72px 0; }
  .pg-section h2, .pg-cta-band h2 { font-size: 32px; }
  .pg-steps { grid-template-columns: repeat(3, 1fr); }
  .pg-steps li { padding: 64px 20px 20px; }
  .pg-cards { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: no-preference) {
  .pg-btn, .pg-signin, .pg-footer a { transition: background-color 0.15s, color 0.15s; }
}
