/* ===== RESET & BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --steel-blue: #4A6FA5;
  --safety-orange: #FF6B2B;
  --gunmetal: #2C3E50;
  --light-gray: #E8ECF0;
  --white: #FFFFFF;
  --radius: 16px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
}

body {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  color: var(--gunmetal);
  background: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

a {
  color: var(--steel-blue);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--safety-orange); }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-title {
  font-size: 2.2rem;
  text-align: center;
  margin-bottom: 40px;
  color: var(--gunmetal);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* ===== BLUEPRINT BACKGROUND ===== */
.blueprint-bg {
  background-image:
    linear-gradient(rgba(74, 111, 165, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 111, 165, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: panGrid 20s linear infinite;
}

@keyframes panGrid {
  to { background-position: 40px 40px; }
}

/* ===== NAV ===== */
.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--gunmetal);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--white);
  letter-spacing: 2px;
}
.nav-brand:hover { color: var(--safety-orange); }

.nav-links {
  list-style: none;
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-links a {
  color: var(--light-gray);
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--safety-orange); }

.nav-back {
  background: var(--safety-orange);
  color: var(--white) !important;
  padding: 6px 16px;
  border-radius: 6px;
  font-weight: 600;
}
.nav-back:hover {
  background: #e55a1f;
  color: var(--white) !important;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-color: var(--gunmetal);
  background-image:
    linear-gradient(rgba(44, 62, 80, 0.75), rgba(44, 62, 80, 0.85)),
    url('https://images.unsplash.com/photo-1619642751034-765dfdf7c58e?w=1920&q=80');
  background-size: cover;
  background-position: center;
  padding: 100px 24px 60px;
  position: relative;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.gear-wrapper {
  display: inline-block;
  margin-bottom: 24px;
  transform: perspective(800px) rotateY(10deg);
}

.gear {
  animation: spin 20s linear infinite;
  filter: drop-shadow(0 0 20px rgba(74, 111, 165, 0.4));
}

@keyframes spin {
  to { transform: rotateZ(360deg); }
}

.hero-title {
  font-size: 3.5rem;
  color: var(--white);
  letter-spacing: 6px;
  text-transform: uppercase;
  margin-bottom: 12px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.hero-tagline {
  font-family: 'Inter', sans-serif;
  font-size: 1.25rem;
  color: var(--light-gray);
  font-weight: 400;
  margin-bottom: 32px;
  letter-spacing: 1px;
}

.hero-cta {
  display: inline-block;
  background: var(--safety-orange);
  color: var(--white);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 14px 36px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.hero-cta:hover {
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 43, 0.4);
}

/* ===== SERVICES ===== */
.services {
  padding: 80px 0;
  background-color: var(--light-gray);
}

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

/* 3D Flip Cards */
.flip-card {
  perspective: 1000px;
  height: 240px;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

.flip-card:hover {
  z-index: 10;
}

.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.flip-card:hover .flip-inner,
.flip-card.flipped .flip-inner {
  transform: rotateY(180deg);
}

.flip-front, .flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.flip-front {
  background: var(--white);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border: 2px solid transparent;
  transition: border-color 0.3s;
  background-size: cover;
  background-position: center;
  position: relative;
}

/* Service card background images */
.flip-card:nth-child(1) .flip-front {
  background-image:
    linear-gradient(rgba(255,255,255,0.82), rgba(255,255,255,0.88)),
    url('https://images.unsplash.com/photo-1487754180451-c456f719a1fc?w=600&q=80');
}
.flip-card:nth-child(2) .flip-front {
  background-image:
    linear-gradient(rgba(255,255,255,0.82), rgba(255,255,255,0.88)),
    url('https://images.unsplash.com/photo-1558618666-fcd25c85f82e?w=600&q=80');
}
.flip-card:nth-child(3) .flip-front {
  background-image:
    linear-gradient(rgba(255,255,255,0.82), rgba(255,255,255,0.88)),
    url('https://images.unsplash.com/photo-1530046339160-ce3e530c7d2f?w=600&q=80');
}
.flip-card:nth-child(4) .flip-front {
  background-image:
    linear-gradient(rgba(255,255,255,0.82), rgba(255,255,255,0.88)),
    url('https://images.unsplash.com/photo-1578844251758-2f71da64c96f?w=600&q=80');
}
.flip-card:nth-child(5) .flip-front {
  background-image:
    linear-gradient(rgba(255,255,255,0.82), rgba(255,255,255,0.88)),
    url('https://images.unsplash.com/photo-1517524008697-84bbe3c3fd98?w=600&q=80');
}
.flip-card:nth-child(6) .flip-front {
  background-image:
    linear-gradient(rgba(255,255,255,0.82), rgba(255,255,255,0.88)),
    url('https://images.unsplash.com/photo-1615906655593-ad0386982a0f?w=600&q=80');
}

.flip-card:hover .flip-front {
  border-color: var(--steel-blue);
}

.flip-front .service-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  display: block;
}

.flip-front h3 {
  font-size: 1.3rem;
  color: var(--gunmetal);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.flip-back {
  background: var(--steel-blue);
  color: var(--white);
  transform: rotateY(180deg);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.flip-back .service-price {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 2.5rem;
  display: block;
  margin-bottom: 12px;
  color: var(--safety-orange);
}

.flip-back p {
  font-size: 0.95rem;
  line-height: 1.5;
  opacity: 0.95;
}

/* ===== WHY US / STATS ===== */
.why-us {
  padding: 80px 0;
  background-color: var(--gunmetal);
  background-image:
    linear-gradient(rgba(44, 62, 80, 0.82), rgba(44, 62, 80, 0.88)),
    url('https://images.unsplash.com/photo-1580273916550-e323be2ae537?w=1920&q=80');
  background-size: cover;
  background-position: center;
  color: var(--white);
}

.why-us .section-title {
  color: var(--white);
}

.stats-row {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
  min-width: 140px;
}

.stat-number {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 3rem;
  color: var(--safety-orange);
  display: block;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.95rem;
  color: var(--light-gray);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

/* ===== QUOTE FORM ===== */
.quote-section {
  padding: 80px 0;
  background-color: var(--white);
}

.form-wrapper {
  max-width: 600px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  padding: 32px;
  overflow: hidden;
}

.progress-bar {
  height: 6px;
  background: var(--light-gray);
  border-radius: 3px;
  margin-bottom: 16px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 33.33%;
  background: var(--safety-orange);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.step-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 28px;
}

.step-label {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  color: #aaa;
  transition: color 0.3s;
}
.step-label.active {
  color: var(--steel-blue);
  font-weight: 700;
}

.steps-container {
  position: relative;
  overflow: hidden;
}

.form-step {
  display: none;
  animation: slideIn 0.4s ease;
}
.form-step.active {
  display: block;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-40px); }
}

.form-step h3 {
  font-size: 1.4rem;
  margin-bottom: 20px;
  color: var(--gunmetal);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--gunmetal);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--light-gray);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  transition: border-color 0.2s;
  background: var(--white);
  color: var(--gunmetal);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--steel-blue);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 2px solid var(--light-gray);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font-size: 0.9rem;
}
.checkbox-label:hover {
  border-color: var(--steel-blue);
}
.checkbox-label:has(input:checked) {
  border-color: var(--steel-blue);
  background: rgba(74, 111, 165, 0.06);
}

