/* ============================================
   AMERICAN INDEPENDENCE GOLD
   Brand Design System & Global Styles
   ============================================ */

/* --- CSS Custom Properties (Brand Tokens) --- */
:root {
  /* Primary - Institutional */
  --deep-navy: #0A1628;
  --warm-white: #FAFAF8;
  --charcoal: #2D3436;
  --stone-gray: #545B66;
  --light-gray: #9CA3AF;
  --border-gray: #E5E5E0;
  --bg-light: #F5F5F0;
  --bg-card: #F3F4F6;

  /* Accent - Strategic Gold */
  --muted-gold: #B8956B;
  --muted-gold-text: #886840;
  --warm-bronze: #7A5E36;
  --gold-glow: rgba(184, 149, 107, 0.15);

  /* Functional */
  --deep-green: #1B4D3E;
  --success: #10B981;
  --muted-red: #8B3A3A;

  /* Typography */
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', Arial, Helvetica, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Spacing */
  --section-padding: 80px 0;
  --container-width: 1200px;
  --nav-height: 72px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  font-size: 18px;
  color: var(--charcoal);
  background: var(--warm-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

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

ul, ol {
  list-style: none;
}

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

/* --- Typography --- */
h1, h2 {
  font-family: var(--font-serif);
  color: var(--deep-navy);
  line-height: 1.15;
}

h3 {
  font-family: var(--font-sans);
  color: var(--deep-navy);
  line-height: 1.25;
}

h1 {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 500;
}

h2 {
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 500;
}

/* h3 sizing (font-family set above as sans-serif per type scale) */
h3 {
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 600;
}

.text-gold {
  color: var(--muted-gold);
}

.text-white {
  color: var(--warm-white);
}

.section-badge {
  font-size: 12px;
  color: var(--muted-gold-text);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 12px;
}

.section-badge--light {
  color: var(--warm-white);
  opacity: 0.7;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(10, 22, 40, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  border-bottom: 1px solid rgba(184, 149, 107, 0.15);
  transition: background 0.3s ease;
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav__logo-placeholder {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--muted-gold) 0%, var(--warm-bronze) 100%);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--deep-navy);
  font-weight: 600;
}

.nav__brand-text {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--warm-white);
  letter-spacing: 0.5px;
}

.nav__brand-text span {
  color: var(--muted-gold);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav__link {
  font-size: 13px;
  color: var(--light-gray);
  letter-spacing: 0.3px;
  transition: color 0.2s ease;
  position: relative;
}

.nav__link:hover,
.nav__link--active {
  color: var(--warm-white);
}

.nav__link--active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--muted-gold);
}

.nav__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--deep-navy);
  border: 1px solid var(--muted-gold);
  color: var(--muted-gold);
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav__cta:hover {
  background: var(--muted-gold);
  color: var(--deep-navy);
}

/* Mobile nav toggle */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--warm-white);
  transition: 0.3s;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
  text-decoration: none;
}

.btn--primary {
  background: var(--deep-navy);
  color: var(--warm-white);
}

.btn--primary:hover {
  background: #152438;
}

.btn--gold {
  background: transparent;
  border: 1.5px solid var(--muted-gold);
  color: var(--muted-gold-text);
}

.btn--gold:hover {
  background: var(--gold-glow);
  border-color: var(--warm-bronze);
  color: var(--warm-bronze);
}

.btn--outline {
  background: transparent;
  border: 1px solid var(--muted-gold);
  color: var(--muted-gold-text);
}

.btn--outline:hover {
  background: var(--gold-glow);
}

/* In dark sections, use brighter gold for button text (passes on dark bg) */
.section--dark > .container .btn--gold,
.section--dark > .container .btn--outline,
.cta-banner .btn--gold,
.cta-banner .btn--outline,
.nav__cta {
  color: var(--muted-gold);
}

/* Form cards inside dark heroes have white bg — use accessible dark gold */
.hero--dark form .btn--gold {
  color: var(--muted-gold-text);
}

.btn--outline-white {
  background: transparent;
  border: 1px solid rgba(250, 250, 248, 0.3);
  color: var(--warm-white);
}

.btn--outline-white:hover {
  border-color: var(--warm-white);
  background: rgba(250, 250, 248, 0.05);
}

.btn--lg {
  padding: 16px 36px;
  font-size: 15px;
}

.btn--sm {
  padding: 10px 20px;
  font-size: 13px;
}

/* --- Sections --- */
.section {
  padding: var(--section-padding);
}

.section--dark {
  background: var(--deep-navy);
  color: var(--warm-white);
}

.section--dark h1,
.section--dark h2,
.section--dark h3 {
  color: var(--warm-white);
}

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

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

