/* =========================================================
   SACI COSTRUZIONI — Global Styles
   ========================================================= */

/* ── CSS Variables ── */
:root {
  --color-primary:      #1A3A6B;
  --color-primary-dark: #0F2449;
  --color-secondary:    #1C1C1E;
  --color-gray:         #6B6B6B;
  --color-gray-light:   #A8A8A8;
  --color-light:        #F5F5F5;
  --color-white:        #FFFFFF;
  --color-border:       #E0E0E0;

  --font-heading: 'Montserrat', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-script:  'Playfair Display', serif;

  --shadow-sm:  0 2px 8px rgba(0,0,0,.08);
  --shadow-md:  0 4px 24px rgba(0,0,0,.12);
  --shadow-lg:  0 8px 48px rgba(0,0,0,.18);

  --radius:     4px;
  --transition: .3s ease;

  --max-width: 1280px;
  --section-py: 96px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  color: var(--color-secondary);
  background: var(--color-white);
  line-height: 1.6;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

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

/* ── Typography ── */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.2;
  font-weight: 700;
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }

p { font-size: 1rem; line-height: 1.75; color: var(--color-gray); }

.section-title {
  text-align: center;
  margin-bottom: 16px;
  color: var(--color-secondary);
}
.section-subtitle {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 56px;
  font-size: 1.05rem;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  font-family: var(--font-heading);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: transform .3s ease, box-shadow .3s ease, background .3s ease, color .3s ease;
  cursor: pointer;
}
.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
}
.btn-primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn-outline {
  background: transparent;
  color: var(--color-white);
  border: 2px solid var(--color-white);
}
.btn-outline:hover {
  background: var(--color-white);
  color: var(--color-primary);
}
.btn-outline-dark {
  background: transparent;
  color: var(--color-secondary);
  border: 2px solid var(--color-secondary);
}
.btn-outline-dark:hover {
  background: var(--color-secondary);
  color: var(--color-white);
}

/* ── Section Padding ── */
.section { padding: var(--section-py) 0; }
.section-alt { background: var(--color-light); }

/* ── Divider ── */
.divider {
  width: 56px;
  height: 3px;
  background: var(--color-primary);
  margin: 16px auto 32px;
}
.divider-left { margin: 16px 0 32px; }

/* ── Tag/Badge ── */
.tag {
  display: table;
  margin: 0 auto 12px;
  padding: 4px 12px;
  background: var(--color-primary);
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  border-radius: 2px;
}

/* ── WhatsApp Floating Button ── */
.whatsapp-float {
  position: fixed;
  bottom: 32px;
  left: 32px;
  z-index: 9000;
  width: 56px;
  height: 56px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: transform .3s ease, box-shadow .3s ease;
}
.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
}
.whatsapp-float i { font-size: 1.6rem; color: #fff; }

/* ── Back to Top ── */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 9000;
  width: 44px;
  height: 44px;
  background: var(--color-secondary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease, background .3s ease;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { background: var(--color-primary); transform: translateY(-3px); }

/* ── Scroll Animations ── */
.fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .7s ease, transform .7s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }
.fade-up:nth-child(2) { transition-delay: .15s; }
.fade-up:nth-child(3) { transition-delay: .3s; }
.fade-up:nth-child(4) { transition-delay: .45s; }

/* ── Page Hero (inner pages) ── */
.page-hero {
  position: relative;
  height: 55vh;
  min-height: 480px;
  display: flex;
  align-items: center;
  margin-top: 0;
  overflow: hidden;
}

/* Inherit the background image but scale it purely on GPU */
.page-hero::before {
  content: '';
  position: absolute;
  inset: -5%;
  background-image: inherit;
  background-size: cover;
  background-position: center;
  transform: scale(1.06);
  animation: pageHeroBgScale 6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  will-change: transform;
  z-index: 0;
}

/* Premium Gradient Filter */
.page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,.35) 0%,
    rgba(0,0,0,.5) 50%,
    rgba(0,0,0,.7) 100%
  );
  z-index: 1;
}

.page-hero .container { 
  position: relative; 
  z-index: 2; 
  padding-top: 60px; /* offset for transparent navbar */
  pointer-events: none;
}
.page-hero .container > * { pointer-events: auto; }

