/* =========================================================
   CP Digital — foglio di stile del sito
   Colori: modifica le variabili qui sotto per cambiare tema
   ========================================================= */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg-soft: #f4f6fb;
  --text: #0f172a;
  --muted: #4b5568;
  --border: #e3e8f0;
  --card: #ffffff;
  --accent: #2f5bea;
  --accent-hover: #2449c7;
  --accent-2: #14b8a6;
  --on-accent: #ffffff;
  --phone: #0f172a;
  --phone-screen: #f4f6fb;
  --phone-card: #ffffff;
  --line: #cbd5e1;
  --line-soft: #e2e8f0;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 10px 30px rgba(15, 23, 42, .07);
  --radius: 18px;
  --max: 1100px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0f1e;
    --bg-soft: #0f1629;
    --text: #e7ebf5;
    --muted: #a2acc0;
    --border: #1e2943;
    --card: #111a30;
    --accent: #7090ff;
    --accent-hover: #8ea7ff;
    --accent-2: #2dd4bf;
    --on-accent: #0a0f1e;
    --phone: #1c2742;
    --phone-screen: #0f1629;
    --phone-card: #16203a;
    --line: #34415f;
    --line-soft: #253150;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

img, svg { display: block; max-width: 100%; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }

section[id], h2[id] { scroll-margin-top: 80px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 100; background: var(--card); padding: 8px 14px; border-radius: 10px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--text); }
.brand img { width: 32px; height: 32px; }
.nav { display: flex; gap: 4px; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: .95rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 10px;
  white-space: nowrap;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--bg-soft); }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color .15s, border-color .15s, color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-ghost { background: var(--card); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-lg { padding: 14px 24px; font-size: 1.05rem; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 80px 0 88px; }
.hero::before {
  content: "";
  position: absolute;
  top: -320px;
  right: -200px;
  width: 760px;
  height: 760px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), transparent);
  pointer-events: none;
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.25fr .75fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .9em;
}
.lead { font-size: 1.15rem; color: var(--muted); max-width: 36em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-art svg { width: 100%; max-width: 270px; margin: 0 auto; filter: drop-shadow(0 24px 40px rgba(15, 23, 42, .18)); }
.phone-body, .phone-notch { fill: var(--phone); }
.phone-screen { fill: var(--phone-screen); }
.phone-card { fill: var(--phone-card); stroke: var(--border); }
.line { fill: var(--line); }
.line-soft { fill: var(--line-soft); }

/* ---------- Sezioni ---------- */
.section { padding: 88px 0; }
.section-soft { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 680px; margin-bottom: 40px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { padding: 28px; }
.feature p { color: var(--muted); margin: 0; }
.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.feature-icon svg { width: 22px; height: 22px; }

/* ---------- App ---------- */
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 20px; }
.app { display: flex; gap: 18px; padding: 24px; align-items: flex-start; }
.app h3 { margin-bottom: .3em; }
.app p { color: var(--muted); margin-bottom: .8em; }
.app-icon { flex: none; width: 64px; height: 64px; border-radius: 16px; }
.app-icon.placeholder {
  display: grid;
  place-items: center;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.app-icon.placeholder svg { width: 28px; height: 28px; }
.app-links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .95rem; font-weight: 600; }
.app-empty { border-style: dashed; box-shadow: none; }
.app-empty p { margin: 0; }

/* ---------- Contatti ---------- */
.contact { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 28px 40px; padding: 48px; }
.contact-text { max-width: 540px; }
.contact-text p:last-child { margin: 0; }
.contact-action { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.contact-action p { margin: 0; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 32px 0; color: var(--muted); font-size: .92rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; }
.footer-inner p { margin: 0; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-inner a { color: var(--muted); text-decoration: none; }
.footer-inner a:hover { color: var(--text); }

/* ---------- Pagine legali ---------- */
.legal { padding: 64px 0 88px; }
.legal .container { max-width: 780px; }
.legal h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); }
.legal h2 { font-size: 1.35rem; margin-top: 2.2em; }
.legal h3 { font-size: 1.05rem; margin-top: 1.4em; }
.legal ul { padding-left: 1.2em; margin: 0 0 1em; }
.legal li { margin-bottom: .5em; }
.updated { color: var(--muted); font-size: .95rem; }
.note { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 14px; padding: 16px 20px; }
.note p:last-child { margin: 0; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 120px 0; }
.notfound .actions { justify-content: center; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .container { padding: 0 16px; }
  .hero { padding: 48px 0 56px; }
  .section { padding: 64px 0; }
  .nav { gap: 0; }
  .nav a { padding: 8px 8px; font-size: .9rem; }
  .hide-sm { display: none; }
  .feature { padding: 22px; }
  .app { padding: 20px; }
  .contact { padding: 28px 22px; }
  .legal { padding: 40px 0 64px; }
}

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