/* --- Hero Sections --- */
.hero {
  min-height: 85vh;
  display: flex;
  align-items: center;
  position: relative;
  padding-top: var(--nav-height);
  overflow: hidden;
}

.hero--dark {
  background: linear-gradient(135deg, var(--deep-navy) 0%, #152438 50%, var(--deep-navy) 100%);
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 640px;
}

.hero__subtitle {
  font-size: 18px;
  color: var(--light-gray);
  line-height: 1.6;
  margin: 20px 0 32px 0;
}

.hero__actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero__image-placeholder {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 50%;
  height: 70%;
  background: linear-gradient(135deg, rgba(184, 149, 107, 0.08) 0%, rgba(184, 149, 107, 0.02) 100%);
  border-radius: 12px 0 0 12px;
  border: 1px solid rgba(184, 149, 107, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--stone-gray);
  font-size: 14px;
}

/* --- Page Hero (inner pages) --- */
.page-hero {
  padding: 140px 0 60px 0;
  background: var(--deep-navy);
  position: relative;
}

.page-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--muted-gold) 0%, transparent 60%);
}

.page-hero h1 {
  color: var(--warm-white);
  margin-bottom: 12px;
}

.page-hero p {
  color: var(--light-gray);
  font-size: 18px;
  max-width: 600px;
  line-height: 1.6;
}

.page-hero .section-badge {
  color: var(--muted-gold);
}

/* In dark sections, use the original bright gold (passes on dark bg) */
.section--dark .section-badge,
.cta-banner .section-badge,
.hero--dark .section-badge {
  color: var(--muted-gold);
}

/* --- Cards --- */
.card {
  background: white;
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  padding: 32px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.card--dark {
  background: var(--deep-navy);
  border-color: rgba(184, 149, 107, 0.2);
  color: var(--warm-white);
}

.card__icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 20px;
}

.card__icon--gold {
  background: var(--gold-glow);
  border: 1px solid rgba(184, 149, 107, 0.3);
}

.card__icon--navy {
  background: var(--deep-navy);
}

.card__icon--green {
  background: var(--deep-green);
}

.card__title {
  font-family: var(--font-serif);
  font-size: 20px;
  margin-bottom: 8px;
}

.card__text {
  font-size: 15px;
  color: var(--stone-gray);
  line-height: 1.6;
}

/* --- Grid Layouts --- */
.grid {
  display: grid;
  gap: 24px;
}

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

/* --- Trust Bar --- */
.trust-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  padding: 24px 0;
  border-top: 1px solid var(--border-gray);
  border-bottom: 1px solid var(--border-gray);
}

.trust-bar__item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--stone-gray);
  font-size: 13px;
}

.trust-bar__icon {
  width: 36px;
  height: 36px;
  background: var(--bg-card);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* --- Stats Row --- */
.stats-row {
  display: flex;
  justify-content: center;
  gap: 64px;
  padding: 40px 0;
}

.stat {
  text-align: center;
}

.stat__number {
  font-family: var(--font-serif);
  font-size: 42px;
  color: var(--muted-gold);
  line-height: 1;
  margin-bottom: 8px;
}

.stat__label {
  font-size: 14px;
  color: var(--stone-gray);
}

/* --- Testimonial --- */
.testimonial {
  background: var(--bg-light);
  border-radius: 8px;
  padding: 32px;
  border-left: 4px solid var(--muted-gold);
}

.testimonial__quote {
  font-family: var(--font-serif);
  font-size: 18px;
  font-style: italic;
  color: var(--deep-navy);
  line-height: 1.5;
  margin-bottom: 16px;
}

.testimonial__author {
  font-size: 14px;
  color: var(--stone-gray);
}

/* --- Process Steps --- */
.process-steps {
  display: flex;
  gap: 24px;
  counter-reset: step;
}

.process-step {
  flex: 1;
  position: relative;
  padding: 24px;
  background: white;
  border: 1px solid var(--border-gray);
  border-radius: 8px;
}

.process-step::before {
  counter-increment: step;
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--muted-gold) 0%, var(--warm-bronze) 100%);
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  color: var(--deep-navy);
  margin-bottom: 16px;
}

.process-step h3,
.process-step h4 {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--deep-navy);
  margin-bottom: 8px;
}

.process-step p {
  font-size: 14px;
  color: var(--stone-gray);
  line-height: 1.5;
}

/* --- Forms --- */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  color: var(--charcoal);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-gray);
  border-radius: 4px;
  font-size: 15px;
  font-family: var(--font-sans);
  color: var(--charcoal);
  background: white;
  transition: border-color 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--muted-gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

/* --- FAQ Accordion --- */
.faq-item {
  border-bottom: 1px solid var(--border-gray);
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  cursor: pointer;
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--deep-navy);
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  line-height: 1.4;
}

