/* =========================================================
   PROJECT COMMON ROOT CSS
   Global design tokens, reset, typography, buttons,
   forms, layout helpers and utilities only.
   No section-specific styling included.
   ========================================================= */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap");

:root {
  /* Brand Colors */
  --color-primary: #063232;
  --color-primary-dark: #032121;
  --color-primary-light: #115050;

  --color-accent: #fbb12f;
  --color-accent-dark: #f59e0b;
  --color-accent-light: #ffc456;

  --color-lime: #c2df93;
  --color-lime-light: #d8efb6;

  /* Neutral Colors */
  --color-white: #ffffff;
  --color-black: #111111;
  --color-text: #5f7a7d;
  --color-heading: #063232;
  --color-muted: #789194;

  /* Background Colors */
  --bg-body: #ffffff;
  --bg-soft: #ecf8f8;
  --bg-light: #f5f7f7;
  --bg-dark: #063232;
  --bg-darker: #032121;

  /* Border Colors */
  --border-color: #dceaea;
  --border-color-soft: rgba(6, 50, 50, 0.10);
  --border-color-dark: rgba(255, 255, 255, 0.12);

  /* Font Family */
  --font-primary: "Inter", sans-serif;

  /* Font Sizes */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 0.9375rem;
  --font-size-md: 1.125rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;
  --font-size-3xl: 2.5rem;
  --font-size-4xl: 3rem;
  --font-size-5xl: 3.75rem;

  /* Font Weights */
  --font-regular: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;
  --font-black: 900;

  /* Line Heights */
  --line-height-tight: 1.15;
  --line-height-heading: 1.2;
  --line-height-body: 1.7;

  /* Layout */
  --container-width: 1360px;
  --container-wide: 1480px;
  --container-padding: 24px;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;
  --space-10: 64px;
  --space-11: 80px;
  --space-12: 96px;
  --space-13: 120px;

  /* Border Radius */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 8px 24px rgba(6, 50, 50, 0.07);
  --shadow-md: 0 16px 40px rgba(6, 50, 50, 0.10);
  --shadow-lg: 0 24px 60px rgba(6, 50, 50, 0.14);

  /* Transitions */
  --transition-fast: 180ms ease;
  --transition-base: 280ms ease;
  --transition-slow: 420ms cubic-bezier(.2, .8, .2, 1);

  /* Shared button system */
  --button-height: 54px;
  --button-padding-x: 27px;
  --button-gap: 13px;
  --button-font-size: 0.9375rem;
  --button-icon-size: 34px;
  --button-shadow: 0 10px 24px rgba(6, 50, 50, 0.15);
  --button-shadow-hover: 0 14px 30px rgba(6, 50, 50, 0.21);
}

/* =========================================================
   RESET
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg-body);
  color: var(--color-text);
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-regular);
  line-height: var(--line-height-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg,
video,
canvas,
iframe {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

button,
input,
select,
textarea {
  font-family: var(--font-primary);
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

/*
 * Global typography ownership.
 * Page styles inherit Inter from here; icon-font classes keep their own font.
 */
#page,
#page button,
#page input,
#page select,
#page textarea {
  font-family: var(--font-primary);
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin-top: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--color-heading);
  font-family: var(--font-primary);
  font-weight: var(--font-medium);
  line-height: var(--line-height-heading);
  letter-spacing: 0;
}

h1 {
  font-size: 4.25rem;
}

h2 {
  font-size: 3rem;
}

h3 {
  font-size: 1.65rem;
}

h4 {
  font-size: var(--font-size-lg);
}

h5 {
  font-size: var(--font-size-md);
}

h6 {
  font-size: var(--font-size-base);
}

p {
  margin-bottom: var(--space-5);
  font-family: var(--font-primary);
  font-size: inherit;
}

a,
li,
label,
small,
blockquote,
figcaption,
caption,
th,
td {
  font-family: var(--font-primary);
}

strong,
b {
  font-weight: var(--font-extrabold);
}

::selection {
  background: var(--color-accent);
  color: var(--color-primary);
}

/* =========================================================
   CONTAINERS
   ========================================================= */

.container {
  width: min(
    calc(100% - (var(--container-padding) * 2)),
    var(--container-width)
  );
  margin-inline: auto;
}

.container-wide {
  width: min(
    calc(100% - (var(--container-padding) * 2)),
    var(--container-wide)
  );
  margin-inline: auto;
}

.container-fluid {
  width: 100%;
  padding-inline: var(--container-padding);
}

/* =========================================================
   TYPOGRAPHY UTILITIES
   ========================================================= */