.checkbox-label input {
  accent-color: var(--steel-blue);
  width: 18px;
  height: 18px;
}

.form-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
}

.btn {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  padding: 12px 28px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn-next, .btn-submit {
  background: var(--steel-blue);
  color: var(--white);
}
.btn-next:hover, .btn-submit:hover {
  background: #3d5f8f;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(74, 111, 165, 0.3);
}

.btn-back {
  background: transparent;
  color: var(--gunmetal);
  border: 2px solid var(--light-gray);
}
.btn-back:hover {
  border-color: var(--gunmetal);
}

.btn-submit {
  background: var(--safety-orange);
}
.btn-submit:hover {
  background: #e55a1f;
  box-shadow: 0 4px 12px rgba(255, 107, 43, 0.3);
}

.demo-notice {
  background: rgba(255, 107, 43, 0.08);
  border: 1px solid rgba(255, 107, 43, 0.2);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--gunmetal);
  margin-top: 12px;
}

.form-success {
  text-align: center;
  padding: 40px 20px;
}
.form-success .success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--safety-orange);
  color: var(--white);
  font-size: 2rem;
  margin-bottom: 16px;
}
.form-success h3 {
  font-size: 1.5rem;
  margin-bottom: 8px;
  color: var(--gunmetal);
}
.form-success p {
  color: #666;
}

