/* D-Medical — sito istituzionale */
:root {
  --navy: #002060;
  --navy-deep: #00163F;
  --blue: #0070C0;
  --cyan: #00B0F0;
  --orange: #FF9900;
  --gold: #FFC000;
  --amp: #E69500;
  --ink: #1E2B45;
  --muted: #4A5670;
  --ground: #F5F8FC;
  --line: #D9E1EC;
  --line-strong: #A3B1C6;
  --tint: #E8F3FC;
  --tint-line: #BFDDF5;
  --footer-text: #B4C3DA;
  --footer-accent: #5CB8FF;
  --wrap: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
a:hover { color: var(--navy); }
h1, h2, h3 { color: var(--navy); margin: 0; }
p { margin: 0; }
[id] { scroll-margin-top: 96px; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--navy); color: #fff; padding: 12px 16px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 2px solid var(--cyan); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; flex-direction: column; text-decoration: none; line-height: 1; }
.brand-name { font-size: 26px; font-weight: 700; }
.brand-name .d { color: var(--navy); }
.brand-name .h { color: var(--orange); }
.brand-name .m { color: var(--blue); }
.brand-tag { font-size: 13px; color: var(--blue); margin-top: 5px; }
.brand-tag b { color: var(--amp); }

.nav { display: flex; align-items: center; gap: 4px 24px; font-size: 15px; font-weight: 600; }
.nav a { color: var(--navy); text-decoration: none; padding: 12px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--blue); }
.nav a[aria-current="page"] { color: var(--blue); border-bottom-color: var(--orange); }
.nav a.btn-nav { padding: 11px 18px; border-radius: 6px; background: var(--navy); color: #fff; border: 0; }
.nav a.btn-nav:hover { background: var(--blue); color: #fff; }

.menu-toggle { display: none; width: 48px; height: 48px; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: var(--ground); color: var(--navy); cursor: pointer; }
.menu-toggle .i-close { display: none; }
.menu-open .menu-toggle .i-close { display: block; }
.menu-open .menu-toggle .i-open { display: none; }

@media (max-width: 900px) {
  .brand-name { font-size: 22px; }
  .brand-tag { font-size: 11px; margin-top: 4px; }
  .site-header .wrap { padding-top: 10px; padding-bottom: 10px; }
  .menu-toggle { display: flex; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: #fff; padding: 8px 20px 20px; border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(0, 32, 96, 0.12); font-size: 18px; }
  .menu-open .nav { display: flex; }
  .nav a { padding: 14px 0; border-bottom: 1px solid #E6ECF4; }
  .nav a[aria-current="page"] { border-bottom-color: #E6ECF4; }
  .nav a.btn-nav { margin-top: 12px; text-align: center; padding: 14px 18px; }
}

/* ---------- Common blocks ---------- */
.section { padding: 96px 0; }
.section--tight-bottom { padding-bottom: 0; }
.section--white { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section--navy { background: var(--navy); color: #DCE6F5; }
.eyebrow { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue); margin-bottom: 16px; }
.eyebrow::before { content: ""; width: 28px; height: 3px; background: var(--orange); flex: 0 0 auto; }
.section--navy .eyebrow { color: var(--gold); }
.h2 { font-size: 40px; line-height: 1.12; letter-spacing: -0.02em; }
.lead { font-size: 18px; color: var(--muted); }
.split-head { display: flex; flex-wrap: wrap; gap: 24px 56px; align-items: flex-end; margin-bottom: 40px; }
.split-head > div { flex: 1 1 520px; min-width: 0; }
.split-head > p { flex: 1 1 400px; min-width: 0; }
.head { max-width: 720px; margin-bottom: 40px; }

.btn { display: inline-block; padding: 14px 22px; border-radius: 6px; font-weight: 600; text-decoration: none; text-align: center; border: 1.5px solid transparent; }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--navy); color: #fff; }
.btn--dark { background: var(--navy); color: #fff; }
.btn--dark:hover { background: var(--blue); color: #fff; }
.btn--outline { border-color: var(--navy); color: var(--navy); }
.btn--outline:hover { background: var(--navy); color: #fff; }
.btn--white { background: #fff; color: var(--navy); }
.btn--white:hover { background: var(--tint); color: var(--navy); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 14px; border-radius: 6px; background: var(--ground); border: 1px solid var(--line); font-weight: 600; color: var(--navy); font-size: 15px; }
.chip--pill { border-radius: 999px; background: #fff; border-color: var(--line-strong); padding: 10px 16px; font-size: 16px; }
.chip--tint { background: #fff; border-color: var(--tint-line); }
.chip--dashed { border-style: dashed; font-weight: 400; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.icon-box { width: 48px; height: 48px; border-radius: 10px; background: var(--tint); display: flex; align-items: center; justify-content: center; color: var(--blue); }
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 20px; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 40px; }
.grid--5 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.icon { width: 24px; height: 24px; flex: 0 0 auto; }

/* ---------- Home ---------- */
.hero { padding: 96px 0 80px; }
.hero-inner { max-width: 860px; display: flex; flex-direction: column; gap: 24px; }
.hero h1 { font-size: clamp(38px, 5.4vw, 66px); line-height: 1.05; letter-spacing: -0.03em; }
.hero p { font-size: 20px; color: var(--muted); max-width: 640px; }
.hero .eyebrow { margin-bottom: 0; }

.stats .wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 32px; padding-top: 40px; padding-bottom: 40px; }
.stat-value { font-size: 36px; font-weight: 700; color: var(--navy); line-height: 1.25; }
.stat-label { color: var(--muted); }

.steps { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 16px; }
.steps li { background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--cyan); border-radius: 10px; padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.steps li:last-child { border-top-color: var(--orange); }
.step-n { width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.step-t { font-weight: 700; font-size: 17px; color: var(--navy); }
.step-d { color: var(--muted); font-size: 15px; }

.about { display: flex; flex-wrap: wrap; gap: 56px; }
.about > div:first-child { flex: 1 1 360px; min-width: 0; }
.about > div:last-child { flex: 2 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 20px; font-size: 18px; }

.solutions-head { display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between; align-items: center; margin-bottom: 48px; }
.solutions-head > div { flex: 1 1 520px; min-width: 0; max-width: 640px; }
.solutions-head img { flex: 0 1 380px; width: 380px; border-radius: 12px; border: 1px solid var(--line); }
.modules { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.modules div { background: #fff; padding: 24px; }
.modules strong { display: block; font-size: 17px; color: var(--navy); }
.modules span { color: var(--muted); font-size: 15px; }

.fse-box { background: var(--tint); border: 1px solid var(--tint-line); border-radius: 16px; padding: 48px; display: flex; flex-wrap: wrap; gap: 40px; align-items: center; }
.fse-badge { flex: 0 0 220px; height: 220px; border-radius: 16px; background: var(--navy); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.fse-badge b { font-size: 52px; line-height: 1; }
.fse-badge b span { color: var(--gold); }
.fse-badge small { font-size: 14px; color: #DCE6F5; padding: 0 20px; }
.fse-body { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.fse-body .eyebrow { margin-bottom: 0; }
.fse-body h2 { font-size: 36px; line-height: 1.15; letter-spacing: -0.02em; }

.sec-item { border: 1px solid var(--line); border-radius: 10px; padding: 24px; display: flex; flex-direction: column; gap: 10px; color: var(--blue); }
.sec-item--dashed { border: 1px dashed var(--line-strong); }
.sec-item strong { font-size: 17px; color: var(--navy); }
.sec-item span { color: var(--muted); font-size: 15px; }

.multi { display: flex; flex-wrap: wrap; gap: 48px; align-items: stretch; }
.multi-text { flex: 3 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.multi-text .eyebrow { margin-bottom: 0; }
.benefits { list-style: none; margin: 8px 0 0; padding: 0; }
.benefits li { display: flex; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); color: var(--blue); }
.benefits li:last-child { border-bottom: 1px solid var(--line); }
.benefits strong { display: block; color: var(--navy); }
.benefits span { color: var(--muted); }
.case { flex: 2 1 340px; min-width: 0; background: var(--navy); color: #DCE6F5; border-radius: 16px; padding: 40px; display: flex; flex-direction: column; gap: 20px; justify-content: space-between; }
.case .eyebrow { color: var(--gold); margin-bottom: 0; }
.case h3 { color: #fff; font-size: 30px; line-height: 1.15; letter-spacing: -0.02em; }
.case ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.case li { display: flex; gap: 12px; color: var(--gold); }
.case li span { color: #DCE6F5; }
.case li strong { color: #fff; }
.case-foot { border-top: 1px solid #1D3F7A; padding-top: 20px; display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--footer-accent); }
.case-foot span { color: #DCE6F5; }

.sector { padding: 24px; border-radius: 10px; background: #fff; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.sector small { font-size: 14px; font-weight: 700; color: var(--blue); }
.sector strong { font-size: 18px; color: var(--navy); font-weight: 600; }

.principle { border-top: 3px solid var(--cyan); padding-top: 20px; }
.principle h3 { font-size: 20px; margin-bottom: 8px; }
.principle p { color: var(--muted); }

.careers { display: flex; flex-wrap: wrap; gap: 32px; align-items: center; justify-content: space-between; }
.careers > div { flex: 1 1 520px; min-width: 0; }
.careers h2 { color: #fff; margin-bottom: 16px; }
.careers p { font-size: 18px; }

/* ---------- Inner pages ---------- */
.page-hero { padding: 88px 0 64px; }
.page-hero h1 { font-size: clamp(36px, 5vw, 58px); line-height: 1.08; letter-spacing: -0.03em; max-width: 900px; margin-bottom: 24px; }
.page-hero p { font-size: 20px; color: var(--muted); max-width: 720px; }
.mission { font-size: 26px; line-height: 1.35; color: var(--navy); max-width: 900px; }

.timeline-wrap { display: flex; flex-wrap: wrap; gap: 56px; }
.timeline-wrap > div { flex: 1 1 320px; min-width: 0; }
.timeline { flex: 2 1 560px; min-width: 0; list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 32px; padding: 24px 0; border-top: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 1px solid var(--line); }
.timeline .when { flex: 0 0 120px; font-weight: 700; color: var(--blue); }
.timeline strong { display: block; font-size: 18px; color: var(--navy); font-weight: 600; }
.timeline span { color: var(--muted); }

.company { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 56px; }
.company > div { display: flex; flex-direction: column; gap: 16px; }
.company .eyebrow { margin-bottom: 0; }
.company h2 { font-size: 32px; line-height: 1.15; letter-spacing: -0.02em; }
.facts { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 10px 24px; font-size: 16px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.company img { width: 320px; border-radius: 10px; border: 1px solid var(--line); }

/* ---------- Contatti ---------- */
.contact { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; padding-bottom: 96px; }
.form { flex: 999 1 560px; min-width: 0; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--cyan); border-radius: 10px; padding: 40px; display: flex; flex-direction: column; gap: 20px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 15px; color: var(--navy); }
.field label span { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea { font: inherit; font-size: 16px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; min-height: 48px; color: var(--ink); width: 100%; }
.field textarea { resize: vertical; min-height: 150px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; }
.check input { width: 20px; height: 20px; flex: 0 0 20px; margin: 2px 0 0; accent-color: var(--blue); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form button { font: inherit; font-weight: 600; padding: 14px 24px; min-height: 48px; border: 0; border-radius: 6px; background: var(--blue); color: #fff; cursor: pointer; align-self: flex-start; }
.form button:hover { background: var(--navy); }
.alert { display: none; padding: 14px 16px; border-radius: 6px; background: #FDECEA; color: #8A1C12; border: 1px solid #F3B7AE; font-size: 15px; }
.has-error .alert { display: block; }

.contact-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.contact-side .eyebrow { margin-bottom: 6px; font-size: 13px; }
.contact-side .eyebrow::before { width: 20px; }
.contact-side a.big { font-size: 18px; font-weight: 600; color: var(--navy); }
.contact-side .stack { display: flex; flex-direction: column; gap: 4px; }
.quick { display: none; }

@media (max-width: 700px) {
  .quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 24px; }
  .quick a { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border-radius: 6px; font-weight: 600; text-decoration: none; }
  .quick a:first-child { background: var(--blue); color: #fff; }
  .quick a:last-child { border: 1.5px solid var(--navy); color: var(--navy); }
}

/* ---------- Progetti finanziati ---------- */
.fund-strip { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; }
.fund-strip img { width: 100%; max-width: 760px; height: auto; }
.fund-note { margin-top: 32px; display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.fund-note a { display: flex; flex-direction: column; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; text-decoration: none; color: var(--ink); }
.fund-note a:hover { border-color: var(--blue); }
.fund-note img { width: 100%; max-width: 640px; height: auto; }
.fund-note span { font-size: 15px; color: var(--muted); }
.fund-note strong { color: var(--navy); }
.project { max-width: 900px; padding-bottom: 96px; display: flex; flex-direction: column; gap: 40px; }
.project h2 { font-size: 26px; margin-bottom: 12px; }
.project ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.project-facts { margin: 0; display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 12px 24px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 24px; }
.project-facts dt { color: var(--muted); }
.project-facts dd { margin: 0; }
.project-en { border-top: 1px solid var(--line); padding-top: 32px; }
.project-en summary { cursor: pointer; font-weight: 700; color: var(--navy); font-size: 18px; }
.project-en[open] summary { margin-bottom: 24px; }
.project-en > div { display: flex; flex-direction: column; gap: 32px; }
@media (max-width: 700px) {
  .project-facts { grid-template-columns: 1fr; gap: 2px; padding: 20px; }
  .project-facts dd { margin-bottom: 10px; }
  .project h2 { font-size: 22px; }
}

/* ---------- Legal pages ---------- */
.legal { max-width: 820px; padding-bottom: 96px; }
.legal h2 { font-size: 24px; margin: 40px 0 12px; }
.legal p, .legal li { color: var(--ink); }
.legal p + p { margin-top: 12px; }
.legal ul { padding-left: 22px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-deep); color: var(--footer-text); font-size: 15px; }
.site-footer .wrap { padding-top: 64px; padding-bottom: 32px; display: flex; flex-direction: column; gap: 40px; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 32px; }
.footer-cols > div { display: flex; flex-direction: column; gap: 8px; }
.footer-cols h2 { color: #fff; font-size: 15px; font-weight: 600; }
.site-footer a { color: var(--footer-text); }
.site-footer a:hover { color: #fff; }
.f-brand { font-size: 22px; font-weight: 700; line-height: 1; }
.f-brand .d { color: #fff; }
.f-brand .h { color: var(--orange); }
.f-brand .m { color: var(--footer-accent); }
.f-tag { font-size: 13px; color: var(--footer-accent); margin-bottom: 8px; }
.f-tag b { color: var(--gold); }
.footer-legal { border-top: 1px solid #1D3460; padding-top: 24px; font-size: 13px; }

/* ---------- Small screens ---------- */
@media (max-width: 700px) {
  body { font-size: 16px; }
  .wrap { padding: 0 20px; }
  .section { padding: 56px 0; }
  .hero { padding: 48px 0 48px; }
  .hero p, .page-hero p { font-size: 17px; }
  .hero .btn-row .btn { flex: 1 1 100%; }
  .page-hero { padding: 48px 0 32px; }
  .h2 { font-size: 30px; line-height: 1.15; }
  .lead { font-size: 17px; }
  .split-head, .head, .solutions-head { margin-bottom: 24px; }
  .stats .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; padding-top: 32px; padding-bottom: 32px; }
  .stat-value { font-size: 28px; }
  .stat-label { font-size: 14px; }
  .card { padding: 22px 20px; }
  .fse-box { padding: 24px 20px; gap: 20px; }
  .fse-badge { flex: 1 1 100%; height: auto; flex-direction: row; justify-content: flex-start; padding: 20px; gap: 16px; text-align: left; }
  .fse-badge b { font-size: 36px; white-space: nowrap; }
  .fse-badge small { padding: 0; }
  .fse-body h2 { font-size: 26px; }
  .case { padding: 24px 20px; }
  .case h3 { font-size: 24px; }
  .grid--4 { gap: 28px; }
  .mission { font-size: 21px; }
  .timeline li { flex-direction: column; gap: 4px; padding: 18px 0; }
  .timeline .when { flex: none; font-size: 14px; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 10px; }
  .form { padding: 24px 20px; }
  .form button { align-self: stretch; }
  .careers .btn { flex: 1 1 100%; }
  .site-footer .wrap { padding-top: 48px; }
}