.text-primary { color: var(--color-primary); }
.text-accent { color: var(--color-accent); }
.text-lime { color: var(--color-lime); }
.text-white { color: var(--color-white); }
.text-black { color: var(--color-black); }
.text-muted { color: var(--color-muted); }

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.fw-400 { font-weight: var(--font-regular); }
.fw-500 { font-weight: var(--font-medium); }
.fw-600 { font-weight: var(--font-semibold); }
.fw-700 { font-weight: var(--font-bold); }
.fw-800 { font-weight: var(--font-extrabold); }
.fw-900 { font-weight: var(--font-black); }

.text-uppercase { text-transform: uppercase; }
.text-capitalize { text-transform: capitalize; }

.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-md { font-size: var(--font-size-md); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }

/* =========================================================
   BUTTONS
   ========================================================= */

#page .btn {
  display: inline-flex;
  min-height: var(--button-height);
  align-items: center;
  justify-content: center;
  gap: var(--button-gap);
  position: relative;
  padding: 10px var(--button-padding-x);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-primary);
  font-size: var(--button-font-size);
  font-weight: var(--font-bold);
  line-height: 1.2;
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  transition:
    transform var(--transition-fast),
    background-color var(--transition-base),
    color var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base);
}

#page .btn:hover {
  transform: translateY(-1px);
}

#page .btn:active {
  transform: translateY(0);
}

/* Add one consistent Font Awesome arrow when the template has no icon. */
#page .btn:not(:has(> i, > svg, > [class*="fa-"]))::after {
  width: var(--button-icon-size);
  height: var(--button-icon-size);
  display: inline-grid;
  flex: 0 0 var(--button-icon-size);
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.19);
  content: "\f061";
  font-family: "Font Awesome 6 Free";
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  transition: transform var(--transition-base), background-color var(--transition-base);
}

#page .btn > i,
#page .btn > svg,
#page .btn > [class*="fa-"] {
  width: var(--button-icon-size);
  height: var(--button-icon-size);
  display: inline-grid;
  flex: 0 0 var(--button-icon-size);
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.19);
  font-size: 0.78rem;
  transition: transform var(--transition-base);
}

#page .btn:hover::after,
#page .btn:hover > i,
#page .btn:hover > svg,
#page .btn:hover > [class*="fa-"] {
  transform: translateX(3px);
}

#page .btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
  box-shadow: var(--button-shadow);
}

#page .btn-primary:hover {
  background: var(--color-primary-dark);
  color: var(--color-white);
  box-shadow: var(--button-shadow-hover);
}

#page .btn-accent {
  background: var(--color-primary);
  color: var(--color-white);
  box-shadow: var(--button-shadow);
}

#page .btn-accent:hover {
  background: var(--color-primary-dark);
  color: var(--color-white);
  box-shadow: var(--button-shadow-hover);
}

/*
 * Orange is an intentional accent, reserved for navigation and CTAs placed
 * on dark green surfaces. Light-page actions remain green for visual balance.
 */
#page :is(
  .site-header,
  .home-hero,
  .home-application-cta,
  .program-final-cta,
  .mortgage-help-card,
  .blog-cta-widget,
  .privacy-official,
  .terms-official,
  .accessibility-official,
  .licensing-official,
  .testimonials-final-action
) .btn-accent {
  background: var(--color-accent);
  color: var(--color-white);
  box-shadow: 0 10px 24px rgba(251, 177, 47, 0.23);
}

#page :is(
  .site-header,
  .home-hero,
  .home-application-cta,
  .program-final-cta,
  .mortgage-help-card,
  .blog-cta-widget,
  .privacy-official,
  .terms-official,
  .accessibility-official,
  .licensing-official,
  .testimonials-final-action
) .btn-accent:hover {
  background: var(--color-accent-dark);
  color: var(--color-white);
  box-shadow: 0 14px 30px rgba(251, 177, 47, 0.3);
}

#page .btn-outline-primary {
  border-color: var(--color-primary);
  background: transparent;
  color: var(--color-primary);
}

#page .btn-outline-primary:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

#page .btn-outline-light {
  border-color: rgba(255, 255, 255, 0.6);
  background: transparent;
  color: var(--color-white);
}

#page .btn-outline-light:hover {
  border-color: var(--color-white);
  background: var(--color-white);
  color: var(--color-primary);
}

#page .btn-sm {
  min-height: 44px;
  padding: 8px 20px;
  font-size: 0.875rem;
}

#page .btn-sm:not(:has(> i, > svg, > [class*="fa-"]))::after {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  font-size: 0.68rem;
}

#page .btn-sm > i,
#page .btn-sm > svg,
#page .btn-sm > [class*="fa-"] {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  font-size: 0.68rem;
}

#page .btn-lg {
  min-height: 58px;
  padding: 12px 32px;
  font-size: 1rem;
}

#page .btn-block {
  width: 100%;
}

/* =========================================================
   FORMS
   ========================================================= */

.form-group {
  display: grid;
  gap: var(--space-2);
}

