/* Sito REGOLA. Palette e font dallo standard di brand Sophia (org_brand-deliverable.md); il rosso è quello del sito Brizy e del Partner Deck. */
:root {
  --ink: #2d2d8c;
  --ink-deep: #1c1c5c;
  --ink-soft: #5a5ab0;
  --ink-mute: #8e8ec7;
  --grey: #6b6b80;
  --cover: #7000ff;
  --cover-deep: #5800c9;
  --cover-soft: #e6e0ff;
  --pop: #ff4a7f;
  --pop-light: #ff6b96;
  --fuchsia: #ff6dcd;
  --bg: #f0f0ff;
  --paper: #ffffff;
  --line: #d8d8f0;
  --ok: #1f9d6b;
  --err: #c62f4a;
  --radius: 14px;
  --wrap: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: "Raleway", system-ui, sans-serif;
  font-variant-numeric: lining-nums;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--cover); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--cover); margin-bottom: .8rem; }
.lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 720px; }
.section { padding: 96px 0; }
.section.alt { background: var(--bg); }
.section-head { margin-bottom: 48px; }
.section-head.center { text-align: center; }
.section-head.center .lead { margin: 0 auto; }
#come-funziona .section-head .lead { max-width: none; }

/* Pulsanti */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 46px; padding: 0 22px; border-radius: 999px; font: inherit; font-weight: 700; font-size: .95rem; text-decoration: none; cursor: pointer; border: 2px solid transparent; transition: transform .15s, background .15s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--pop); color: #fff; }
.btn-primary:hover { background: var(--pop-light); }
.btn-ghost { border-color: rgba(255,255,255,.5); color: #fff; }
.btn-ink { background: var(--ink); color: #fff; }

/* Barra in alto */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand svg, .brand img { width: 30px; height: 30px; }
.wordmark { font-family: "Cinzel", serif; font-size: 1.45rem; font-weight: 600; letter-spacing: .06em; }
.brand .wordmark { color: var(--pop); }
.brand small { display: block; font-size: .72rem; font-weight: 700; font-style: italic; color: var(--ink); letter-spacing: .02em; margin-top: -4px; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .92rem; }
.nav a:hover { color: var(--cover); }
.lang { font-weight: 700; font-size: .85rem; color: var(--ink-soft); text-decoration: none; border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; }
.menu-btn { display: none; margin-left: auto; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; color: var(--ink); }

/* Hero */
.hero { position: relative; background: radial-gradient(1100px 500px at 85% -10%, #5b2bd6 0%, transparent 60%), linear-gradient(160deg, var(--ink) 0%, var(--ink-deep) 100%); color: #fff; padding: 110px 0 120px; overflow: hidden; }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; filter: blur(70px); opacity: .35; pointer-events: none; }
.hero::before { width: 420px; height: 420px; right: 4%; top: 12%; background: var(--fuchsia); animation: drift 18s ease-in-out infinite alternate; }
.hero::after { width: 360px; height: 360px; left: -6%; bottom: -18%; background: var(--cover); animation: drift 22s ease-in-out infinite alternate-reverse; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(-60px, 40px) scale(1.15); } }
.hero .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.hero .wordmark { display: block; font-size: 1.5rem; color: var(--pop); margin-bottom: 18px; }
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.7rem); font-weight: 800; letter-spacing: -.01em; }
.hero h1 em { font-style: normal; color: var(--pop); }
.hero p.sub { font-size: 1.15rem; color: #d9d9f5; max-width: 620px; }
.hero .ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero .tagline { margin-top: 26px; font-size: .9rem; color: var(--ink-mute); }
.hero-card { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16); border-radius: 20px; padding: 26px; }
.hero-card li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px dashed rgba(255,255,255,.18); }
.hero-card li:last-child { border-bottom: 0; }
.hero-card .n { flex: 0 0 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--pop); color: #fff; font-weight: 800; }
.hero-card strong { display: block; }
.hero-card span { color: #c9c9ef; font-size: .93rem; }
ul.clean { list-style: none; margin: 0; padding: 0; }

/* Numeri */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px; }
.stat .v { font-size: 2.6rem; font-weight: 800; color: var(--pop); line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.stat .l { margin-top: 10px; font-weight: 600; }
.stat .s { margin-top: 12px; font-size: .78rem; color: var(--grey); }
.stat .s a { color: var(--grey); }
.note { font-size: .82rem; color: var(--grey); margin-top: 22px; }

/* Passi */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: s; }
.step { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 26px; }
.step .k { font-size: .8rem; font-weight: 800; color: var(--pop); letter-spacing: .12em; }
.step h3 { margin-top: 6px; }
.step ul { margin: 12px 0 0; padding-left: 18px; color: var(--ink-soft); }
.motto { margin-top: 36px; text-align: center; font-size: 1.3rem; font-weight: 700; }
.motto em { font-style: normal; color: var(--cover); }
.section-cta { margin-top: 48px; text-align: center; }
.section-cta .btn { min-height: 52px; padding: 0 28px; font-size: 1rem; box-shadow: 0 10px 28px rgba(255,74,127,.28); }