/* Animate the main heading */
.page-hero h1 { 
  color: #fff; 
  margin-bottom: 24px;
  font-family: var(--font-script);
  font-style: italic;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 400;
  text-shadow: 0 4px 16px rgba(0,0,0,.4);
  opacity: 0;
  animation: pageHeroFadeUp 0.9s ease 0.3s forwards;
  max-width: 800px;
}

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  color: rgba(255,255,255,.8);
  font-family: var(--font-heading);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 20px;
  opacity: 0;
  animation: pageHeroFadeDown 0.9s ease 0.1s forwards;
}
.breadcrumb a { color: rgba(255,255,255,.8); transition: color .2s; }
.breadcrumb a:hover { color: #fff; text-shadow: 0 0 8px rgba(255,255,255,.5); }
.breadcrumb i { font-size: .65rem; color: var(--color-primary); }

@keyframes pageHeroBgScale {
  0% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
@keyframes pageHeroFadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pageHeroFadeDown {
  from { opacity: 0; transform: translateY(-30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Page Header (compact, inner pages) ── */
.page-header {
  background: var(--color-primary);
  padding: 130px 0 44px;
  position: relative;
  overflow: hidden;
}
/* Diagonal line pattern */
.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -55deg,
    rgba(255,255,255,.014) 0px,
    rgba(255,255,255,.014) 1px,
    transparent 1px,
    transparent 52px
  );
  pointer-events: none;
}
/* Right accent shape */
.page-header::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 40%;
  background: linear-gradient(135deg, transparent 0%, rgba(26,58,107,.18) 100%);
  pointer-events: none;
}
.page-header .container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.page-header .breadcrumb {
  opacity: 0;
  animation: pageHeroFadeDown .6s ease .05s forwards;
}
.page-header .tag {
  opacity: 0;
  animation: pageHeroFadeUp .6s ease .18s forwards;
  margin-top: 16px;
}
.page-header h1 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(2rem, 3.8vw, 3rem);
  color: #fff;
  margin: 12px 0 14px;
  max-width: 760px;
  line-height: 1.1;
  opacity: 0;
  animation: pageHeroFadeUp .7s ease .3s forwards;
}
.page-header-sub {
  font-size: .95rem;
  line-height: 1.75;
  color: rgba(255,255,255,.55);
  max-width: 560px;
  opacity: 0;
  animation: pageHeroFadeUp .7s ease .45s forwards;
}
.page-header-stats {
  display: flex;
  gap: 32px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.1);
  opacity: 0;
  animation: pageHeroFadeUp .7s ease .6s forwards;
}
.page-header-stat strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.page-header-stat span {
  font-family: var(--font-heading);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  margin-top: 4px;
  display: block;
}
@media (max-width: 768px) {
  .page-header { padding: 110px 0 36px; }
  .page-header-stats { gap: 20px; flex-wrap: wrap; }
  .page-header-stat strong { font-size: 1.2rem; }
}

/* ── FAQ Accordion ── */
/* ── FAQ Premium ── */
.faq-section { background: var(--color-white); }
.faq-header  { margin-bottom: 0; }

.faq-wrap {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid var(--color-border);
  transition: background .3s ease;
}
.faq-item:first-child { border-top: 1px solid var(--color-border); }

.faq-item.open {
  background: #fafbff;
}

.faq-question {
  display: grid;
  grid-template-columns: 40px 1fr 36px;
  align-items: center;
  gap: 20px;
  padding: 24px 0;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-heading);
}

.faq-num {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--color-primary);
  opacity: .35;
  transition: opacity .3s ease;
  line-height: 1;
  padding-top: 2px;
}
.faq-item.open .faq-num,
.faq-question:hover .faq-num { opacity: 1; }

.faq-q-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-secondary);
  line-height: 1.45;
  transition: color .25s ease;
}
.faq-item.open .faq-q-text,
.faq-question:hover .faq-q-text { color: var(--color-primary); }

/* Icon: cross morphing to minus */
.faq-icon {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-light);
  flex-shrink: 0;
  transition: background .3s ease, transform .4s cubic-bezier(.25,.46,.45,.94);
}
.faq-icon::before,
.faq-icon::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  background: var(--color-primary);
  border-radius: 2px;
  transition: transform .4s cubic-bezier(.25,.46,.45,.94), opacity .3s ease, background .3s ease;
}
.faq-icon::before {
  width: 13px; height: 1.5px;
  transform: translate(-50%, -50%);
}
.faq-icon::after {
  width: 1.5px; height: 13px;
  transform: translate(-50%, -50%);
}
.faq-item.open .faq-icon {
  background: var(--color-primary);
  transform: rotate(45deg);
}
.faq-item.open .faq-icon::before,
.faq-item.open .faq-icon::after { background: #fff; }

/* Answer: JS-driven height — overflow hidden keeps paint contained */
.faq-answer {
  height: 0;
  overflow: hidden;
  will-change: height;
  transition: height .38s cubic-bezier(.4, 0, .2, 1);
}
.faq-answer-inner {
  padding-left: 60px;
}
.faq-answer-inner p {
  padding-bottom: 24px;
  font-size: .95rem;
  line-height: 1.85;
  color: var(--color-gray);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .3s ease .08s, transform .3s ease .08s;
}
.faq-item.open .faq-answer-inner p {
  opacity: 1;
  transform: translateY(0);
}

/* ── Performance: content-visibility ── */
.numbers-section,
.testimonials-section,
.cta-banner,
footer {
  content-visibility: auto;
  contain-intrinsic-size: 0 400px;
}

/* ── Responsive Utilities ── */
@media (max-width: 768px) {
  :root { --section-py: 64px; }
  .section-subtitle { margin-bottom: 40px; }
  .faq-question  { grid-template-columns: 32px 1fr 32px; gap: 12px; padding: 18px 0; }
  .faq-q-text    { font-size: .9rem; }
  .faq-answer-inner { padding-left: 44px; }
  .faq-icon      { width: 32px; height: 32px; }
}