.form-label {
  color: var(--color-heading);
  font-size: var(--font-size-sm);
  font-weight: var(--font-bold);
}

.form-control {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--color-white);
  color: var(--color-heading);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.form-control::placeholder {
  color: var(--color-muted);
}

.form-control:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(251, 177, 47, 0.16);
}

textarea.form-control {
  min-height: 140px;
  resize: vertical;
}

select.form-control {
  appearance: none;
}

/* =========================================================
   FLEX / GRID HELPERS
   ========================================================= */

.d-block { display: block; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-grid { display: grid; }
.d-none { display: none; }

.align-start { align-items: flex-start; }
.align-center { align-items: center; }
.align-end { align-items: flex-end; }

.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

.flex-wrap { flex-wrap: wrap; }
.flex-column { flex-direction: column; }

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.gap-1 { gap: var(--space-2); }
.gap-2 { gap: var(--space-4); }
.gap-3 { gap: var(--space-6); }
.gap-4 { gap: var(--space-7); }
.gap-5 { gap: var(--space-9); }

/* =========================================================
   BACKGROUND UTILITIES
   ========================================================= */

.bg-white { background: var(--color-white); }
.bg-soft { background: var(--bg-soft); }
.bg-light { background: var(--bg-light); }
.bg-primary { background: var(--color-primary); }
.bg-dark { background: var(--bg-darker); }
.bg-accent { background: var(--color-accent); }
.bg-lime { background: var(--color-lime); }

/* =========================================================
   BORDER / RADIUS / SHADOW UTILITIES
   ========================================================= */

.border { border: 1px solid var(--border-color); }
.border-top { border-top: 1px solid var(--border-color); }
.border-bottom { border-bottom: 1px solid var(--border-color); }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-pill { border-radius: var(--radius-pill); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* =========================================================
   IMAGE UTILITIES
   ========================================================= */

.img-fluid {
  width: 100%;
  height: auto;
}

.object-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.object-contain {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* =========================================================
   SPACING UTILITIES
   ========================================================= */

.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.ml-0 { margin-left: 0; }
.mr-0 { margin-right: 0; }

.mt-1 { margin-top: var(--space-2); }
.mt-2 { margin-top: var(--space-4); }
.mt-3 { margin-top: var(--space-6); }
.mt-4 { margin-top: var(--space-7); }
.mt-5 { margin-top: var(--space-9); }

.mb-1 { margin-bottom: var(--space-2); }
.mb-2 { margin-bottom: var(--space-4); }
.mb-3 { margin-bottom: var(--space-6); }
.mb-4 { margin-bottom: var(--space-7); }
.mb-5 { margin-bottom: var(--space-9); }

.p-0 { padding: 0; }
.p-1 { padding: var(--space-2); }
.p-2 { padding: var(--space-4); }
.p-3 { padding: var(--space-6); }
.p-4 { padding: var(--space-7); }
.p-5 { padding: var(--space-9); }

.pt-0 { padding-top: 0; }
.pb-0 { padding-bottom: 0; }

.py-sm { padding-block: var(--space-10); }
.py-md { padding-block: var(--space-12); }
.py-lg { padding-block: var(--space-13); }

/* =========================================================
   GENERAL UTILITIES
   ========================================================= */

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.position-relative { position: relative; }
.position-absolute { position: absolute; }

.overflow-hidden { overflow: hidden; }

.cursor-pointer { cursor: pointer; }

.transition {
  transition: all var(--transition-base);
}

.divider {
  width: 100%;
  height: 1px;
  background: var(--border-color);
}

/* =========================================================
   ACCESSIBILITY
   ========================================================= */

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* =========================================================
   RESPONSIVE ROOT ADJUSTMENTS
   ========================================================= */

@media (max-width: 1199px) {
  :root {
    --container-padding: 20px;
  }
}

@media (max-width: 991px) {
  h1 {
    font-size: 3.25rem;
  }

  h2 {
    font-size: 2.45rem;
  }

  h3 {
    font-size: 1.45rem;
  }

  .grid-4,
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  :root {
    --container-padding: 16px;
  }

  body {
    font-size: 0.96rem;
  }

  h1 {
    font-size: 2.45rem;
  }

  h2 {
    font-size: 2rem;
  }

  h3 {
    font-size: 1.32rem;
  }

  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
  }

  .py-lg {
    padding-block: var(--space-11);
  }

  .py-md {
    padding-block: var(--space-10);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* =========================================================
   GLOBAL SECTION HEADING SYSTEM
   Shared by home, inner pages, archives and detail templates.
   ========================================================= */

#page main section:not([class*="hero"]):not([class*="banner"]) :is(
  :is(header, [class*="section-heading"], [class*="-heading"], [class*="-copy"], .about-eyebrow) .section-kicker,
  .section-eyebrow,
  [class*="section-heading"] > p:first-child
) {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 15px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #e99113;
  font-family: var(--font-primary);
  font-size: clamp(0.875rem, 0.35vw + 0.58rem, 1rem);
  font-weight: var(--font-semibold);
  line-height: 1.3;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

#page main section:not([class*="hero"]):not([class*="banner"]) :is(
  :is(header, [class*="section-heading"], [class*="-heading"], [class*="-copy"], .about-eyebrow) .section-kicker,
  .section-eyebrow,
  [class*="section-heading"] > p:first-child
)::before {
  width: 36px;
  height: 36px;
  display: inline-grid;
  flex: 0 0 36px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  content: "\2731";
  font-size: 18px;
  font-weight: var(--font-bold);
  line-height: 1;
}

#page main section:not([class*="hero"]):not([class*="banner"]) :is(
  :is(header, [class*="section-heading"], [class*="-heading"], [class*="-copy"], .about-eyebrow) .section-kicker,
  .section-eyebrow,
  [class*="section-heading"] > p:first-child
)::after {
  display: none;
  content: none;
}

#page main section:not([class*="hero"]):not([class*="banner"]) :is(
  .section-title,
  [class*="section-heading"] > h2,
  header > .section-kicker + h2
) {
  max-width: 980px;
  margin-top: 0;
  margin-bottom: 0;
  color: var(--color-heading);
  font-family: var(--font-primary);
  font-size: clamp(2.25rem, 2.2vw, 2.625rem);
  font-weight: var(--font-medium);
  line-height: 1.12;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

#page main section:not([class*="hero"]):not([class*="banner"]) :is(
  .section-title,
  [class*="section-heading"] > h2,
  header > .section-kicker + h2
) :is(strong, b) {
  font-weight: var(--font-extrabold);
}

#page main section:not([class*="hero"]):not([class*="banner"]) [class*="section-heading"] {
  max-width: 1040px;
  margin-bottom: clamp(2rem, 2.5vw, 3rem);
  padding-left: 0;
  border-left: 0;
}

