/* ═══════════════════════════════════════════════════════════
   Carrozzeria Pilato – Design System
   ═══════════════════════════════════════════════════════════ */

/* ── Reset & Variables ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:    #2a5fc4;
  --blue-dk: #1e4a9e;
  --gray-dk: #3d4450;
  --dark:    #1a1d23;
  --gray-lt: #f4f5f7;
  --white:   #ffffff;
  --text:    #1a1d23;
  --muted:   #555e6b;
  --border:  #e5e7eb;
}

html { scroll-behavior: smooth; overflow-x: hidden; }
body { font-family: 'Inter', sans-serif; color: var(--text); background: var(--white); line-height: 1.6; overflow-x: hidden; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

/* ── Shared Utilities ──────────────────────────────────────── */
.section-label {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--blue); margin-bottom: 0.6rem;
}
.section-title {
  font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 700;
  color: var(--text); margin-bottom: 1rem;
}
.section-sub { font-size: 1rem; color: var(--muted); max-width: 600px; }
.section-header { margin-bottom: 3rem; }

section { padding: 80px 5%; }

.btn-primary {
  display: inline-block; background: var(--blue); color: var(--white);
  padding: 0.85rem 2rem; border-radius: 8px; text-decoration: none;
  font-weight: 600; font-size: 0.95rem; transition: background 0.2s, transform 0.15s;
}
.btn-primary:hover { background: var(--blue-dk); transform: translateY(-1px); }

.btn-outline {
  display: inline-block; border: 1.5px solid var(--border); color: var(--text);
  padding: 0.85rem 2rem; border-radius: 8px; text-decoration: none;
  font-weight: 500; font-size: 0.95rem; transition: border-color 0.2s;
}
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }

/* ── Nav ───────────────────────────────────────────────────── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: #1a1d23;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 5%; height: 64px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.nav-logo img { height: 40px; }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  color: rgba(255,255,255,0.85); text-decoration: none;
  font-size: 0.9rem; font-weight: 500; letter-spacing: 0.03em; transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--white); }
.nav-cta {
  background: var(--blue); color: var(--white) !important;
  padding: 0.45rem 1.1rem; border-radius: 6px; transition: background 0.2s !important;
}
.nav-cta:hover { background: var(--blue-dk) !important; }

/* Hamburger */
.nav-hamburger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 4px; background: none; border: none;
}
.nav-hamburger span {
  display: block; width: 24px; height: 2px;
  background: rgba(255,255,255,0.85); border-radius: 2px; transition: all 0.3s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Hero ──────────────────────────────────────────────────── */
#hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(135deg, rgba(26,29,35,0.82) 0%, rgba(42,53,80,0.75) 50%, rgba(26,29,35,0.88) 100%),
    url('../SfondoGenerale.jpg') center center / cover no-repeat;
  text-align: center; padding: 100px 5% 60px;
}
.hero-inner { max-width: 720px; }
.hero-badge {
  display: inline-block; background: rgba(42,95,196,0.2);
  border: 1px solid rgba(42,95,196,0.4); color: #7aa8f0;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; padding: 0.35rem 1rem; border-radius: 20px; margin-bottom: 1.5rem;
}
#hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 700;
  color: var(--white); line-height: 1.15; margin-bottom: 1.2rem;
}
#hero p { font-size: 1.1rem; color: rgba(255,255,255,0.7); margin-bottom: 2.5rem; line-height: 1.7; }
.hero-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn-hero-primary {
  display: inline-block; background: var(--blue); color: var(--white);
  padding: 0.9rem 2.2rem; border-radius: 8px; text-decoration: none;
  font-weight: 600; font-size: 1rem; transition: background 0.2s, transform 0.15s;
}
.btn-hero-primary:hover { background: var(--blue-dk); transform: translateY(-2px); }
.btn-hero-outline {
  display: inline-block; border: 1.5px solid rgba(255,255,255,0.35); color: var(--white);
  padding: 0.9rem 2.2rem; border-radius: 8px; text-decoration: none;
  font-weight: 500; font-size: 1rem; transition: border-color 0.2s, background 0.2s;
}
.btn-hero-outline:hover { border-color: var(--white); background: rgba(255,255,255,0.08); }

