/* ============================================
   THE ALVAREZ LAW FIRM — NEC Baby Formula
   Necrotizing Enterocolitis Lawsuit Website
   Custom Styles + Tailwind Overrides
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  --navy: #0A2540;
  --navy-light: #0F3460;
  --navy-dark: #061A2E;
  --gold: #B8963E;
  --gold-light: #D4B262;
  --gold-dark: #96792F;
  --gold-pale: #F5EDD6;
  --teal: #14B8A6;
  --teal-dark: #0D9488;
  --teal-light: #5EEAD4;
  --cream: #FFFDF7;
  --warm-white: #FBF9F4;
  --warm-gray: #F0ECE3;
  --text-dark: #1A1A2E;
  --text-muted: #5A6474;
  --text-light: #8A94A6;
}

/* --- Base Resets & Smooth Scroll --- */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--text-dark);
  background: var(--cream);
  overflow-x: hidden;
}

::selection {
  background: var(--gold);
  color: white;
}

/* --- Typography --- */
.font-display {
  font-family: 'Cormorant Garamond', Georgia, serif;
}

.font-body {
  font-family: 'DM Sans', sans-serif;
}

.font-accent {
  font-family: 'Libre Caslon Text', Georgia, serif;
}

.text-gold-gradient {
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Animated Underline for Links --- */
.link-underline {
  position: relative;
  display: inline-block;
}

.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.link-underline:hover::after {
  width: 100%;
}

/* --- Navigation --- */
.nav-glass {
  background: rgba(10, 37, 64, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(184, 150, 62, 0.15);
}

.nav-scrolled {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}

/* --- Hero Section --- */
.hero-gradient {
  background: linear-gradient(
    135deg,
    var(--navy-dark) 0%,
    var(--navy) 40%,
    var(--navy-light) 100%
  );
}

.hero-pattern {
  background-image:
    radial-gradient(circle at 20% 50%, rgba(184, 150, 62, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(20, 184, 166, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 60% 80%, rgba(184, 150, 62, 0.04) 0%, transparent 40%);
}

.hero-image-mask {
  mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
}

/* --- Gold Divider Line --- */
.gold-divider {
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 2px;
}

.gold-divider-long {
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* --- Cards --- */
.card-elevated {
  background: white;
  border: 1px solid rgba(184, 150, 62, 0.1);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 12px rgba(0, 0, 0, 0.03);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card-elevated:hover {
  border-color: rgba(184, 150, 62, 0.3);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.06),
    0 12px 40px rgba(184, 150, 62, 0.1);
  transform: translateY(-4px);
}

.card-navy {
  background: var(--navy);
  border: 1px solid rgba(184, 150, 62, 0.2);
  box-shadow: 0 4px 24px rgba(10, 37, 64, 0.3);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card-navy:hover {
  border-color: rgba(184, 150, 62, 0.5);
  box-shadow: 0 8px 40px rgba(10, 37, 64, 0.4);
  transform: translateY(-4px);
}

/* --- Buttons --- */
.btn-gold {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: white;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 14px 36px;
  border-radius: 6px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 15px rgba(184, 150, 62, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-gold::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.6s ease;
}

.btn-gold:hover::before {
  left: 100%;
}

.btn-gold:hover {
  box-shadow: 0 6px 25px rgba(184, 150, 62, 0.45);
  transform: translateY(-2px);
}

.btn-outline-gold {
  border: 2px solid var(--gold);
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 12px 34px;
  border-radius: 6px;
  transition: all 0.3s ease;
  background: transparent;
}

.btn-outline-gold:hover {
  background: var(--gold);
  color: white;
  box-shadow: 0 4px 15px rgba(184, 150, 62, 0.3);
}

.btn-navy {
  background: var(--navy);
  color: white;
  font-weight: 600;
  padding: 14px 36px;
  border-radius: 6px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(10, 37, 64, 0.3);
}

.btn-navy:hover {
  background: var(--navy-light);
  box-shadow: 0 6px 25px rgba(10, 37, 64, 0.4);
  transform: translateY(-2px);
}

/* --- Trust Bar --- */
.trust-bar {
  background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-light), var(--gold), var(--gold-dark));
  background-size: 200% auto;
  animation: shimmer 8s linear infinite;
}

@keyframes shimmer {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* --- Section Backgrounds --- */
.bg-navy-gradient {
  background: linear-gradient(180deg, var(--navy-dark), var(--navy), var(--navy-dark));
}

.bg-warm {
  background: var(--warm-white);
}

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

.bg-pattern-dots {
  background-image: radial-gradient(circle, rgba(184, 150, 62, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* --- Testimonial Carousel --- */
.testimonial-card {
  opacity: 0;
  transform: translateX(40px);
  transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: absolute;
  width: 100%;
}

.testimonial-card.active {
  opacity: 1;
  transform: translateX(0);
  position: relative;
}

.testimonial-card.exit-left {
  opacity: 0;
  transform: translateX(-40px);
}

/* --- Counter Animation --- */
.counter-value {
  font-variant-numeric: tabular-nums;
}

/* --- Scroll Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger children */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0.05s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.12s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.19s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.26s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.33s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.40s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(7) { transition-delay: 0.47s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(8) { transition-delay: 0.54s; opacity: 1; transform: translateY(0); }

/* --- Process Timeline --- */
.timeline-line {
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--gold), var(--teal), var(--gold));
}

@media (min-width: 768px) {
  .timeline-line {
    left: 50%;
    transform: translateX(-50%);
  }
}

/* --- FAQ Accordion --- */
.faq-item {
  border-bottom: 1px solid rgba(184, 150, 62, 0.15);
}

.faq-question {
  cursor: pointer;
  transition: color 0.3s ease;
}

.faq-question:hover {
  color: var(--gold);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), padding 0.3s ease;
}

.faq-answer.open {
  max-height: 500px;
}

.faq-chevron {
  transition: transform 0.3s ease;
}

.faq-chevron.open {
  transform: rotate(180deg);
}

/* --- Sticky CTA Bar (Mobile) --- */
.sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--navy);
  border-top: 2px solid var(--gold);
  padding: 12px 16px;
  transform: translateY(100%);
  transition: transform 0.4s ease;
}

.sticky-cta.visible {
  transform: translateY(0);
}

@media (min-width: 768px) {
  .sticky-cta {
    display: none;
  }
}

/* --- Floating Phone Badge --- */
.phone-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 45;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--gold);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 25px rgba(184, 150, 62, 0.4);
  transition: all 0.3s ease;
  animation: pulse-ring 2s infinite;
}

.phone-float:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 35px rgba(184, 150, 62, 0.5);
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(184, 150, 62, 0.4); }
  70% { box-shadow: 0 0 0 15px rgba(184, 150, 62, 0); }
  100% { box-shadow: 0 0 0 0 rgba(184, 150, 62, 0); }
}

@media (max-width: 767px) {
  .phone-float {
    bottom: 80px;
  }
}

/* --- Form Styling --- */
.form-input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(184, 150, 62, 0.2);
  border-radius: 6px;
  padding: 14px 18px;
  color: white;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.3s ease;
  width: 100%;
}

.form-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 150, 62, 0.15);
  background: rgba(255, 255, 255, 0.1);
}

.form-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

select.form-input option {
  background: var(--navy);
  color: white;
}

.form-input-light {
  background: white;
  border: 1px solid #E0D8C8;
  color: var(--text-dark);
}

.form-input-light:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 150, 62, 0.1);
}

.form-input-light::placeholder {
  color: var(--text-light);
}

/* --- Footer --- */
.footer-gradient {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-dark) 100%);
}

/* --- Responsive Image Handling --- */
.img-cover {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--cream);
}

::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold-dark);
}

/* --- Loading Animation --- */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--navy);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-icon {
  width: 60px;
  height: 60px;
  border: 3px solid rgba(184, 150, 62, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* --- Accessibility --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

*:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* --- Print Styles --- */
@media print {
  .nav-glass, .sticky-cta, .phone-float, .page-loader {
    display: none !important;
  }
}
