/* ── Variables ───────────────────────────────────────────── */
:root {
  --navy-darkest: #07192e;
  --navy-dark:    #0B2545;
  --navy-mid:     #0d3b6e;
  --blue:         #1B5FA8;
  --blue-light:   #2E86C1;
  --gray-dark:    #555555;
  --gray-mid:     #888888;
  --gray-light:   #f4f6f9;
  --white:        #ffffff;
  --text:         #1a1a2e;
  --text-muted:   #5a6a7a;

  --radius:       10px;
  --radius-lg:    18px;
  --shadow:       0 4px 24px rgba(11,37,69,.10);
  --shadow-lg:    0 8px 48px rgba(11,37,69,.18);
  --transition:   .3s cubic-bezier(.4,0,.2,1);
  --max-w:        1180px;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ── Typography ──────────────────────────────────────────── */
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; line-height: 1.1; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 700; line-height: 1.2; }
h3 { font-size: 1.25rem; font-weight: 600; }
p  { font-size: 1.05rem; color: var(--text-muted); }

.section-label {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blue-light);
  margin-bottom: .75rem;
}
.section-title { margin-bottom: 1rem; }
.section-desc  { max-width: 600px; margin-bottom: 3rem; }

/* ── Layout ──────────────────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }
section { padding: 6rem 0; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .85rem 2rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}
.btn-primary {
  background: var(--blue);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--blue-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46,134,193,.35);
}
.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,.5);
}
.btn-outline:hover {
  background: rgba(255,255,255,.1);
  border-color: var(--white);
}

/* ── Header / Nav ────────────────────────────────────────── */
#header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background var(--transition), box-shadow var(--transition);
}
#header.scrolled {
  background: rgba(7,25,46,.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0,0,0,.3);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.logo img { height: 62px; width: auto; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  list-style: none;
}
.nav-links a {
  color: rgba(255,255,255,.8);
  font-size: .95rem;
  font-weight: 500;
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--white); }

.nav-cta .btn { padding: .6rem 1.4rem; font-size: .9rem; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: var(--transition);
}

/* ── Hero ────────────────────────────────────────────────── */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--navy-darkest);
  padding: 0;
}
#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(27,95,168,.25);
  border: 1px solid rgba(46,134,193,.4);
  color: #7ec8e3;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .4rem 1rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}
.hero-badge::before {
  content: '';
  display: inline-block;
  width: 7px; height: 7px;
  background: #7ec8e3;
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .4; transform: scale(1.4); }
}
#hero h1 { color: var(--white); margin-bottom: 1.25rem; }
#hero h1 span { color: var(--blue-light); }
#hero .hero-desc {
  font-size: 1.15rem;
  color: rgba(255,255,255,.65);
  margin-bottom: 2.5rem;
  max-width: 540px;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-stats {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 2.5rem;
  margin-top: 5rem;
  padding-top: 3rem;
  border-top: 1px solid rgba(255,255,255,.1);
}
.stat-item { text-align: left; }
.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
}
.stat-label {
  font-size: .82rem;
  color: rgba(255,255,255,.5);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: .25rem;
}

/* ── Services ────────────────────────────────────────────── */
#servizi { background: var(--gray-light); }
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.service-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,.05);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--navy-dark), var(--blue-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.service-card:hover::before { transform: scaleX(1); }

.service-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--navy-dark), var(--blue));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}
.service-icon svg { width: 28px; height: 28px; stroke: var(--white); fill: none; stroke-width: 1.8; }
.service-card h3 { margin-bottom: .6rem; }
.service-card p { font-size: .95rem; }

/* ── Chi Siamo ───────────────────────────────────────────── */
#chi-siamo {
  background: var(--white);
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}
.about-visual {
  position: relative;
}
.about-map {
  width: 100%;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--navy-darkest) 0%, var(--navy-mid) 100%);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.about-map svg { width: 80%; opacity: .7; }

.about-badge {
  position: absolute;
  bottom: -1.5rem; right: -1.5rem;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
  min-width: 140px;
}
.about-badge-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--navy-dark);
  line-height: 1;
}
.about-badge-text {
  font-size: .8rem;
  color: var(--gray-mid);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: .2rem;
}

.about-content .values-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  margin-top: 2rem;
}
.values-list li {
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  font-size: .97rem;
  color: var(--text-muted);
}
.values-list li::before {
  content: '';
  flex-shrink: 0;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-dark), var(--blue));
  margin-top: .15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 10l3.5 3.5L15 7' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: cover;
}

/* ── Infrastruttura ──────────────────────────────────────── */
#infrastruttura {
  background: var(--navy-darkest);
  color: var(--white);
}
#infrastruttura .section-label { color: #7ec8e3; }
#infrastruttura h2 { color: var(--white); }
#infrastruttura .section-desc { color: rgba(255,255,255,.6); }

.infra-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 4rem;
}
.infra-card {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: var(--transition);
}
.infra-card:hover {
  background: rgba(27,95,168,.2);
  border-color: rgba(46,134,193,.4);
  transform: translateY(-4px);
}
.infra-card h3 { color: var(--white); margin-bottom: .5rem; margin-top: 1rem; }
.infra-card p  { font-size: .93rem; color: rgba(255,255,255,.55); }
.infra-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  background: rgba(27,95,168,.4);
  display: flex; align-items: center; justify-content: center;
}
.infra-icon svg { width: 24px; height: 24px; stroke: #7ec8e3; fill: none; stroke-width: 1.8; }

.infra-specs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  padding-top: 3rem;
  border-top: 1px solid rgba(255,255,255,.1);
}
.spec-item { text-align: center; }
.spec-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
}
.spec-value span { color: var(--blue-light); }
.spec-label {
  font-size: .82rem;
  color: rgba(255,255,255,.45);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: .4rem;
}

