@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --brand-red:    #E31E24;
  --brand-dark:   #BA1419;
  --brand-soft:   #2D1414; /* Deep dark red for subtle bg */
  --navy:         #0A1321;
  --navy-mid:     #14233C;
  --ink:          #E2E8F0; /* Light text for dark bg */
  --muted:        #94A3B8; /* Slate text for dark bg */
  --light:        #0D1627; /* Dark charcoal/navy section bg */
  --line:         rgba(255,255,255,0.1);
  --white:        #080C14; /* True dark background */
  --gold:         #D4AF37;
  --glass:        rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.1);
}

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--ink);
  background-color: var(--white);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-serif {
  font-family: 'DM Serif Display', serif;
}

/* FLUID TYPOGRAPHY */
h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); line-height: 1.1; }
h2 { font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.2; }
h3 { font-size: clamp(1.5rem, 3vw, 2.5rem); }

/* CONTEMPORARY SPACING */
.py-section { padding: clamp(80px, 10vh, 140px) 0; }
.py-100 { padding: 100px 0; }
main { padding-top: 0; }

/* NAVBAR FIXES */
#mainNav {
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  padding: 30px 0;
  z-index: 1060;
}

#mainNav.scrolled {
  background: rgba(10, 19, 33, 0.95) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  padding: 15px 0;
}

.brand-logo {
  max-height: 120px; /* Doubled for impact */
  width: auto;
  transition: all 0.3s ease;
  filter: brightness(0) invert(1); /* Ensure visibility on dark bg */
}

#mainNav.scrolled .brand-logo {
  max-height: 80px;
}

/* BUTTONS DYNAMIC (ENHANCED) */
.btn {
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}

.btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(227, 30, 36, 0.3);
}

.btn-brand {
  background: var(--brand-red);
  color: #fff;
  border: none;
}

.btn-brand:hover {
  background: var(--brand-dark);
  color: #fff;
}

.btn-outline-light:hover {
  background: #fff;
  color: var(--navy) !important;
}

/* HERO SYSTEM (SWIPER) */
.hero-section {
  min-height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-slide {
  height: 100vh;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
}

.hero-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(75deg, rgba(10, 19, 33, 0.95) 0%, rgba(10, 19, 33, 0.6) 100%);
  z-index: 1;
}

/* PAGE HERO (SUBPAGES) */
.page-hero {
  padding: 160px 0 100px;
  background-size: cover;
  background-position: center;
  position: relative;
  color: #fff;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(to bottom, rgba(8, 12, 20, 0.9) 0%, rgba(8, 12, 20, 0.6) 100%);
  z-index: 1;
}

.page-hero .container {
  position: relative;
  z-index: 2;
}

/* CARD SYSTEM (NEW) */
.card-section {
  background: var(--light);
}

.glass-card {
  background: rgba(255,255,255,0.03); /* Subtle dark glass */
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 40px;
  transition: all 0.4s ease;
  height: 100%;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.glass-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 40px 80px rgba(0,0,0,0.5);
  border-color: var(--brand-red);
  background: rgba(227, 30, 36, 0.05);
}

.bg-white, .section-white { background-color: var(--white) !important; color: var(--ink) !important; }
.bg-light, .section-light { background-color: var(--light) !important; color: var(--ink) !important; }
.text-navy, .text-ink { color: var(--ink) !important; }
.text-muted { color: var(--muted) !important; }

.bg-navy .glass-card {
  background: rgba(255,255,255,0.15); /* Maximized for visibility */
  border: 1px solid rgba(255,255,255,0.3); /* Stronger border */
  color: #fff;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

.list-group-item, .list-group-item strong {
  color: var(--ink) !important;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--ink) !important;
}

/* COMPONENT OVERRIDES */
.accordion-button {
  color: var(--ink) !important;
  background-color: transparent !important;
}

.accordion-button:not(.collapsed) {
  color: var(--brand-red) !important;
  background-color: rgba(227, 30, 36, 0.05) !important;
}

.accordion-body {
  color: var(--muted) !important;
}

.badge.bg-light {
  background-color: rgba(255,255,255,0.05) !important;
  color: var(--ink) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
}

.table-premium {
  color: var(--white) !important;
  border-collapse: separate !important;
  border-spacing: 0 12px !important; /* Spaced rows */
}

.table-premium thead th {
  background: rgba(255, 255, 255, 0.05) !important;
  border: none !important;
  padding: 1.5rem 1rem !important;
  color: var(--brand-red) !important;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
}

.table-premium tbody tr {
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.3s ease;
}

.table-premium tbody tr:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  transform: scale(1.005);
}

.table-premium tbody td {
  padding: 1.2rem 1rem !important;
  border: none !important;
  vertical-align: middle;
}

.status-pill {
  padding: 0.4rem 1.2rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(227, 30, 36, 0.1);
  border: 1px solid var(--brand-red);
  color: var(--brand-red);
}

.bg-navy .table {
  color: #fff !important;
}

