:root {
  --navy: #141f2e;
  --navy-light: #1e2f45;
  --paper: #f7f6f3;
  --white: #ffffff;
  --ink: #1c2733;
  --muted: #5b6b7c;
  --line: #e2e0d9;
  --gold: #b6893f;
  --gold-dark: #8f6b2f;
  --radius: 10px;
  --shadow: 0 12px 30px -14px rgba(20, 31, 46, 0.25);
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
}

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

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; }

h1, h2, h3 { font-family: "Georgia", "Times New Roman", serif; color: var(--navy); margin: 0 0 .5em; line-height: 1.2; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .78rem;
  font-weight: 700;
  color: var(--gold-dark);
  margin-bottom: .75em;
  display: block;
}

.lead { color: var(--muted); font-size: 1.08rem; max-width: 640px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: 14px 26px;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  font-size: .95rem;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--gold); color: var(--white); }
.btn-primary:hover { background: var(--gold-dark); }
.btn-outline { background: transparent; border-color: var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-outline-light { background: transparent; border-color: rgba(255,255,255,.5); color: var(--white); }
.btn-outline-light:hover { background: rgba(255,255,255,.12); border-color: var(--white); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 246, 243, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand svg { height: 30px; width: auto; }

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
}
.main-nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: .93rem;
  color: var(--navy);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover, .main-nav a.active { border-color: var(--gold); }

.header-actions { display: flex; align-items: center; gap: 16px; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span, .nav-toggle::before, .nav-toggle::after {
  content: "";
  display: block;
  width: 24px;
  height: 2px;
  background: var(--navy);
  margin: 5px 0;
  transition: transform .2s ease, opacity .2s ease;
}

/* Hero */
.hero {
  background:
    linear-gradient(160deg, rgba(20,31,46,.94) 0%, rgba(30,47,69,.9) 100%),
    url("../assets/img/hero-consulenza.jpg") center 30% / cover no-repeat;
  color: var(--white);
  padding: 96px 0 80px;
}
.hero .container { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero h1 { color: var(--white); font-size: clamp(2rem, 4vw, 3rem); }
.hero .lead { color: rgba(255,255,255,.82); }
.hero-actions { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }

.hero-panel {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--radius);
  padding: 28px;
}
.hero-panel ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.hero-panel li { display: flex; gap: 12px; align-items: flex-start; font-size: .95rem; color: rgba(255,255,255,.9); }
.hero-panel .tick {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 900;
}

/* Section shell */
section { padding: 88px 0; }
.section-head { max-width: 680px; margin: 0 auto 48px; text-align: center; }
.section-head.left { margin-left: 0; text-align: left; }
.bg-paper { background: var(--paper); }

/* Servizi grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.service-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.service-card .num {
  font-family: Georgia, serif;
  font-size: 1.6rem;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 10px;
  display: block;
}
.service-card h3 { font-size: 1.08rem; margin-bottom: 8px; }
.service-card p { color: var(--muted); font-size: .93rem; margin: 0; }

/* Come funziona */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  counter-reset: step;
}
.step { position: relative; padding-top: 8px; }
.step::before {
  counter-increment: step;
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  font-weight: 800;
  font-family: Georgia, serif;
  margin-bottom: 18px;
}
.step h3 { font-size: 1.02rem; }
.step p { color: var(--muted); font-size: .92rem; }

/* Perché ERGO */
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.why-item { padding: 24px 0; border-top: 3px solid var(--gold); }
.why-item h3 { font-size: 1.05rem; }
.why-item p { color: var(--muted); font-size: .93rem; margin: 0; }

/* Chi siamo */
.about .container { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.about-figure {
  margin: 0;
  border-radius: var(--radius);
  min-height: 320px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.about-figure img { width: 100%; height: 100%; min-height: 320px; object-fit: cover; }

/* Image band */
.image-band { position: relative; min-height: 340px; display: flex; align-items: flex-end; overflow: hidden; }
.image-band img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.image-band-copy {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 48px 0;
  background: linear-gradient(to top, rgba(20,31,46,.92) 0%, rgba(20,31,46,.35) 65%, rgba(20,31,46,0) 100%);
  color: var(--white);
}
.image-band-copy h2 { color: var(--white); }
.image-band-copy .lead { color: rgba(255,255,255,.85); }

/* CTA banda */
.cta-band {
  background:
    linear-gradient(rgba(20,31,46,.88), rgba(20,31,46,.9)),
    url("../assets/img/documenti-calcolo.jpg") center / cover no-repeat;
  color: var(--white);
  text-align: center;
}
.cta-band h2 { color: var(--white); }
.cta-band .lead { color: rgba(255,255,255,.85); }
.cta-band .btn-primary { background: var(--gold); color: var(--navy); }
.cta-band .btn-primary:hover { background: var(--gold-dark); color: var(--white); }

/* Contatti */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.contact-info dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 24px 0; }
.contact-info dt { font-weight: 700; color: var(--navy); }
.contact-info dd { margin: 0; color: var(--muted); }
.map-frame { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 24px; }
.map-frame iframe { width: 100%; height: 220px; border: 0; display: block; }

form.contact-form { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { font-weight: 700; font-size: .85rem; color: var(--navy); display: block; margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  background: var(--white);
  color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.consent { display: flex; align-items: flex-start; gap: 10px; font-size: .85rem; color: var(--muted); }
.consent input { width: auto; margin-top: 3px; }
.form-note { font-size: .8rem; color: var(--muted); }
.form-status { font-size: .9rem; font-weight: 600; min-height: 1.2em; }
.form-status.ok { color: #2e7d4f; }
.form-status.err { color: #b3382c; }

/* Footer */
.site-footer { background: var(--navy); color: rgba(255,255,255,.8); padding: 56px 0 28px; font-size: .9rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.site-footer h4 { color: var(--white); font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 16px; }
.footer-brand svg { height: 26px; width: auto; filter: brightness(0) invert(1); margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.site-footer a { text-decoration: none; color: rgba(255,255,255,.75); }
.site-footer a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: .8rem;
  color: rgba(255,255,255,.55);
}
.disclaimer { max-width: 900px; margin: 0 auto 32px; font-size: .78rem; color: rgba(255,255,255,.5); text-align: center; }

/* Placeholder highlight so unfilled data is obvious before publishing */
.placeholder { background: rgba(182,137,63,.18); border-bottom: 1px dashed var(--gold-dark); padding: 0 2px; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .main-nav { position: fixed; inset: 76px 0 auto 0; background: var(--paper); border-bottom: 1px solid var(--line); transform: translateY(-8px); opacity: 0; pointer-events: none; transition: all .18s ease; }
  .main-nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .main-nav ul { flex-direction: column; padding: 20px 24px; gap: 4px; }
  .main-nav a { display: block; padding: 12px 0; }
  .header-actions .btn-outline { display: none; }

  .hero .container, .about .container, .contact-grid { grid-template-columns: 1fr; }
  .hero-panel { order: -1; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .why-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .services-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  section { padding: 64px 0; }
  .hero { padding: 72px 0 56px; }
  .image-band { min-height: 260px; }
  .about-figure, .about-figure img { min-height: 220px; }
}