#page main section:not([class*="hero"]):not([class*="banner"]) header:has(> .section-kicker + h2) {
  margin-bottom: clamp(2rem, 2.5vw, 3rem);
}

#page main section:not([class*="hero"]):not([class*="banner"]) :not([class*="section-heading"]) > .section-title {
  margin-bottom: clamp(1.5rem, 2vw, 2rem);
}

#page main .about-eyebrow > span:empty {
  display: none;
}

/* Remove legacy vertical rules from shared section-title containers. */
#page main section:not([class*="hero"]):not([class*="banner"]) [class*="section-heading"]::before,
#page main section:not([class*="hero"]):not([class*="banner"]) :is(
  [class*="-copy"],
  [class*="-content"]
):has(> .section-title)::before {
  display: none;
  content: none;
}

#page main section:not([class*="hero"]):not([class*="banner"]) :is(
  [class*="-copy"],
  [class*="-content"]
):has(> .section-title) {
  padding-left: 0;
  border-left: 0;
}

/* Maintain strong contrast wherever the shared heading sits on dark green. */
#page main section:is(
  .about-cmg-section,
  .fha-impact,
  .va-opportunity,
  .fullk-contingency,
  .hs-homeowners,
  .varen-opportunity
) :is(
  .section-title,
  [class*="section-heading"] > h2,
  header > .section-kicker + h2
) {
  color: #fff;
}

#page main section:is(
  .about-cmg-section,
  .fha-impact,
  .va-opportunity,
  .fullk-contingency,
  .hs-homeowners,
  .varen-opportunity
) :is(
  header,
  [class*="section-heading"],
  [class*="-heading"],
  [class*="-copy"]
) .section-kicker {
  color: var(--color-accent);
}

@media (max-width: 767px) {
  #page main section:not([class*="hero"]):not([class*="banner"]) :is(
    :is(header, [class*="section-heading"], [class*="-heading"], [class*="-copy"], .about-eyebrow) .section-kicker,
    .section-eyebrow,
    [class*="section-heading"] > p:first-child
  ) {
    min-height: 32px;
    gap: 9px;
    margin-bottom: 12px;
    font-size: 0.875rem;
  }

  #page main section:not([class*="hero"]):not([class*="banner"]) :is(
    :is(header, [class*="section-heading"], [class*="-heading"], [class*="-copy"], .about-eyebrow) .section-kicker,
    .section-eyebrow,
    [class*="section-heading"] > p:first-child
  )::before {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    font-size: 15px;
  }

  #page main section:not([class*="hero"]):not([class*="banner"]) :is(
    .section-title,
    [class*="section-heading"] > h2,
    header > .section-kicker + h2
  ) {
    font-size: clamp(2rem, 7.8vw, 2.375rem);
    line-height: 1.14;
    letter-spacing: -0.035em;
  }
}
