/* ==========================================================================
   Gruppo365 — stylesheet condiviso da tutti i 7 siti
   Basato sulla Brand Identity ufficiale (blu / notte / sole / avorio)
   Nessuna dipendenza da framework esterni (no Bootstrap): CSS puro, leggero,
   niente chiamate a CDN di terze parti oltre ai font.
   ========================================================================== */

:root {
  --blu:        #2A6FDB;
  --blu-2:      #1F58B5;
  --notte:      #0E2B5C;
  --notte-2:    #163A78;
  --sole:       #FFB23D;
  --sole-2:     #F39A1E;
  --cielo:      #EAF1FB;
  --avorio:     #F7F4EC;
  --avorio-2:   #EFEADC;
  --inchiostro: #0A1020;
  --grafite:    #5A6573;
  --grafite-2:  #AAB1BB;
  --linea:      rgba(14, 43, 92, 0.12);
  --successo:   #1E6B3A;
  --successo-bg:#E6F3EA;

  --display: "Hanken Grotesk", system-ui, sans-serif;
  --text:    "Hanken Grotesk", system-ui, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, monospace;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 24px;
  --r-pill: 999px;
  --shadow-sm: 0 2px 10px rgba(14,43,92,0.06);
  --shadow-md: 0 12px 40px rgba(14,43,92,0.12);
  --wrap: 1200px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: #fff;
  color: var(--inchiostro);
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }
.icon { width: 1em; height: 1em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: -0.15em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.section { padding: 88px 0; }
.section.tight { padding: 56px 0; }
.section.dark { background: var(--notte); color: var(--avorio); }
.section.avorio { background: var(--avorio); }
.section.cielo { background: var(--cielo); }
@media (max-width: 780px) { .section { padding: 56px 0; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--blu); margin-bottom: 14px; font-weight: 600;
}
.section.dark .eyebrow { color: var(--sole); }
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

h1, h2, h3, h4 { font-family: var(--display); letter-spacing: -0.02em; color: var(--notte); }
.section.dark h1, .section.dark h2, .section.dark h3, .section.dark h4,
.hero h1, .hero h2, .hero h3, .hero h4 { color: #fff; }
h1 { font-weight: 800; font-size: clamp(2.1rem, 4.6vw, 3.6rem); line-height: 1.08; }
h1 em, .accent { font-style: normal; color: var(--sole); }
h2.title { font-weight: 800; font-size: clamp(1.7rem, 3.2vw, 2.5rem); line-height: 1.15; margin-bottom: 12px; }
h3.subtitle { font-weight: 700; font-size: 1.2rem; margin-bottom: 8px; }
.lede { color: var(--grafite); font-size: 1.05rem; line-height: 1.7; max-width: 56ch; }
.section.dark .lede { color: rgba(247,244,236,0.72); }
p { color: #29344a; }
.section.dark p { color: rgba(247,244,236,0.78); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 28px; border-radius: var(--r-pill);
  font-family: var(--display); font-weight: 700; font-size: 0.95rem;
  border: 1.5px solid transparent; transition: transform .15s, background .2s, color .2s, border-color .2s;
}
.btn.primary { background: var(--sole); color: var(--notte); }
.btn.primary:hover { background: var(--sole-2); transform: translateY(-2px); }
.btn.dark { background: var(--notte); color: #fff; }
.btn.dark:hover { background: var(--notte-2); transform: translateY(-2px); }
.btn.ghost { background: transparent; border-color: var(--linea); color: var(--notte); }
.btn.ghost:hover { border-color: var(--blu); color: var(--blu); }
.btn.ghost.on-dark { border-color: rgba(255,255,255,0.28); color: #fff; }
.btn.ghost.on-dark:hover { border-color: var(--sole); color: var(--sole); }
.btn.block { width: 100%; }
.btn.sm { padding: 10px 18px; font-size: 0.85rem; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(14,43,92,0.97); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; }
.nav-brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 1.25rem; color: #fff; }
.nav-brand img { height: 30px; width: auto; }
.nav-brand .num { color: var(--sole); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { padding: 8px 14px; border-radius: var(--r-pill); font-size: 0.88rem; font-weight: 600; color: rgba(255,255,255,0.78); transition: color .2s, background .2s; }
.nav-links a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-cta { margin-left: 8px; }
.nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 1.6rem; padding: 4px; }
@media (max-width: 900px) {
  .nav-links { position: fixed; inset: 64px 0 0 0; background: var(--notte); flex-direction: column; align-items: stretch; padding: 16px; gap: 6px; transform: translateY(-110%); transition: transform .25s; overflow-y: auto; }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 14px 16px; }
  .nav-toggle { display: block; }
}

/* topbar micro-strip (compliance-friendly: identifica sempre il mediatore) */
.topbar { background: var(--notte-2); color: rgba(255,255,255,0.72); font-size: 0.78rem; padding: 8px 0; }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.topbar a { color: var(--sole); }

/* ---------- Hero ---------- */
.hero { background: var(--notte); position: relative; overflow: hidden; padding: 72px 0 96px; }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 60% at 85% 10%, rgba(255,178,61,0.16), transparent 60%),
              radial-gradient(ellipse 55% 70% at 5% 90%, rgba(42,111,219,0.35), transparent 60%);
}
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; background: rgba(255,178,61,0.14);
  border: 1px solid rgba(255,178,61,0.35); color: var(--sole);
  font-size: 0.76rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 7px 16px; border-radius: var(--r-pill); margin-bottom: 24px;
}
.hero .lede { color: rgba(247,244,236,0.75); margin-top: 20px; max-width: 480px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.hero-stats { display: grid; grid-template-columns: repeat(3, auto); gap: 28px; margin-top: 40px; padding-top: 28px; border-top: 1px solid rgba(255,255,255,0.14); max-width: 480px; }
.hero-stats dt { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(247,244,236,0.55); }
.hero-stats dd { font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: #fff; margin-top: 4px; }
.hero-card {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14); border-radius: var(--r-lg);
  padding: 36px; backdrop-filter: blur(8px);
}
@media (max-width: 980px) {
  .hero .wrap { grid-template-columns: 1fr; }
}

/* ---------- Trust strip ---------- */
.trust-strip { background: var(--avorio); border-bottom: 1px solid var(--linea); padding: 18px 0; }
.trust-strip .wrap { display: flex; flex-wrap: wrap; gap: 20px 32px; justify-content: center; }
.trust-item { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 600; color: var(--notte); }
.trust-item .icon { color: var(--blu); }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 22px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }

.card {
  background: #fff; border: 1.5px solid var(--linea); border-radius: var(--r-md);
  padding: 30px; height: 100%; transition: border-color .2s, box-shadow .2s, transform .2s;
}
.card:hover { border-color: var(--blu); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.card .card-icon {
  width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg, var(--blu), var(--notte));
  display: grid; place-items: center; color: #fff; font-size: 1.3rem; margin-bottom: 20px;
}
.card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.card p { font-size: 0.9rem; color: var(--grafite); line-height: 1.6; margin-bottom: 18px; }
.card .card-link { font-size: 0.85rem; font-weight: 700; color: var(--blu); display: inline-flex; align-items: center; gap: 6px; }
.card .tag { display: inline-block; background: var(--cielo); color: var(--blu); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 4px 12px; border-radius: var(--r-pill); margin-bottom: 16px; }

.step { text-align: center; }
.step .step-num { font-family: var(--display); font-weight: 800; font-size: 2.4rem; color: rgba(255,178,61,0.25); margin-bottom: 8px; }
.step h4 { font-size: 1.02rem; margin-bottom: 8px; }
.step p { font-size: 0.86rem; color: rgba(247,244,236,0.6); }

/* ---------- Simulatore ---------- */
.simulator { background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.16); border-radius: var(--r-lg); padding: 30px; }
.sim-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(247,244,236,0.55); margin-bottom: 6px; }
.sim-value { font-family: var(--display); font-size: 1.9rem; font-weight: 700; color: #fff; margin-bottom: 14px; }
.sim-range { -webkit-appearance: none; width: 100%; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.2); outline: none; margin-bottom: 6px; }
.sim-range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--sole); cursor: pointer; }
.sim-range::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: var(--sole); cursor: pointer; }
.sim-minmax { display: flex; justify-content: space-between; font-size: 0.7rem; color: rgba(247,244,236,0.4); margin-bottom: 18px; }
.sim-result { background: rgba(255,255,255,0.1); border-radius: var(--r-sm); padding: 18px 20px; display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; }
.sim-result-item .lbl { font-family: var(--mono); font-size: 10px; text-transform: uppercase; color: rgba(247,244,236,0.5); }
.sim-result-item .val { font-family: var(--display); font-size: 1.15rem; font-weight: 700; color: #fff; margin-top: 4px; }
.sim-legal { font-size: 0.72rem; color: rgba(247,244,236,0.45); margin-top: 14px; line-height: 1.5; }

/* ---------- FAQ (accessibile, no JS) ---------- */
.faq-item { border-bottom: 1px solid var(--linea); padding: 6px 0; }
.faq-item summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0; font-weight: 700; font-size: 0.98rem; cursor: pointer; color: var(--notte); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .plus { font-size: 1.3rem; color: var(--blu); transition: transform .2s; flex-shrink: 0; }
.faq-item[open] summary .plus { transform: rotate(45deg); }
.faq-item .faq-a { padding: 0 0 20px; color: var(--grafite); font-size: 0.9rem; line-height: 1.7; }

/* ---------- Lead form ---------- */
.form-panel { background: #fff; border-radius: var(--r-lg); padding: 40px; box-shadow: var(--shadow-md); }
.form-panel h3 { font-size: 1.35rem; margin-bottom: 6px; }
.form-panel .lede { font-size: 0.9rem; margin-bottom: 24px; }
.field { width: 100%; padding: 14px 16px; border: 1.5px solid var(--linea); border-radius: var(--r-sm); font-family: var(--text); font-size: 0.92rem; color: var(--inchiostro); background: var(--avorio); outline: none; margin-bottom: 12px; transition: border-color .2s, background .2s; }
.field:focus { border-color: var(--blu); background: #fff; box-shadow: 0 0 0 3px rgba(42,111,219,0.1); }
select.field { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235A6573' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }
.consent { display: flex; align-items: flex-start; gap: 10px; font-size: 0.78rem; color: var(--grafite); margin: 8px 0 16px; line-height: 1.5; }
.consent input { margin-top: 3px; flex-shrink: 0; width: 16px; height: 16px; accent-color: var(--blu); }
.form-note { font-size: 0.74rem; color: var(--grafite); text-align: center; margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.form-success { text-align: center; padding: 40px 0; }
.form-success .icon { width: 48px; height: 48px; color: var(--successo); margin: 0 auto 16px; }
.form-success h3 { margin-bottom: 8px; }
.form-error { background: #FBE4E0; color: #8A2A1B; border-radius: var(--r-sm); padding: 12px 16px; font-size: 0.82rem; margin-bottom: 14px; display: none; }
.form-error.show { display: block; }
.honeypot-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Compliance strip ---------- */
.compliance-strip { background: var(--avorio-2); border-top: 1px solid var(--linea); border-bottom: 1px solid var(--linea); padding: 16px 0; }
.compliance-strip .wrap { display: flex; align-items: flex-start; gap: 10px; font-size: 0.78rem; color: var(--grafite); line-height: 1.6; }
.compliance-strip .icon { color: var(--blu); flex-shrink: 0; margin-top: 2px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--notte); color: rgba(247,244,236,0.65); padding: 64px 0 28px; font-size: 0.87rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 40px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 1.25rem; color: #fff; margin-bottom: 14px; }
.footer-brand img { height: 28px; }
.footer-desc { max-width: 300px; line-height: 1.7; margin-bottom: 16px; }
.footer-head { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(247,244,236,0.35); margin-bottom: 16px; }
.footer-links li { margin-bottom: 9px; }
.footer-links a { color: rgba(247,244,236,0.6); transition: color .2s; }
.footer-links a:hover { color: var(--sole); }
.footer-nap { font-size: 0.82rem; line-height: 1.7; }
.footer-oam {
  display: inline-flex; align-items: center; gap: 6px; background: rgba(255,178,61,0.12);
  border: 1px solid rgba(255,178,61,0.3); color: var(--sole);
  font-size: 0.74rem; font-weight: 700; padding: 6px 12px; border-radius: var(--r-sm); margin-top: 10px;
}
.footer-legal-note { font-size: 0.72rem; line-height: 1.7; color: rgba(247,244,236,0.42); margin-top: 24px; max-width: 90ch; }
.footer-bottom { margin-top: 40px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,0.1); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 0.78rem; }
.footer-bottom a { color: rgba(247,244,236,0.55); margin-right: 16px; }
.footer-bottom a:hover { color: var(--sole); }

/* ---------- Legal / long-form pages ---------- */
.legal-page { max-width: 780px; margin: 0 auto; padding: 64px 24px 96px; }
.legal-page h1 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); margin-bottom: 8px; }
.legal-page .updated { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--grafite); margin-bottom: 40px; display: block; }
.legal-page h2 { font-size: 1.3rem; margin: 40px 0 12px; color: var(--notte); }
.legal-page h3 { font-size: 1.05rem; margin: 24px 0 8px; color: var(--notte); }
.legal-page p, .legal-page li { color: #29344a; font-size: 0.96rem; line-height: 1.75; margin-bottom: 12px; }
.legal-page ul, .legal-page ol { padding-left: 22px; margin-bottom: 16px; }
.legal-page li { margin-bottom: 8px; }
.legal-page a { color: var(--blu); text-decoration: underline; }
.legal-page .callout { background: var(--cielo); border-left: 3px solid var(--blu); border-radius: var(--r-sm); padding: 16px 20px; margin: 20px 0; font-size: 0.88rem; }
.legal-page table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.86rem; }
.legal-page th, .legal-page td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--linea); }