/* Moduli */
.modules { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.module { border-radius: 20px; padding: 34px; background: var(--paper); border: 1px solid var(--line); }
.module .tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--cover-soft); color: var(--cover-deep); margin-bottom: 14px; }
.module ul { padding-left: 18px; color: var(--ink-soft); margin: 14px 0 0; }
.module li { margin-bottom: 6px; }
.outputs { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px; }
.chip { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 7px 14px; font-size: .88rem; font-weight: 600; }

/* Sicurezza */
.sec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; margin-top: 88px; }
/* Rischi degli strumenti AI generici: schede a tab (senza JS si vedono tutte) */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tabs button { font: inherit; font-weight: 700; font-size: .92rem; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 10px 18px; min-height: 44px; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.tabs button:hover { border-color: var(--pop); }
.section.alt .tabs button:not([aria-selected="true"]) { background: var(--paper); }
.tabs button[aria-selected="true"] { background: var(--pop); border-color: var(--pop); color: #fff; }
.tab-panel { display: grid; grid-template-columns: 1.2fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; margin-bottom: 14px; }
.js .tab-panel { margin-bottom: 0; }
.js .tab-panel[data-hidden] { display: none; }
.js .tab-panel.show { animation: panel-in .45s ease; }
@keyframes panel-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.threat { padding: 30px 32px; background: var(--paper); }
.threat p { color: var(--ink-soft); margin: 10px 0 0; }
.threat .s { font-size: .76rem; color: var(--grey); margin-top: 14px; }
.threat .s a { color: var(--grey); }
.answer { padding: 30px 32px; background: linear-gradient(160deg, var(--ink) 0%, var(--ink-deep) 100%); color: #fff; }
.answer .eyebrow { color: var(--pop); }
.answer p { margin: 0; color: #e4e4fa; }
.risks { display: grid; gap: 14px; }
.risk, .pillar { border-left: 3px solid var(--pop); background: var(--paper); border-radius: 0 var(--radius) var(--radius) 0; padding: 18px 20px; }
.risk p { margin: 6px 0 0; color: var(--ink-soft); font-size: .95rem; }
.risk .s { font-size: .76rem; color: var(--grey); margin-top: 8px; }
.pillars { display: grid; gap: 14px; }
.pillar { border-left-color: var(--cover); background: var(--bg); }
.pillar p { margin: 6px 0 0; color: var(--ink-soft); font-size: .95rem; }
.sec-grid .lead { margin-bottom: 28px; }

/* Per chi */
.audience { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.aud { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; font-weight: 700; }
/* Ecosistema */
.logos { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 28px 64px; }
.logos img { height: 76px; width: auto; max-width: 280px; object-fit: contain; }
.logos img[src*="polo-ict"] { height: 58px; }
/* Governance dell'AI e AI Act */
.governance { margin-top: 88px; }
.governance .section-head .lead { max-width: none; }
.gov-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.gov { background: var(--bg); border-radius: 20px; padding: 28px; border-top: 4px solid var(--pop); }
.gov .n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--pop); color: #fff; font-weight: 800; font-size: .85rem; margin-bottom: 14px; }
.gov p { color: var(--ink-soft); margin: 10px 0 0; font-size: .95rem; }
.gov .s { font-size: .76rem; color: var(--grey); margin-top: 14px; }
.gov .s a { color: var(--grey); }
@media (max-width: 960px) { .gov-grid { grid-template-columns: 1fr; } }
.aud span { display: block; font-weight: 500; color: var(--ink-soft); font-size: .9rem; margin-top: 6px; }

/* Come iniziare */
.path { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.path .step .k { color: var(--cover); }

/* Form */
.contact { background: linear-gradient(160deg, var(--ink) 0%, var(--ink-deep) 100%); color: #fff; }
.contact .wrap { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: start; }
.contact .lead { color: #d9d9f5; }
.contact ul.checks li { padding: 6px 0 6px 28px; position: relative; color: #e4e4fa; }
.contact ul.checks li::before { content: ""; position: absolute; left: 0; top: 13px; width: 14px; height: 8px; border-left: 2px solid var(--pop); border-bottom: 2px solid var(--pop); transform: rotate(-45deg); }
form.card { background: var(--paper); color: var(--ink); border-radius: 20px; padding: 32px; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .82rem; font-weight: 700; margin-bottom: 6px; }
.field input, .field textarea { width: 100%; font: inherit; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; background: #fbfbff; min-height: 46px; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--cover-soft); border-color: var(--cover); }
.field.invalid input, .field.invalid textarea { border-color: var(--err); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .85rem; margin: 10px 0; color: var(--ink-soft); }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--cover); }
.check.invalid { color: var(--err); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
form.card .btn { width: 100%; margin-top: 10px; }
.form-msg { margin-top: 14px; font-size: .92rem; font-weight: 600; }
.form-msg.ok { color: var(--ok); }
.form-msg.err { color: var(--err); }
.form-msg pre { white-space: pre-wrap; font-size: .72rem; font-weight: 400; color: var(--grey); background: var(--bg); padding: 10px; border-radius: 8px; max-height: 220px; overflow: auto; }

/* Piede */
footer { background: #12123f; color: #b9b9e0; padding: 40px 0; font-size: .85rem; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
footer a { color: #fff; }
footer .social { display: inline-flex; gap: 12px; margin-left: 14px; vertical-align: middle; }
footer .social a { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: rgba(255,255,255,.08); transition: background .2s; }
footer .social a:hover { background: var(--pop); }
footer .social svg { width: 16px; height: 16px; fill: currentColor; }

/* Restyling v3: mockup del prodotto nell'hero, galleria a tab, griglia di punti, contatori */
/* Hero più largo del resto della pagina e centrato: il mockup resta grande senza sbordare a destra */
.hero .wrap { grid-template-columns: 1fr 1.22fr; align-items: start; max-width: calc(var(--wrap) + 120px); }
.hero .wordmark { font-size: clamp(3rem, 6vw, 4.6rem); line-height: 1; margin-bottom: 10px; letter-spacing: .08em; }
.hero .tagline { margin: 0 0 30px; font-size: clamp(1.2rem, 2vw, 1.5rem); font-weight: 600; color: #fff; letter-spacing: .01em; }
.hero h1 { font-size: clamp(2rem, 4vw, 3rem); }
.hero-visual { margin-top: 12px; }
.hero-steps { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 44px 0 0; padding: 0; list-style: none; width: 100%; }
.hero-steps li { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16); border-radius: 16px; padding: 16px; backdrop-filter: blur(6px); }
.hero-steps .n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--pop); color: #fff; font-weight: 800; font-size: .85rem; margin-bottom: 10px; }
.hero-steps strong { display: block; font-size: .95rem; }
.hero-steps span:not(.n) { display: block; margin-top: 4px; color: #c9c9ef; font-size: .84rem; line-height: 1.45; }
.hero::selection { background: var(--pop); }
.hero { background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px), radial-gradient(1100px 500px at 85% -10%, #5b2bd6 0%, transparent 60%), linear-gradient(160deg, var(--ink) 0%, var(--ink-deep) 100%); background-size: 22px 22px, auto, auto; }
.hero-visual { position: relative; perspective: 1400px; }
.hero-visual .browser { width: 100%; }
.browser { display: block; position: relative; background: #fff; border-radius: 14px; padding-top: 28px; overflow: hidden; box-shadow: 0 40px 90px rgba(8,8,40,.45), 0 0 0 1px rgba(255,255,255,.12); }
.browser .dots { position: absolute; top: 10px; left: 14px; display: flex; gap: 6px; }
.browser .dots i { width: 9px; height: 9px; border-radius: 50%; background: #e2e2ef; }
.browser .dots i:first-child { background: var(--pop); }
.browser img { display: block; width: 100%; height: auto; border-top: 1px solid #ececf6; }
.tilt { transform: rotateY(-14deg) rotateX(6deg) rotateZ(1deg); transform-origin: left center; transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
.hero-visual:hover .tilt { transform: rotateY(-6deg) rotateX(3deg); }
.float-badge { position: absolute; display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.96); color: var(--ink); font-weight: 700; font-size: .82rem; padding: 9px 14px; border-radius: 999px; box-shadow: 0 14px 30px rgba(8,8,40,.3); animation: float 6s ease-in-out infinite; white-space: nowrap; }
.float-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--pop); box-shadow: 0 0 0 4px rgba(255,74,127,.18); }
.fb-1 { top: -18px; right: 6%; }
.fb-2 { top: 58%; left: -28px; animation-delay: -2s; }
.fb-2 i { background: var(--ok); box-shadow: 0 0 0 4px rgba(31,157,107,.18); }
.fb-3 { top: 30%; right: -2%; animation-delay: -4s; }
.fb-3 i { background: var(--cover); box-shadow: 0 0 0 4px rgba(112,0,255,.18); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.hero h1 em { background: linear-gradient(90deg, var(--pop), var(--fuchsia)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.btn-primary svg { flex: none; transition: transform .2s; }
.btn-primary:hover svg { transform: translateX(4px); }
.showcase { margin-top: 56px; }
.showcase h3 { margin-bottom: 16px; }
.shot { display: block; margin: 0; border: 0; border-radius: 0; overflow: visible; grid-template-columns: none; }
.shot .browser { box-shadow: 0 30px 70px rgba(45,45,140,.18), 0 0 0 1px var(--line); cursor: zoom-in; }
.shot figcaption { margin-top: 14px; color: var(--ink-soft); font-size: .95rem; }
.section-head h2 { position: relative; }
.section-head h2::after { content: ""; display: block; width: 56px; height: 4px; border-radius: 4px; margin-top: 16px; background: linear-gradient(90deg, var(--pop), var(--fuchsia)); }
.section-head.center h2::after { margin-left: auto; margin-right: auto; }
.contact h2::after, .sec-grid h2::after { display: none; }
@media (max-width: 960px) {
  .tilt, .hero-visual:hover .tilt { transform: none; }
  .hero-visual .browser { width: 100%; }
  .hero-steps { margin-top: 40px; width: 100%; }
  .fb-3 { right: 4px; }
  .fb-2 { left: 8px; }
  .hero-visual { margin-top: 24px; }
}
@media (max-width: 560px) {
  .float-badge { font-size: .74rem; padding: 7px 11px; }
  .hero-steps { grid-template-columns: 1fr; }
  .fb-1 { right: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .float-badge { animation: none; }
  .tilt { transition: none; }
}

/* Animazioni: entrata al primo scorrimento (classe .js messa nel head, .in da main.js) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .hero::before, .hero::after { animation: none; }
  html { scroll-behavior: auto; }
}

@media (max-width: 960px) {
  .hero .wrap, .sec-grid, .contact .wrap, .tab-panel { grid-template-columns: 1fr; }
  .steps, .path, .modules { grid-template-columns: 1fr; }
  .section { padding: 72px 0; }
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--paper); border-bottom: 1px solid var(--line); }
  .nav.open { display: flex; }
  .nav a { padding: 14px 20px; border-top: 1px solid var(--line); }
  .topbar .btn-cta { display: none; }
}
@media (max-width: 560px) {
  .row { grid-template-columns: 1fr; }
  .hero { padding: 72px 0 84px; }
  form.card { padding: 22px; }
}