.faq-question::after {
  content: '+';
  font-size: 24px;
  color: var(--muted-gold);
  transition: transform 0.3s ease;
}

.faq-item.open .faq-question::after {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-answer__inner {
  padding: 0 0 20px 0;
  font-size: 15px;
  color: var(--stone-gray);
  line-height: 1.7;
}

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

/* --- Footer --- */
.footer {
  background: var(--deep-navy);
  color: var(--light-gray);
  padding: 60px 0 24px 0;
  border-top: 1px solid rgba(184, 149, 107, 0.15);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}

.footer__brand-text {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--warm-white);
  margin-bottom: 12px;
}

.footer__brand-text span {
  color: var(--muted-gold);
}

.footer__desc {
  font-size: 14px;
  color: var(--light-gray);
  line-height: 1.6;
  margin-bottom: 20px;
  max-width: 300px;
}

.footer__heading {
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--warm-white);
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.footer__link {
  display: block;
  font-size: 14px;
  color: var(--light-gray);
  margin-bottom: 10px;
  transition: color 0.2s ease;
}

.footer__link:hover {
  color: var(--muted-gold);
}

.footer__bottom {
  border-top: 1px solid rgba(250, 250, 248, 0.06);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer__copy {
  font-size: 12px;
  color: var(--light-gray);
}

.footer__legal-links {
  display: flex;
  gap: 24px;
}

.footer__legal-links a {
  font-size: 12px;
  color: var(--light-gray);
  transition: color 0.2s ease;
}

.footer__legal-links a:hover {
  color: var(--muted-gold);
}

/* --- CTA Banner (reusable) --- */
.cta-banner {
  background: var(--deep-navy);
  border-radius: 12px;
  padding: 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--muted-gold), transparent);
}

.cta-banner h2 {
  color: var(--warm-white);
  margin-bottom: 12px;
}

.cta-banner p {
  color: var(--light-gray);
  font-size: 16px;
  margin-bottom: 24px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Gold Rule (decorative) --- */
.gold-rule {
  width: 60px;
  height: 2px;
  background: var(--muted-gold);
  margin: 16px 0;
}

/* --- Image Placeholders (for later graphic replacement) --- */
.img-placeholder {
  background: linear-gradient(135deg, rgba(184, 149, 107, 0.08), rgba(184, 149, 107, 0.03));
  border: 1px dashed rgba(184, 149, 107, 0.25);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--stone-gray);
  font-size: 13px;
  min-height: 200px;
}

.img-placeholder--dark {
  background: linear-gradient(135deg, rgba(250, 250, 248, 0.03), rgba(250, 250, 248, 0.01));
  border-color: rgba(250, 250, 248, 0.1);
}

/* --- Sticky CTA Bar (mobile) --- */
.sticky-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10, 22, 40, 0.97);
  backdrop-filter: blur(12px);
  padding: 12px 24px;
  z-index: 999;
  border-top: 1px solid rgba(184, 149, 107, 0.2);
}

.sticky-cta .btn {
  width: 100%;
}

.sticky-cta .btn--gold {
  color: var(--muted-gold);
}

/* --- Screen Reader Only (a11y) --- */
.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;
}

/* --- Skip to Content (a11y) --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--deep-navy);
  color: var(--warm-white);
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  z-index: 10000;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 8px;
}

/* --- Focus Styles (a11y) --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--muted-gold);
  outline-offset: 2px;
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Inner Page Ticker Adjustments --- */
body.has-ticker .page-hero {
  padding-top: calc(140px + 36px);
}

body.has-ticker .hero--dark {
  padding-top: calc(120px + 36px);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .stats-row { gap: 32px; flex-wrap: wrap; }
  .process-steps { flex-wrap: wrap; }
  .process-step { flex: 0 0 calc(50% - 12px); }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 60px 0;
    --nav-height: 60px;
  }

  .nav__links { display: none; }
  .nav__toggle { display: flex; }

  .nav__links--open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--deep-navy);
    padding: 24px;
    gap: 20px;
    border-bottom: 1px solid rgba(184, 149, 107, 0.15);
  }

  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }

  .hero { min-height: auto; padding: 120px 0 60px 0; }
  .hero__image-placeholder { display: none; }

  .footer__grid { grid-template-columns: 1fr; }
  .footer__bottom { flex-direction: column; gap: 12px; text-align: center; }

  .trust-bar { flex-wrap: wrap; gap: 24px; }
  .stats-row { flex-direction: column; gap: 24px; }
  .process-steps { flex-direction: column; }
  .process-step { flex: 1; }

  .sticky-cta { display: block; }

  .cta-banner { padding: 32px 24px; }

  body.has-ticker .page-hero {
    padding-top: calc(120px + 32px);
  }

  body.has-ticker .hero--dark {
    padding-top: calc(100px + 32px);
  }
}
