/* =========================================================
   MA.DE. Engineering s.r.l. — foglio di stile principale
   Sito statico. Nessuna dipendenza esterna.
   ========================================================= */

:root {
  --navy:        #005483;   /* blu del logo MA.DE. */
  --navy-dark:   #00385a;
  --navy-soft:   #0a6ba3;
  --grey-brand:  #bdbfbf;   /* grigio del logo */
  --accent:      #f2a007;
  --accent-dark: #cf8600;
  --ink:         #1c2530;
  --muted:       #5b6875;
  --line:        #e2e8ef;
  --bg:          #ffffff;
  --bg-alt:      #f5f7fa;
  --ok:          #147a4b;

  --wrap: 1140px;
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(0, 56, 90, .10);
  --shadow:    0 6px 24px rgba(0, 56, 90, .12);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--navy-soft); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }

h1, h2, h3, h4, h5 { color: var(--navy); line-height: 1.25; margin: 0 0 .6em; font-weight: 700; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -.01em; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.06rem; }
p  { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.1em; padding-left: 1.35em; }
li { margin-bottom: .4em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 820px; }
.section { padding: 78px 0; }
.section--alt { background: var(--bg-alt); }
.section--navy { background: var(--navy); color: #dbe6f2; }
.section--navy h2, .section--navy h3, .section--navy h4 { color: #fff; }
.center { text-align: center; }
.lead { font-size: 1.12rem; color: var(--muted); }
.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent-dark); margin-bottom: .7em;
}
.section--navy .eyebrow { color: var(--accent); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Bottoni ---------- */
.btn {
  display: inline-block; padding: 13px 26px; border-radius: 6px;
  font-weight: 700; font-size: .95rem; line-height: 1.2; text-align: center;
  border: 2px solid transparent; cursor: pointer; transition: .18s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: var(--navy-dark); }
.btn--primary:hover { background: var(--accent-dark); color: #fff; }
.btn--outline { border-color: var(--navy); color: var(--navy); }
.btn--outline:hover { background: var(--navy); color: #fff; }
.btn--ghost { border-color: rgba(255,255,255,.55); color: #fff; }
.btn--ghost:hover { background: #fff; color: var(--navy); }

/* ---------- Barra superiore ---------- */
.topbar {
  background: var(--navy-dark); color: #b9c9db; font-size: .84rem;
  padding: 7px 0;
}
.topbar .wrap { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.topbar a { color: #e7eef6; }
.topbar ul { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; flex-wrap: wrap; }
.topbar li { margin: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; background: #fff;
  border-bottom: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.site-header .wrap { display: flex; align-items: center; gap: 20px; min-height: 78px; }
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.brand img { height: 52px; width: auto; max-width: 220px; object-fit: contain; }
.brand__tag {
  font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em;
  line-height: 1.35; padding-left: 14px; border-left: 2px solid var(--grey-brand);
}

.nav ul { list-style: none; display: flex; gap: 26px; margin: 0; padding: 0; align-items: center; }
.nav li { margin: 0; }
.nav a {
  color: var(--navy); font-weight: 600; font-size: .95rem; padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent-dark); border-bottom-color: var(--accent); text-decoration: none; }

.nav-toggle {
  display: none; background: none; border: 2px solid var(--line); border-radius: 6px;
  padding: 7px 9px; cursor: pointer; color: var(--navy); line-height: 0;
}
.nav-toggle svg { width: 24px; height: 24px; stroke-width: 1.8; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0; background: #fff;
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow); display: none;
  }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; gap: 0; padding: 8px 22px 18px; align-items: stretch; }
  .nav li { border-bottom: 1px solid var(--line); }
  .nav li:last-child { border-bottom: 0; }
  .nav a { display: block; padding: 13px 0; border-bottom: 0; }
  .header-cta { display: none; }
}

@media (max-width: 620px) {
  .site-header .wrap { min-height: 66px; gap: 12px; }
  .brand img { height: 40px; max-width: 160px; }
  .brand__tag { display: none; }
  .topbar .wrap { justify-content: flex-start; gap: 6px 18px; }
  .hero__inner { padding: 68px 0 60px; }
  .section { padding: 56px 0; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff; background: var(--navy) center/cover no-repeat;
  background-image: linear-gradient(100deg, rgba(0,44,70,.95) 0%, rgba(0,44,70,.86) 52%, rgba(0,44,70,.70) 100%), url('../img/hero.jpg');
}
.hero__inner { padding: 100px 0 88px; max-width: 760px; }
.hero h1 { color: #fff; margin-bottom: .45em; }
.hero p { font-size: 1.16rem; color: #cfdcea; max-width: 640px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

.page-hero {
  background: var(--navy); color: #fff; padding: 64px 0 58px;
  background-image: linear-gradient(135deg, var(--navy) 0%, var(--navy-soft) 100%);
}
.page-hero h1 { color: #fff; margin-bottom: .3em; }
.page-hero p { color: #cfdcea; max-width: 680px; margin: 0; }
.breadcrumb { font-size: .84rem; color: #9fb6cd; margin-bottom: 14px; }
.breadcrumb a { color: #cfdcea; }

/* ---------- Barra credenziali ---------- */
.trustbar { background: var(--bg-alt); border-bottom: 1px solid var(--line); padding: 22px 0; }
.trustbar ul {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 14px 26px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.trustbar li { margin: 0; font-size: .92rem; color: var(--muted); display: flex; gap: 10px; align-items: flex-start; }
.trustbar strong { display: block; color: var(--navy); font-size: .97rem; }
.trustbar .mark { color: var(--accent-dark); font-weight: 800; }

/* ---------- Griglie e card ---------- */
.grid { display: grid; gap: 26px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow-sm); transition: .18s ease;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card h3 { margin-bottom: .4em; font-size: 1.1rem; }
.card p:last-child { margin-bottom: 0; }
.card__icon {
  width: 48px; height: 48px; border-radius: 9px; background: var(--bg-alt);
  display: grid; place-items: center; margin-bottom: 16px; color: var(--navy);
}
.card__icon svg { width: 26px; height: 26px; }

/* ---------- Icone vettoriali ---------- */
svg[viewBox="0 0 24 24"] {
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.s-ico {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 8px; background: var(--bg-alt);
  display: inline-flex; align-items: center; justify-content: center; color: var(--navy);
}
.s-ico svg { width: 21px; height: 21px; }
details.acc[open] > summary .s-ico { background: #fff; }
.doc-list svg { width: 20px; height: 20px; flex: 0 0 20px; color: var(--navy-soft); }
.card__link { font-weight: 700; font-size: .92rem; }

.dept { border-top: 4px solid var(--accent); }
.dept .tag {
  display: inline-block; background: var(--navy); color: #fff; font-weight: 800;
  letter-spacing: .08em; padding: 4px 12px; border-radius: 4px; font-size: .8rem; margin-bottom: 12px;
}

/* ---------- Numeri ---------- */
.stats { display: grid; gap: 26px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); text-align: center; }
.stat__n { font-size: 2.7rem; font-weight: 800; color: var(--accent); line-height: 1; }
.stat__l { color: #cfdcea; font-size: .95rem; margin-top: 8px; }

/* ---------- Split testo/immagine ---------- */
.split { display: grid; gap: 44px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: center; }
.split img { border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- Accordion (servizi, FAQ) ---------- */
details.acc {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 12px; box-shadow: var(--shadow-sm); overflow: hidden;
}
details.acc > summary {
  cursor: pointer; padding: 16px 52px 16px 18px; font-weight: 700; color: var(--navy);
  position: relative; list-style: none; line-height: 1.4;
  display: flex; align-items: center; gap: 14px;
}
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::after {
  content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  font-size: 1.5rem; font-weight: 400; color: var(--accent-dark); line-height: 1;
}
details.acc[open] > summary::after { content: "\2013"; }
details.acc[open] > summary { background: var(--bg-alt); border-bottom: 1px solid var(--line); }
.acc__body { padding: 20px 22px 6px; }
.acc__body ul { padding-left: 1.2em; }

/* ---------- Progetti ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
.filters button {
  border: 1px solid var(--line); background: #fff; color: var(--navy); border-radius: 999px;
  padding: 8px 18px; font-size: .88rem; font-weight: 600; cursor: pointer; font-family: inherit;
}
.filters button:hover { border-color: var(--navy); }
.filters button[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }

.project { padding: 0; overflow: hidden; display: block; color: inherit; }
.project:hover { text-decoration: none; }
.project__img { width: 100%; aspect-ratio: 3/2; object-fit: cover; }
.project__body { padding: 20px 22px 24px; border-top: 3px solid var(--accent); }
.project__cat { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-dark); }
.project h3 { font-size: 1.04rem; margin: 8px 0 0; }
.project p { font-size: .92rem; color: var(--muted); margin: 6px 0 0; }
.project__more { display: inline-block; margin-top: 12px; font-size: .88rem; font-weight: 700; color: var(--navy-soft); }
.project:hover .project__more { color: var(--accent-dark); }

/* ---------- Processo ---------- */
.steps { counter-reset: step; display: grid; gap: 26px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.step { position: relative; padding-top: 12px; }
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  font-size: 2.1rem; font-weight: 800; color: var(--accent); display: block; line-height: 1; margin-bottom: 10px;
}

/* ---------- Testimonianze ---------- */
.quote {
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm);
}
.quote p { font-style: italic; color: var(--ink); }
.quote cite { font-style: normal; font-weight: 700; color: var(--navy); font-size: .92rem; }

/* ---------- Team ---------- */
.person { text-align: center; }
.person img { border-radius: var(--radius); margin-bottom: 14px; width: 100%; aspect-ratio: 9/10; object-fit: cover; }
.person h4 { margin-bottom: .2em; }
.person .role { color: var(--muted); font-size: .9rem; }

/* ---------- CTA ---------- */
.cta { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-soft) 100%); color: #fff; }
.cta h2 { color: #fff; }
.cta p { color: #cfdcea; }
.cta__inner { display: flex; flex-wrap: wrap; gap: 26px; align-items: center; justify-content: space-between; }

/* ---------- Form ---------- */
.form-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .9rem; color: var(--navy); }
.field .req { color: #c0392b; }
input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  font-family: inherit; font-size: 1rem; color: var(--ink); background: #fff;
  border: 1px solid #c8d3de; border-radius: 6px; padding: 11px 13px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(242,160,7,.35); border-color: var(--accent-dark); }
textarea { min-height: 150px; resize: vertical; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--muted); }
.checkbox input { margin-top: 4px; }
.hp { position: absolute; left: -9999px; }
.form-note { font-size: .84rem; color: var(--muted); }
.alert { padding: 14px 18px; border-radius: 6px; margin-bottom: 20px; font-size: .95rem; }
.alert--ok  { background: #e7f6ee; border: 1px solid #b6e0c8; color: var(--ok); }
.alert--err { background: #fdecea; border: 1px solid #f5c2bd; color: #a5342a; }

.info-list { list-style: none; padding: 0; margin: 0; }
.info-list li { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); margin: 0; }
.info-list li:last-child { border-bottom: 0; }
.info-list .ico { color: var(--accent-dark); font-weight: 800; }

/* ---------- Documenti ---------- */
.doc-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.doc-list li { margin: 0; }
.doc-list a {
  display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; padding: 14px 18px; font-weight: 600; color: var(--navy); box-shadow: var(--shadow-sm);
}
.doc-list a:hover { border-color: var(--accent); text-decoration: none; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-dark); color: #a9bccf; padding: 58px 0 0; font-size: .94rem; }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 1em; }
.site-footer a { color: #dce7f2; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .55em; }
.footer-grid { display: grid; gap: 34px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.footer-bottom {
  margin-top: 46px; border-top: 1px solid rgba(255,255,255,.12); padding: 20px 0;
  font-size: .85rem; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
}

/* ---------- Utility ---------- */
.mb-0 { margin-bottom: 0; }
.mt-3 { margin-top: 30px; }
.hidden { display: none !important; }

@media print {
  .site-header, .topbar, .site-footer, .hero__actions, .filters { display: none; }
  body { font-size: 11pt; }
}

/* ---------- Marchi di accreditamento ---------- */
.marks { display: flex; flex-wrap: wrap; gap: 30px; align-items: center; }
.marks img { max-height: 92px; width: auto; }
.marks figure { margin: 0; text-align: center; }
.marks figcaption { font-size: .8rem; color: var(--muted); margin-top: 8px; }
.figure-caption { font-size: .84rem; color: var(--muted); margin-top: 10px; }
