/* X3Solutions - stile condiviso su tutte le pagine */

:root {
  --bg: #212121;
  --bg-alt: #1e1e1e;
  --bg-darker: #171717;
  --red: #d82828;
  --red-dark: #a31d1d;
  --text: #f9f9f9;
  --text-muted: #c8c8c8;
  --border: #3a3a3a;
  --max-width: 1140px;
  --font-heading: "Poppins", sans-serif;
  --font-body: "Source Sans Pro", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}

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

a {
  color: var(--red);
  text-decoration: none;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  color: var(--text);
  font-weight: 600;
  margin: 0 0 20px;
  line-height: 1.2;
}

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

.red {
  color: var(--red);
}

.btn {
  display: inline-block;
  background: var(--red);
  color: var(--text);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 15px;
  padding: 14px 28px;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn:hover {
  background: var(--red-dark);
}

.section {
  padding: 80px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-label {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.section-label::before {
  content: "";
  width: 40px;
  height: 2px;
  background: var(--red);
  display: block;
}

.section-label span {
  color: var(--red);
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 14px;
}

/* ---------- Header / Nav ---------- */

.site-header {
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}

.site-logo img {
  height: 56px;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 32px;
  margin: 0;
  padding: 0;
}

.main-nav a {
  color: #c97a86;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 500;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--red);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
}

@media (max-width: 900px) {
  .main-nav {
    position: fixed;
    top: 88px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .main-nav.open {
    max-height: 400px;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 8px 24px 16px;
  }

  .main-nav li {
    border-top: 1px solid var(--border);
  }

  .main-nav a {
    display: block;
    padding: 14px 0;
  }

  .nav-toggle {
    display: block;
  }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 780px;
  display: flex;
  align-items: center;
  background: linear-gradient(90deg, rgba(8, 4, 4, 0.65) 0%, rgba(8, 4, 4, 0.15) 60%),
    url("../assets/images/sfondo-slider-x3_e.jpg") center / cover no-repeat;
}

.hero .container {
  padding-top: 60px;
  padding-bottom: 60px;
}

.hero h1 {
  font-size: 85px;
  line-height: 1.1;
  max-width: 700px;
  margin: 0;
}

.hero h1 .red {
  color: var(--red);
}

.page-hero {
  min-height: 340px;
}

.page-hero h1 {
  font-size: 45px;
}

@media (max-width: 1024px) {
  .hero h1 {
    font-size: 70px;
  }
}

/* ---------- Service grid ---------- */

.service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

@media (max-width: 1200px) {
  .service-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.service-grid-5 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1200px) {
  .service-grid-5 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.service-card {
  border: 1px solid var(--border);
  padding: 32px;
  transition: border-color 0.2s ease;
}

.service-card:hover {
  border-color: var(--red);
}

.service-card .icon {
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  color: var(--red);
}

.service-card h3 {
  font-size: 24px;
  margin-bottom: 10px;
}

.service-card p {
  margin: 0;
}

/* ---------- Two column ---------- */

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

/* ---------- Checklist ---------- */

.checklist {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.checklist li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}

.checklist li::before {
  content: "\2713";
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--red);
  color: var(--text);
  font-size: 13px;
  flex-shrink: 0;
}

/* ---------- Partner logos (statiche) ---------- */

.partner-logos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
}

.partner-logos img {
  height: 40px;
  width: auto;
  filter: grayscale(1) brightness(2);
}

/* ---------- Logo carousel (slide a scatti, 4 alla volta) ---------- */

.logo-carousel {
  overflow: hidden;
  background: var(--bg-darker);
  padding: 40px 0;
}

.logo-slider {
  position: relative;
  min-height: 40px;
}

.logo-slide {
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  align-items: center;
}

.logo-slide.active {
  display: grid;
}

.logo-slide img {
  height: 34px;
  width: auto;
  margin: 0 auto;
  filter: grayscale(1) brightness(2);
  opacity: 0.85;
}

@media (max-width: 900px) {
  .logo-slide {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 24px;
  }
}

/* ---------- Stats bar ---------- */

.stats-bar {
  background: linear-gradient(rgba(110, 8, 8, 0.5), rgba(140, 10, 10, 0.72)),
    url("../assets/images/modern-circuit-board-hardware-62Z2WP5.jpg") center / cover no-repeat;
  padding: 70px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  text-align: center;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 48px;
  font-weight: 600;
  color: var(--text);
}

.stat-label {
  color: var(--text-muted);
  margin-top: 6px;
}

/* ---------- Decorative texture sections ---------- */

.texture-section {
  background: linear-gradient(rgba(20, 4, 4, 0.9), rgba(20, 4, 4, 0.9)),
    url("../assets/images/Tech1.png") center / cover no-repeat;
}

.dark-red-bg {
  background: linear-gradient(135deg, #2a1010, #180808);
}

/* ---------- CTA banner ---------- */

.cta-banner {
  background: linear-gradient(rgba(120, 10, 10, 0.75), rgba(120, 10, 10, 0.75)),
    url("../assets/images/8.jpg") center / cover no-repeat;
  padding: 70px 0;
  text-align: center;
}

.cta-banner h2 {
  font-size: 40px;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
}

.site-footer img {
  height: 48px;
  margin: 0 auto 12px;
}

.site-footer p {
  margin: 0;
  font-size: 13px;
}

/* ---------- Job list (accordion) ---------- */

.job-item {
  border: 1px solid var(--border);
  margin-bottom: 16px;
  padding: 4px 24px;
}

.job-item summary {
  cursor: pointer;
  padding: 18px 0;
  color: var(--text);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 18px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.job-item summary::-webkit-details-marker {
  display: none;
}

.job-item summary::after {
  content: "+";
  color: var(--red);
  font-size: 24px;
}

.job-item[open] summary::after {
  content: "\2212";
}

.job-meta {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}

.job-item .job-body {
  padding-bottom: 24px;
}

.job-item .job-body h4 {
  font-size: 16px;
  margin: 20px 0 8px;
}

.job-item .job-body ul {
  padding-left: 20px;
}

/* ---------- Aid table ---------- */

.table-wrapper {
  overflow-x: auto;
  margin-bottom: 48px;
}

table.aid-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

table.aid-table caption {
  text-align: left;
  font-family: var(--font-heading);
  color: var(--text);
  font-size: 20px;
  margin-bottom: 16px;
}

table.aid-table th,
table.aid-table td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
  font-size: 14px;
}

table.aid-table th {
  background: var(--bg-alt);
  color: var(--text);
  font-family: var(--font-heading);
}

/* ---------- Empty state ---------- */

.empty-state {
  text-align: center;
  padding: 60px 0;
  color: var(--text-muted);
}

/* ---------- Cookie banner ---------- */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 200;
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner p {
  margin: 0;
  font-size: 14px;
  flex: 1 1 480px;
}

.cookie-banner .cookie-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.cookie-banner .btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-heading);
  font-size: 14px;
  padding: 12px 20px;
  cursor: pointer;
}

.cookie-banner .btn-reject {
  background: transparent;
  border: 1px solid var(--red);
  color: var(--red);
  font-family: var(--font-heading);
  font-size: 14px;
  padding: 12px 20px;
  cursor: pointer;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero h1 {
    font-size: 38px;
  }

  .service-grid,
  .checklist,
  .partner-logos {
    grid-template-columns: 1fr;
  }

  .two-col {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 24px;
  }

  .section {
    padding: 56px 0;
  }
}