/* ── Stats Bar ─────────────────────────────────────────────── */
.stats-bar {
  background: var(--blue); padding: 2.5rem 5%;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; text-align: center;
}
.stat-num { font-size: 2.2rem; font-weight: 700; color: var(--white); line-height: 1; }
.stat-label { font-size: 0.85rem; color: rgba(255,255,255,0.8); margin-top: 0.3rem; }

/* ── Servizi Carousel ──────────────────────────────────────── */
#servizi { padding: 80px 5%; }
.carousel-wrap { position: relative; }
.carousel-track-outer { overflow: hidden; }
.carousel-track { display: flex; transition: transform 0.4s ease; }
.service-card {
  flex: 0 0 calc(33.333% - 1rem); margin: 0 0.5rem;
  background: var(--white); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; cursor: pointer; transition: box-shadow 0.2s, transform 0.2s;
}
.service-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,0.12); transform: translateY(-3px); }
.service-card img { width: 100%; height: 200px; object-fit: cover; display: block; }
.service-card-body { padding: 1.2rem 1.4rem 1.4rem; }
.service-card-body h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.4rem; }
.service-card-body p {
  font-size: 0.85rem; color: var(--muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--border);
  background: var(--white); cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: var(--text); transition: background 0.2s, border-color 0.2s;
  z-index: 2; box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.carousel-btn:hover { background: var(--blue); border-color: var(--blue); color: var(--white); }
.carousel-btn.prev { left: -22px; }
.carousel-btn.next { right: -22px; }
.carousel-dots { display: flex; justify-content: center; gap: 0.5rem; margin-top: 1.5rem; }
.carousel-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--border);
  cursor: pointer; transition: background 0.2s, transform 0.2s; border: none;
}
.carousel-dot.active { background: var(--blue); transform: scale(1.3); }

/* ── Modal Servizi ─────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  z-index: 1000; align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--white); border-radius: 16px; max-width: 820px; width: 100%;
  display: grid; grid-template-columns: 1fr 1fr; overflow: hidden;
  max-height: 90vh; position: relative;
}
.modal-img { overflow: hidden; }
.modal-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.modal-content { padding: 2.5rem; overflow-y: auto; }
.modal-content h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 1rem; }
.modal-content p { font-size: 0.95rem; color: var(--muted); line-height: 1.7; }
.modal-close {
  position: absolute; top: 1rem; right: 1rem; width: 36px; height: 36px;
  border-radius: 50%; border: none; background: rgba(0,0,0,0.15); color: var(--white);
  font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s; z-index: 1;
}
.modal-close:hover { background: rgba(0,0,0,0.4); }

/* ── Chi Siamo ─────────────────────────────────────────────── */
#chi-siamo { background: var(--gray-lt); }
.chisiamo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.slideshow-wrap {
  position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 4/3; background: #000;
}
.slideshow-wrap img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity 0.8s ease;
}
.slideshow-wrap img.active { opacity: 1; }
.slideshow-link {
  display: inline-block; margin-top: 1rem; color: var(--blue);
  font-weight: 600; font-size: 0.9rem; text-decoration: none;
}
.slideshow-link:hover { text-decoration: underline; }
.chisiamo-features { display: flex; flex-direction: column; gap: 0.9rem; margin: 1.5rem 0 2rem; }
.chisiamo-feature { display: flex; gap: 0.8rem; align-items: flex-start; font-size: 0.95rem; }
.chisiamo-check {
  width: 22px; height: 22px; min-width: 22px; background: var(--blue);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: white; font-size: 0.65rem; margin-top: 2px;
}

/* ── Convenzioni ───────────────────────────────────────────── */
#convenzioni { background: #eef0f4; }
.conv-header { text-align: center; margin-bottom: 3rem; }
.conv-logos-row { display: flex; align-items: center; justify-content: center; gap: 1.5rem; flex-wrap: wrap; }
.conv-logo-card {
  display: flex; align-items: center; justify-content: center;
  background: var(--white); border: 1px solid var(--border); border-radius: 14px;
  padding: 1.4rem 2rem; height: 100px; min-width: 160px;
  transition: box-shadow 0.2s, transform 0.2s;
}
.conv-logo-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.1); transform: translateY(-3px); }
.conv-logo-card img { max-width: 130px; max-height: 55px; object-fit: contain; filter: grayscale(20%); transition: filter 0.2s; }
.conv-logo-card:hover img { filter: grayscale(0%); }
.conv-bottom { text-align: center; margin-top: 2.5rem; }
.conv-bottom p { color: var(--muted); font-size: 0.95rem; margin-bottom: 1.5rem; }