/* CTA READABILITY FIX */
.bg-navy .glass-card.cta-card {
  background: var(--navy-mid);
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 30px 60px rgba(0,0,0,0.4);
}

/* DARK FORMS */
.form-control, .form-select {
  background-color: rgba(255,255,255,0.05) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  color: var(--white) !important;
  padding: 0.8rem 1.2rem;
}

.form-control::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.form-control:focus {
  background-color: rgba(255,255,255,0.08) !important;
  border-color: var(--brand-red) !important;
  box-shadow: 0 0 0 0.25rem rgba(227, 30, 36, 0.1);
  color: var(--white) !important;
}

/* TESTIMONIAL ALIGNMENT */
.testimonial-card {
  min-height: 480px; /* Force uniform height for alignment */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.testimonial-card p {
  font-size: 1.1rem;
  line-height: 1.7;
}

/* FOOTER WIDTH REDUCTION */
footer .container {
  max-width: 800px; /* Slimmer, more centered footer */
}

option {
  background-color: var(--navy-mid);
  color: var(--white);
}

/* FOOTER */
footer {
  background: #050A14;
}

footer a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: all 0.3s ease;
}

footer a:hover {
  color: var(--brand-red);
  padding-left: 5px;
}

.social-btn {
  width: 45px;
  height: 45px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.3s ease;
}

.social-btn:hover {
  background: var(--brand-red);
  color: #fff !important;
  transform: translateY(-3px);
}

/* CONTEMPORARY FLOURISHES */
.eyebrow {
  color: var(--brand-red);
  font-weight: 800;
  letter-spacing: 0.3em;
  font-size: 0.75rem;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  display: block;
}

.red-rule {
  width: 60px;
  height: 3px;
  background: var(--brand-red);
  margin-bottom: 2rem;
}

/* FORM SYSTEM (PREMIUM DARK) */
.form-control, .form-select {
  background-color: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
  border-radius: 12px !important;
  padding: 12px 18px !important;
  transition: all 0.3s ease !important;
}

.form-control::placeholder {
  color: rgba(255, 255, 255, 0.4) !important;
}

.form-control:focus, .form-select:focus {
  background-color: rgba(255, 255, 255, 0.08) !important;
  border-color: var(--brand-red) !important;
  box-shadow: 0 0 15px rgba(227, 30, 36, 0.2) !important;
  color: #ffffff !important;
  outline: none !important;
}

.form-select option {
  background-color: #080c14 !important;
  color: #ffffff !important;
}

/* SECTION UTILITIES */
@media (min-width: 992px) {
  .grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
  }
}

/* PHASE CARD & ANIMATED BOXES */
.phase-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 2.5rem;
  padding: 4rem;
  margin-bottom: 5rem;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.phase-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(227, 30, 36, 0.3);
  transform: translateY(-5px);
}

.feature-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 1.5rem;
  padding: 2rem;
  height: 100%;
  transition: all 0.3s ease;
}

.feature-box:hover {
  background: rgba(227, 30, 36, 0.05);
  border-color: var(--brand-red);
  transform: scale(1.02);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-box {
  animation: fadeInUp 0.8s ease forwards;
}

/* FOOTER HEADER PRECISION OFFSET */
.footer-heading-offset {
  margin-top: 0px !important; /* Reset offset */
}

/* HERO VISIBILITY FIX */
.hero-swiper .swiper-slide-active .container {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

/* -----------------------------------------------------------------
   MOBILE RESPONSIVENESS & REFINEMENT
----------------------------------------------------------------- */
@media (max-width: 768px) {
  /* 1. Prevent overlapping in hero sections */
  .hero-slide {
    height: auto !important;
    min-height: 100vh;
    padding-top: 120px;
    padding-bottom: 60px;
  }
  
  .hero-content {
    margin-bottom: 3rem !important;
  }

  h1, .display-3 {
    font-size: 2.2rem !important;
  }

  /* 2. Fix circular button distortion caused by large padding & wrapped text */
  .btn.py-3, .btn.py-4, .btn.px-5 {
    padding-top: 0.8rem !important;
    padding-bottom: 0.8rem !important;
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
    font-size: 1rem !important;
    width: 100%; /* Force buttons to span full width on small screens */
    display: block;
    margin-bottom: 1rem;
    white-space: normal;
  }

  /* Prevent nav buttons from inheriting the full-width block behavior */
  #navbarContent .btn {
    width: auto !important;
    display: inline-block !important;
    margin-bottom: 0 !important;
  }

  /* Force typical flex gaps to stack vertically on mobile */
  .d-flex.gap-4, .d-flex.gap-3:not(#navbarContent .d-flex) {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }

  #navbarContent .d-flex {
    flex-direction: row !important;
  }

  /* 3. Reduce card padding to maximize screen estate */
  .phase-card {
    padding: 2rem !important;
    border-radius: 1.5rem !important;
    margin-bottom: 2rem !important;
  }

  .glass-card, .feature-box {
    padding: 1.5rem !important;
  }
}