/* ---------- Blog ---------- */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 900px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .blog-grid { grid-template-columns: 1fr; } }
.post-card { background: #fff; border: 1px solid var(--linea); border-radius: var(--r-md); overflow: hidden; transition: box-shadow .2s, transform .2s; }
.post-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.post-card .thumb { height: 150px; background: linear-gradient(135deg, var(--blu), var(--notte)); display: grid; place-items: center; color: rgba(255,255,255,0.5); }
.post-card .body { padding: 22px; }
.post-card .cat { font-family: var(--mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--blu); }
.post-card h3 { font-size: 1.02rem; margin: 8px 0; }
.post-card p { font-size: 0.85rem; color: var(--grafite); }
.post-article { max-width: 720px; margin: 0 auto; padding: 56px 24px 96px; }
.post-article .cat { font-family: var(--mono); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--blu); margin-bottom: 12px; display: block; }
.post-article h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: 16px; }
.post-article .meta { color: var(--grafite); font-size: 0.85rem; margin-bottom: 36px; }
.post-article h2 { font-size: 1.4rem; margin: 36px 0 12px; }
.post-article h3 { font-size: 1.15rem; margin: 28px 0 10px; }
.post-article p, .post-article li { font-size: 1rem; line-height: 1.8; color: #29344a; margin-bottom: 16px; }
.post-article ul, .post-article ol { padding-left: 24px; }
.post-article a { color: var(--blu); text-decoration: underline; }
.post-cta { background: var(--cielo); border-radius: var(--r-md); padding: 28px; margin: 36px 0; text-align: center; }
.post-cta p { margin-bottom: 16px; }

/* ---------- Utilities ---------- */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; gap: 32px; } }
.badge-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.badge-list li { background: var(--cielo); color: var(--blu); font-size: 0.78rem; font-weight: 600; padding: 6px 14px; border-radius: var(--r-pill); }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--sole); color: var(--notte); padding: 10px 16px; z-index: 1000; }
.skip-link:focus { left: 12px; top: 12px; }