/* ── Contatti ──────────────────────────────────────────────── */
#contatti { background: var(--dark); padding: 80px 5%; }
#contatti .section-label { color: #7aa8f0; }
#contatti .section-title { color: var(--white); }
#contatti .section-sub { color: rgba(255,255,255,0.6); }

.ct-quick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 3rem;
}
.ct-quick-card {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px; padding: 1.5rem 1.2rem; text-align: center;
  text-decoration: none; color: var(--white);
  transition: background 0.2s, transform 0.2s, border-color 0.2s;
}
.ct-quick-card:hover { background: rgba(42,95,196,0.2); border-color: rgba(42,95,196,0.4); transform: translateY(-3px); }
.ct-quick-static:hover { transform: none; background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); }
.ct-quick-icon { font-size: 1.8rem; margin-bottom: 0.6rem; }
.ct-quick-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.45); margin-bottom: 0.3rem; }
.ct-quick-value { font-size: 0.88rem; color: rgba(255,255,255,0.85); line-height: 1.5; }

.ct-main { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }

.ct-form-wrap { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 20px; padding: 2.5rem; }
.ct-form-title { font-size: 1.15rem; font-weight: 700; color: var(--white); margin-bottom: 2rem; }
.ct-form { display: flex; flex-direction: column; gap: 1rem; }
.cf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.cf-field { display: flex; flex-direction: column; gap: 0.4rem; }
.cf-label { font-size: 0.8rem; font-weight: 500; color: rgba(255,255,255,0.55); text-transform: uppercase; letter-spacing: 0.06em; }
.cf-input {
  width: 100%; padding: 0.85rem 1rem;
  background: rgba(255,255,255,0.08); border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 10px; font-family: inherit; font-size: 0.95rem;
  color: var(--white); transition: border-color 0.2s, background 0.2s; outline: none;
}
.cf-input::placeholder { color: rgba(255,255,255,0.25); }
.cf-input:focus { border-color: var(--blue); background: rgba(255,255,255,0.12); }
.cf-textarea { min-height: 130px; resize: vertical; }

.cf-field-file {}
.cf-file-label {
  display: flex; align-items: center; gap: 0.6rem;
  background: rgba(255,255,255,0.05); border: 1.5px dashed rgba(255,255,255,0.18);
  border-radius: 10px; padding: 0.9rem 1rem; cursor: pointer;
  font-size: 0.85rem; color: rgba(255,255,255,0.55); transition: border-color 0.2s;
}
.cf-file-label:hover { border-color: rgba(42,95,196,0.5); color: rgba(255,255,255,0.8); }
.cf-file-label input[type=file] { display: none; }

.cf-privacy-row { display: flex; flex-direction: column; gap: 0.6rem; }
.cf-privacy-text { font-size: 0.75rem; color: rgba(255,255,255,0.35); line-height: 1.6; }
.cf-checkbox-label { display: flex; align-items: center; gap: 0.7rem; font-size: 0.85rem; color: rgba(255,255,255,0.65); cursor: pointer; }
.cf-checkbox-label input[type=checkbox] { display: none; }
.cf-checkbox-custom { width: 18px; height: 18px; min-width: 18px; border: 1.5px solid rgba(255,255,255,0.3); border-radius: 4px; background: transparent; transition: all 0.2s; position: relative; }
.cf-checkbox-label input[type=checkbox]:checked ~ .cf-checkbox-custom { background: var(--blue); border-color: var(--blue); }
.cf-checkbox-label input[type=checkbox]:checked ~ .cf-checkbox-custom::after { content: '✓'; position: absolute; top: -1px; left: 2px; font-size: 0.75rem; color: white; }