/* ── Contatti ────────────────────────────────────────────── */
#contatti { background: var(--gray-light); }
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: 680px;
}
.contact-info h2 { margin-bottom: 1rem; }
.contact-info p  { margin-bottom: 2rem; }

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.contact-item-icon {
  width: 44px; height: 44px;
  flex-shrink: 0;
  background: var(--navy-dark);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
}
.contact-item-icon svg { width: 20px; height: 20px; stroke: var(--white); fill: none; stroke-width: 1.8; }
.contact-item-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--blue); margin-bottom: .15rem; }
.contact-item-val   { font-size: .97rem; color: var(--text); font-weight: 500; }

/* Form */
.contact-form {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.25rem; }
.form-group label { font-size: .88rem; font-weight: 600; color: var(--text); }
.form-group input,
.form-group select,
.form-group textarea {
  padding: .75rem 1rem;
  border: 1.5px solid #dde3ea;
  border-radius: var(--radius);
  font-size: .97rem;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  resize: vertical;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(27,95,168,.12);
}
.form-privacy {
  display: flex; align-items: flex-start; gap: .75rem;
  font-size: .85rem; color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.form-privacy input[type="checkbox"] { margin-top: .2rem; flex-shrink: 0; }
.form-submit { width: 100%; justify-content: center; }

.form-success {
  display: none;
  text-align: center;
  padding: 2rem;
  color: #1a7a4a;
}
.form-success.active { display: block; }

/* ── Footer ──────────────────────────────────────────────── */
#footer {
  background: var(--navy-darkest);
  color: rgba(255,255,255,.6);
  padding: 3rem 0 2rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer-brand .logo img { height: 40px; margin-bottom: 1rem; }
.footer-brand p { font-size: .9rem; max-width: 280px; }
.footer-col h4 {
  font-size: .88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.9);
  margin-bottom: 1rem;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: .6rem; }
.footer-col ul li a { font-size: .9rem; transition: color var(--transition); }
.footer-col ul li a:hover { color: var(--white); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  font-size: .85rem;
}

/* ── Cookie banner (Garante 2021) ────────────────────────── */
#cookie-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  background: #0e2240;
  border: 1px solid rgba(46,134,193,.35);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  max-width: 860px;
  width: calc(100% - 2rem);
  box-shadow: 0 12px 48px rgba(0,0,0,.55);
  font-size: .88rem;
  line-height: 1.5;
  transition: opacity .3s ease, transform .3s ease;
}
#cookie-banner.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(12px);
  display: none;
}
.cookie-body {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex: 1;
}
.cookie-icon {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: var(--radius);
  background: rgba(46,134,193,.2);
  display: flex; align-items: center; justify-content: center;
  color: #7ec8e3;
}
.cookie-text strong {
  display: block;
  color: var(--white);
  font-size: .92rem;
  margin-bottom: .25rem;
}
.cookie-text p {
  color: rgba(255,255,255,.7);
  font-size: .85rem;
  margin: 0;
  line-height: 1.6;
}
.cookie-text a { color: #7ec8e3; text-decoration: underline; }
.cookie-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .6rem;
  flex-shrink: 0;
  min-width: 130px;
}
#cookie-accept {
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: .65rem 1.4rem;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition);
  font-family: inherit;
  text-align: center;
}
#cookie-accept:hover { background: var(--blue-light); }
.cookie-link-btn {
  display: block;
  text-align: center;
  color: rgba(255,255,255,.55);
  font-size: .8rem;
  text-decoration: underline;
  padding: .3rem;
  transition: color var(--transition);
}
.cookie-link-btn:hover { color: rgba(255,255,255,.9); }

@media (max-width: 640px) {
  #cookie-banner {
    flex-direction: column;
    align-items: stretch;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  #cookie-banner.hidden { transform: translateY(12px); }
  .cookie-actions { flex-direction: row-reverse; }
}

/* ── Scroll reveal ───────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* ── Mobile nav overlay ──────────────────────────────────── */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--navy-darkest);
  z-index: 99;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  color: var(--white);
  font-size: 1.4rem;
  font-weight: 600;
}
.mobile-nav-close {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  background: none; border: none;
  color: var(--white); font-size: 2rem;
  cursor: pointer; line-height: 1;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .about-grid    { grid-template-columns: 1fr; }
  .about-visual  { order: -1; }
  .about-badge   { bottom: 1rem; right: 1rem; }
  .infra-grid    { grid-template-columns: 1fr 1fr; }
  .infra-specs   { grid-template-columns: repeat(2, 1fr); }
  .contact-grid  { grid-template-columns: 1fr; }
  .footer-inner  { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  section { padding: 4rem 0; }
  .nav-links, .nav-cta { display: none; }
  .hamburger { display: flex; }
  .hero-stats { flex-wrap: wrap; gap: 1.5rem; }
  .infra-grid  { grid-template-columns: 1fr; }
  .infra-specs { grid-template-columns: repeat(2, 1fr); }
  .form-row    { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; gap: .5rem; text-align: center; }
}