/* ===== CERTIFICATIONS ===== */
.certifications {
  padding: 80px 0;
  background-color: var(--light-gray);
  background-image:
    linear-gradient(rgba(232, 236, 240, 0.92), rgba(232, 236, 240, 0.95)),
    url('https://images.unsplash.com/photo-1486262715619-67b85e0b08d3?w=1920&q=80');
  background-size: cover;
  background-position: center;
}

.cert-grid {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.cert-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 32px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  min-width: 180px;
  text-align: center;
}

.cert-badge span {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--gunmetal);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Scroll-driven animations for certifications */
@keyframes slideFromLeft {
  from { opacity: 0; transform: translateX(-50px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideFromRight {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

@supports (animation-timeline: scroll()) {
  .cert-badge:nth-child(odd) {
    animation: slideFromLeft linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 100%;
  }
  .cert-badge:nth-child(even) {
    animation: slideFromRight linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 100%;
  }
}

/* Fallback for browsers without scroll-driven animations */
@supports not (animation-timeline: scroll()) {
  .cert-badge {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }
  .cert-badge:nth-child(even) {
    transform: translateX(30px);
  }
  .cert-badge.visible {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===== LOCATION ===== */
.location {
  padding: 80px 0;
  background-color: var(--white);
}

.location-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  max-width: 800px;
  margin: 0 auto;
}

.location-info h3,
.location-hours h3 {
  font-size: 1.2rem;
  color: var(--steel-blue);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.location-info address {
  font-style: normal;
  margin-bottom: 20px;
  line-height: 1.8;
}

.location-info a {
  font-weight: 600;
  font-size: 1.1rem;
}

.hours-table {
  width: 100%;
  border-collapse: collapse;
}

.hours-table td {
  padding: 10px 0;
  border-bottom: 1px solid var(--light-gray);
}
.hours-table td:first-child {
  font-weight: 600;
  padding-right: 20px;
}

/* ===== FOOTER ===== */
.main-footer {
  background-color: var(--gunmetal);
  background-image:
    linear-gradient(rgba(44, 62, 80, 0.92), rgba(44, 62, 80, 0.96)),
    url('https://images.unsplash.com/photo-1492144534655-ae79c964c9d7?w=1920&q=80');
  background-size: cover;
  background-position: center bottom;
  color: var(--light-gray);
  text-align: center;
  padding: 24px;
  font-size: 0.9rem;
}
.main-footer a {
  color: var(--safety-orange);
  font-weight: 600;
}

/* ===== WEBFORGE BADGES ===== */
.wf-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(74, 111, 165, 0.1);
  border: 1px solid rgba(74, 111, 165, 0.2);
  color: var(--steel-blue);
  padding: 8px 16px;
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.wf-badge.visible {
  opacity: 1;
  transform: translateY(0);
}

.wf-badge-icon {
  font-size: 1rem;
}

.wf-badge-close {
  background: none;
  border: none;
  color: var(--steel-blue);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.wf-badge-close:hover { opacity: 1; }

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .gear { animation: none; }
  .gear-wrapper { transform: none; }

  .blueprint-bg { animation: none; }

  .flip-inner { transition: none; }
  .flip-card:hover .flip-inner,
  .flip-card.flipped .flip-inner {
    transform: none;
  }
  .flip-back {
    transform: none;
    position: relative;
    margin-top: 8px;
  }
  .flip-front {
    position: relative;
  }
  .flip-card {
    height: auto;
  }

  .cert-badge {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .form-step {
    animation: none;
  }

  .wf-badge {
    opacity: 1;
    transform: none;
    transition: none;
  }

  html { scroll-behavior: auto; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--gunmetal);
    flex-direction: column;
    padding: 16px 24px;
    gap: 12px;
    display: none;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  }
  .nav-links.open { display: flex; }

  .hero-title { font-size: 2.2rem; letter-spacing: 3px; }
  .hero-tagline { font-size: 1rem; }

  .section-title { font-size: 1.7rem; }

  .services-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }

  .stats-row { gap: 24px; }
  .stat-number { font-size: 2.2rem; }

  .checkbox-grid { grid-template-columns: 1fr; }

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

  .cert-grid { gap: 20px; }
  .cert-badge {
    min-width: 140px;
    padding: 16px 20px;
  }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.8rem; }
  .gear-wrapper svg { width: 100px; height: 100px; }
  .flip-card { height: 220px; }
}