.ct-submit {
  width: 100%; padding: 1rem; background: var(--blue); color: white;
  border: none; border-radius: 10px; font-family: inherit; font-size: 1rem;
  font-weight: 600; cursor: pointer; transition: background 0.2s, transform 0.15s;
}
.ct-submit:hover { background: var(--blue-dk); transform: translateY(-1px); }

.ct-map-col { display: flex; flex-direction: column; gap: 1.2rem; }
.ct-address-box { display: flex; gap: 1rem; align-items: flex-start; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 1.4rem; }
.ct-address-icon { font-size: 1.5rem; }
.ct-address-title { font-size: 0.75rem; font-weight: 600; color: rgba(255,255,255,0.45); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.3rem; }
.ct-address-text { font-size: 0.95rem; color: var(--white); line-height: 1.6; }
.ct-map-wrap { border-radius: 16px; overflow: hidden; flex: 1; min-height: 380px; }
.ct-map-wrap iframe { width: 100%; height: 100%; border: 0; display: block; min-height: 562px; }

/* ── Footer ────────────────────────────────────────────────── */
footer {
  background: var(--dark); color: rgba(255,255,255,0.6);
  padding: 2.5rem 5%; display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 1rem; font-size: 0.85rem;
}
footer a { color: rgba(255,255,255,0.6); text-decoration: none; }
footer a:hover { color: var(--white); }
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }

/* ── Page Hero (pagine interne) ────────────────────────────── */
.page-hero {
background:
  linear-gradient(
    135deg,
    rgba(0,0,0,0.7),
    rgba(15,23,42,0.55)
  ),
  url('../SfondoGenerale.jpg') center/cover no-repeat;
  padding: 120px 5% 60px; text-align: center;
}
.page-hero .hero-badge {
  display: inline-block; background: rgba(42,95,196,0.2);
  border: 1px solid rgba(42,95,196,0.4); color: #7aa8f0;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; padding: 0.35rem 1rem; border-radius: 20px; margin-bottom: 1rem;
}
.page-hero h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; color: var(--white); margin-bottom: 0.8rem; }
.page-hero p { font-size: 1rem; color: rgba(255,255,255,0.7); max-width: 560px; margin: 0 auto; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .service-card { flex: 0 0 calc(50% - 1rem); }
  .ct-quick { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .nav-hamburger { display: flex; }
  .nav-links {
    display: none; flex-direction: column; gap: 0;
    position: absolute; top: 64px; left: 0; right: 0;
    background: #1a1d23; padding: 1rem 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  }
  .nav-links.open { display: flex; }
  .nav-links li { border-bottom: 1px solid rgba(255,255,255,0.06); }
  .nav-links a { display: block; padding: 0.85rem 5%; font-size: 1rem; }
  .nav-links .nav-cta { margin: 0.5rem 5%; border-radius: 6px; text-align: center; }
  .chisiamo-grid { grid-template-columns: 1fr; gap: 2rem; }
  .ct-row { grid-template-columns: 1fr; gap: 2rem; }
  .cf-grid { grid-template-columns: 1fr; }
  .ct-map-wrap { height: 300px; }
  .ct-main { grid-template-columns: 1fr; gap: 2rem; }
  .cf-row { grid-template-columns: 1fr; }
  .ct-map-wrap, .ct-map-wrap iframe { min-height: 280px; }
  footer { flex-direction: column; text-align: center; }
  .modal-box { grid-template-columns: 1fr; }
  .modal-img { height: 200px; }
}
@media (max-width: 640px) {
  .modal-box { grid-template-columns: 1fr; }
  .modal-img { height: 200px; }
}
@media (max-width: 600px) {
  .stats-bar { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
  .service-card { flex: 0 0 calc(100% - 1rem); }
  .carousel-btn.prev { left: -10px; }
  .carousel-btn.next { right: -10px; }
  .conv-logos-row { gap: 1rem; }
  .conv-logo-card { min-width: 130px; padding: 1rem 1.2rem; height: 80px; }
  .conv-logo-card img { max-width: 100px; max-height: 44px; }
}
@media (max-width: 480px) {
  .ct-quick { grid-template-columns: 1fr 1fr; gap: 0.8rem; }
  .ct-quick-card { padding: 1.2rem 0.8rem; }
  .ct-quick-value { font-size: 0.78rem; }
}
