/* ============================================
   Jimmy Wu — Nexa Lending
   Single stylesheet for all pages
   Theme: "Premium Trust" (light, default) +
          "Midnight Trust" (dark, [data-theme="dark"])
   ============================================ */

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

:root {
  /* Premium Trust (light, default) */
  --page-bg: #f4f8fd;
  --surface: #ffffff;
  --surface-2: #f8fbff;
  --alt-bg: #ebf2fb;
  --heading: #0b2a52;
  --text: #293c56;
  --text-light: #42536d;
  --muted: #5d7391;
  --link: #1e62e0;
  --link-hover: #1448b0;
  --accent: #2470f0;
  --accent-strong: #1a55c9;
  --accent-soft: rgba(36, 112, 240, 0.1);
  --accent-fg: #ffffff;
  --gold: #f2b73e;
  --gold-strong: #d9961a;
  --gold-ink: #8a6108;
  --gold-soft: rgba(242, 183, 62, 0.16);
  --gold-fg: #2a1d04;
  --border: #dce6f4;
  --border-soft: #e7effa;
  --input-bg: #ffffff;
  --focus-ring: rgba(36, 112, 240, 0.22);
  --header-bg: rgba(255, 255, 255, 0.82);
  --hero-bg:
    radial-gradient(900px 480px at 85% -10%, rgba(242, 183, 62, 0.22), transparent 60%),
    radial-gradient(700px 500px at 8% 110%, rgba(61, 142, 255, 0.28), transparent 60%),
    linear-gradient(158deg, #0a2149 0%, #10346d 55%, #0d2a5c 100%);
  --hero-title: #ffffff;
  --hero-span: #ffd97a;
  --hero-sub: #bfd5f3;
  --banner-bg:
    radial-gradient(700px 300px at 90% 0%, rgba(242, 183, 62, 0.2), transparent 60%),
    linear-gradient(150deg, #0a2149, #123c7d);
  --banner-fg: #ffffff;
  --banner-sub: #b9cee8;
  --footer-bg: #071a38;
  --footer-fg: #93a9c6;
  --footer-link: #c8d9ee;
  --footer-divider: #22395e;
  --tip-bg: #0b2a52;
  --tip-fg: #f2f7ff;
  --tip-sub: #c4d6ef;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(11, 42, 82, 0.07);
  --shadow-md: 0 10px 24px rgba(11, 42, 82, 0.1);
  --shadow-lg: 0 20px 44px rgba(11, 42, 82, 0.16);
  --shadow-glow: 0 10px 30px rgba(36, 112, 240, 0.35);
  --radius: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --transition: 0.25s ease;
  --max-width: 1200px;
  --header-height: 68px;
  --font-stack: "Plus Jakarta Sans", "Segoe UI", -apple-system,
    BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Midnight Trust (dark) */
[data-theme="dark"] {
  --page-bg: #081120;
  --surface: #101e33;
  --surface-2: #0c1728;
  --alt-bg: #0c1829;
  --heading: #eef4fd;
  --text: #d9e4f2;
  --text-light: #b3c4da;
  --muted: #93a7c0;
  --link: #6ea6ff;
  --link-hover: #9cc2ff;
  --accent: #4d8dff;
  --accent-strong: #2f74ee;
  --accent-soft: rgba(77, 141, 255, 0.14);
  --accent-fg: #06173a;
  --gold: #ffcf6b;
  --gold-strong: #f2b73e;
  --gold-ink: #ffd98a;
  --gold-soft: rgba(255, 207, 107, 0.14);
  --gold-fg: #2a1d04;
  --border: rgba(255, 255, 255, 0.1);
  --border-soft: rgba(255, 255, 255, 0.06);
  --input-bg: #0c1728;
  --focus-ring: rgba(77, 141, 255, 0.32);
  --header-bg: rgba(8, 17, 32, 0.82);
  --hero-bg:
    radial-gradient(900px 480px at 85% -10%, rgba(242, 183, 62, 0.14), transparent 60%),
    radial-gradient(700px 500px at 8% 110%, rgba(61, 142, 255, 0.2), transparent 60%),
    linear-gradient(158deg, #071426 0%, #0d2447 55%, #0a1c3a 100%);
  --hero-title: #ffffff;
  --hero-span: #ffd97a;
  --hero-sub: #a9c3dd;
  --banner-bg:
    radial-gradient(700px 300px at 90% 0%, rgba(242, 183, 62, 0.12), transparent 60%),
    linear-gradient(150deg, #0a1a33, #10294f);
  --banner-fg: #ffffff;
  --banner-sub: #a9c3dd;
  --footer-bg: #050d1b;
  --footer-fg: #7f93ab;
  --footer-link: #b9c8db;
  --footer-divider: #1d2c46;
  --tip-bg: #e8f0fc;
  --tip-fg: #12233f;
  --tip-sub: #42586f;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 26px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 22px 46px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 10px 30px rgba(77, 141, 255, 0.3);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
  color-scheme: light;
}

/* Prevent horizontal page overflow (off-canvas mobile nav, decorations).
   `clip` (unlike `hidden`) does not create a scroll container,
   so the sticky header keeps working. */
html,
body {
  overflow-x: clip;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

body {
  font-family: var(--font-stack);
  font-size: 16.5px;
  color: var(--text);
  line-height: 1.7;
  background-color: var(--page-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition), color var(--transition);
}

::selection {
  background: var(--accent);
  color: var(--accent-fg);
}

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

a {
  color: var(--link);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--link-hover);
}

ul,
ol {
  list-style: none;
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

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

.section {
  padding: 88px 0;
}

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

.section__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold-ink);
  margin-bottom: 14px;
}

.section__eyebrow::before,
.section__eyebrow::after {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
}

.section__title {
  font-size: clamp(1.7rem, 3.4vw, 2.35rem);
  font-weight: 800;
  color: var(--heading);
  text-align: center;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 16px;
}

.section__header {
  text-align: center;
  margin-bottom: 56px;
}

.section__header .section__eyebrow {
  justify-content: center;
}

.section__subtitle {
  font-size: 1.12rem;
  color: var(--text-light);
  text-align: center;
  max-width: 660px;
  margin: 0 auto;
}

.text-center {
  text-align: center;
}

/* --- Buttons --- */
.btn {
  position: relative;
  display: inline-block;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-stack);
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: transform var(--transition), box-shadow var(--transition),
    background-color var(--transition), color var(--transition),
    border-color var(--transition);
  line-height: 1.4;
  overflow: hidden;
}

.btn--primary {
  background-image: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--accent-fg);
  border-color: transparent;
  box-shadow: var(--shadow-glow);
}

.btn--primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 50%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.55s ease;
  pointer-events: none;
}

.btn--primary:hover {
  color: var(--accent-fg);
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(36, 112, 240, 0.42);
}

.btn--primary:hover::after {
  left: 130%;
}

.btn--secondary {
  background-color: transparent;
  color: var(--link);
  border-color: var(--link);
}

.btn--secondary:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.cta-banner .btn--secondary,
.hero .btn--secondary,
.btn--secondary--inverse {
  color: var(--banner-fg);
  border-color: rgba(255, 255, 255, 0.45);
  background-color: rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.cta-banner .btn--secondary:hover,
.hero .btn--secondary:hover {
  background-color: var(--white);
  border-color: var(--white);
  color: #0b2a52;
}

.btn--outline {
  background-color: transparent;
  color: var(--link);
  border-color: var(--border);
  box-shadow: none;
}

.btn--outline:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.btn--lg {
  padding: 17px 42px;
  font-size: 1.08rem;
}

/* --- Header --- */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid var(--border-soft);
  height: var(--header-height);
  display: flex;
  align-items: center;
  transition: background-color var(--transition), box-shadow var(--transition),
    border-color var(--transition);
}

.header.is-scrolled {
  box-shadow: var(--shadow-md);
  border-bottom-color: var(--border);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.header__logo {
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--heading);
  text-decoration: none;
  white-space: nowrap;
}

.header__logo span {
  color: var(--gold-strong);
  font-weight: 400;
}

.header__logo:hover {
  color: var(--accent);
}

/* --- Theme Toggle --- */
.theme-toggle {
  margin-left: 16px;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background-color: var(--surface);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold);
}

/* --- Nav --- */
.nav {
  margin-left: auto;
}

.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.nav__toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--heading);
  margin: 5px 0;
  border-radius: 2px;
  transition: all var(--transition);
}

.nav__toggle.active .nav__toggle-bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav__toggle.active .nav__toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav__toggle.active .nav__toggle-bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 26px;
}

.nav__link {
  position: relative;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--transition);
  padding: 6px 0;
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.5px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-strong));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

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

.nav__link:hover::after,
.nav__link--active::after {
  transform: scaleX(1);
}

.nav__cta {
  margin-left: 8px;
}

.nav__cta .btn {
  padding: 9px 22px;
  font-size: 0.9rem;
}

/* --- Hero --- */
.hero {
  position: relative;
  background: var(--hero-bg);
  color: var(--hero-title);
  padding: 128px 0 116px;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, #000 5%, transparent 62%);
  mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, #000 5%, transparent 62%);
  pointer-events: none;
}

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

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  margin-bottom: 28px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #eaf2ff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.hero__badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(242, 183, 62, 0.25);
}

.hero__title {
  font-size: clamp(2.5rem, 5.6vw, 3.9rem);
  font-weight: 800;
  line-height: 1.12;
  margin-bottom: 22px;
  letter-spacing: -0.025em;
  color: var(--hero-title);
}

.hero__title span {
  background: linear-gradient(100deg, var(--hero-span), #f2b73e);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero__tagline {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  font-weight: 400;
  color: var(--hero-sub);
  max-width: 640px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero__tagline strong {
  color: #ffffff;
  font-weight: 700;
}

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

.hero__stats {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: clamp(20px, 4vw, 48px);
  flex-wrap: wrap;
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.hero-stat {
  min-width: 120px;
}

.hero-stat__value {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--hero-span);
  line-height: 1.1;
}

.hero-stat__label {
  margin-top: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hero-sub);
}

/* --- Cards Grid --- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.card {
  position: relative;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 28px;
  transition: transform var(--transition), box-shadow var(--transition),
    border-color var(--transition);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  opacity: 0;
  transition: opacity var(--transition);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.card:hover::before {
  opacity: 1;
}

.card__icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  line-height: 1;
  margin-bottom: 18px;
  background: var(--accent-soft);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  transition: transform var(--transition), background-color var(--transition);
}

.card:hover .card__icon {
  transform: scale(1.06) rotate(-3deg);
  background: var(--gold-soft);
}

.card__title {
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--heading);
  margin-bottom: 8px;
}

.card__text {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.65;
  flex: 1;
}

.card__link {
  margin-top: 16px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--link);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color var(--transition);
}

.card__link:hover {
  color: var(--link-hover);
}

.card__link::after {
  content: "→";
  transition: transform var(--transition);
}

.card__link:hover::after {
  transform: translateX(4px);
}

/* --- Why Nexa --- */
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}

.why-item {
  text-align: center;
  padding: 36px 26px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform var(--transition), box-shadow var(--transition),
    border-color var(--transition);
}

.why-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold);
}

.why-item__icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: var(--gold-soft);
  border-radius: 50%;
}

.why-item__title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--heading);
  margin-bottom: 8px;
}

.why-item__text {
  font-size: 0.95rem;
  color: var(--text-light);
}

/* --- Contact Info Section --- */
.contact-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  max-width: 860px;
  margin: 0 auto;
}

.contact-info__item {
  text-align: center;
  padding: 34px 24px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}

.contact-info__item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold);
}

.contact-info__icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  background: var(--accent-soft);
  border-radius: 50%;
}

.contact-info__label {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 4px;
}

.contact-info__value {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--heading);
}

.contact-info__value a {
  color: var(--heading);
  text-decoration: none;
}

.contact-info__value a:hover {
  color: var(--link);
}

/* --- CTA Banner --- */
.cta-banner {
  position: relative;
  background: var(--banner-bg);
  color: var(--banner-fg);
  padding: 76px 0;
  text-align: center;
  overflow: hidden;
}

.cta-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse 75% 90% at 50% 50%, #000 5%, transparent 65%);
  mask-image: radial-gradient(ellipse 75% 90% at 50% 50%, #000 5%, transparent 65%);
  pointer-events: none;
}

.cta-banner .container {
  position: relative;
  z-index: 1;
}

.cta-banner__title {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.cta-banner__text {
  font-size: 1.08rem;
  color: var(--banner-sub);
  margin-bottom: 34px;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}

.cta-banner__actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Footer --- */
.footer {
  position: relative;
  background-color: var(--footer-bg);
  color: var(--footer-link);
  padding: 56px 0 32px;
}

.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-strong), var(--gold), var(--accent-strong));
}

.footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 36px;
  margin-bottom: 44px;
}

.footer__heading {
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 14px;
}

.footer__text,
.footer__link {
  font-size: 0.92rem;
  color: var(--footer-link);
  line-height: 1.85;
}

.footer__link {
  display: block;
  text-decoration: none;
  transition: color var(--transition), transform var(--transition);
}

.footer__link:hover {
  color: var(--gold);
  transform: translateX(3px);
}

.footer__divider {
  border: none;
  border-top: 1px solid var(--footer-divider);
  margin: 0 0 26px;
}

.footer__compliance {
  font-size: 0.78rem;
  color: var(--footer-fg);
  line-height: 1.7;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.footer__compliance p {
  margin-bottom: 8px;
}

/* --- Footer Brand (NEXA logo chip) --- */
.footer__brand {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 18px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.footer__brand img {
  height: 46px;
  width: auto;
  display: block;
}

.footer__brand:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* --- Footer Compliance Logos --- */
.footer__logos {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px 28px;
  margin-bottom: 20px;
}

.footer__logo {
  width: 32px;
  height: 32px;
  color: var(--footer-fg);
}

.footer__logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer__logo-caption {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  line-height: 1.4;
  color: var(--footer-fg);
  text-align: left;
}

.footer__compliance a {
  color: var(--footer-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer__compliance a:hover {
  color: var(--gold);
}

.footer__legal-links {
  margin-top: 14px;
  font-size: 0.85rem;
}

/* --- Collapsible (Document Checklist) --- */
.collapsible {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  background-color: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.collapsible:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.collapsible__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-stack);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--heading);
  text-align: left;
  transition: background-color var(--transition);
}

.collapsible__trigger:hover {
  background-color: var(--surface-2);
}

.collapsible__trigger::after {
  content: "+";
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 50%;
  transition: transform var(--transition), background-color var(--transition);
  flex-shrink: 0;
  margin-left: 16px;
}

.collapsible__trigger.active::after {
  content: "−";
  background: var(--gold-soft);
  color: var(--gold-ink);
}

.collapsible__content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 24px;
}

.collapsible__content.open {
  max-height: 2000px;
  padding: 0 24px 20px;
}

.checklist {
  padding-left: 0;
}

.checklist li {
  padding: 8px 0 8px 30px;
  position: relative;
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.6;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  width: 16px;
  height: 16px;
  border: 2px solid var(--accent);
  border-radius: 5px;
  background: var(--surface);
}

.checklist li ul {
  margin-top: 6px;
  padding-left: 20px;
}

.checklist li ul li {
  padding: 4px 0 4px 24px;
  font-size: 0.9rem;
}

.checklist li ul li::before {
  content: "–";
  border: none;
  background: none;
  color: var(--muted);
  font-size: 1rem;
  width: auto;
  height: auto;
  top: 4px;
}

/* --- Loan Program Detail Sections --- */
.program {
  padding: 52px 0;
  border-bottom: 1px solid var(--border);
}

.program:last-child {
  border-bottom: none;
}

.program__header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.program__icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.program__title {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--heading);
}

.program__body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  align-items: start;
}

.program__description {
  font-size: 1rem;
  color: var(--text-light);
  line-height: 1.75;
}

.program__description p + p {
  margin-top: 14px;
}

.program__highlights {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}

.program__highlights-title {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin-bottom: 12px;
}

.program__highlights li {
  padding: 7px 0 7px 26px;
  position: relative;
  font-size: 0.93rem;
  color: var(--text);
  line-height: 1.55;
}

.program__highlights li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 7px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--gold-fg);
  background: var(--gold);
  border-radius: 50%;
  font-weight: 800;
}

.program__cta {
  margin-top: 26px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ============================================
   Stage — interactive master-detail explorer
   (Loan Programs & Loan Process pages)
   No-JS: store stays visible (stacked sections).
   With JS: index grid first; click → index docks
   left as a compact list, detail panel at right.
   ============================================ */

.stage__index-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.stage__index-title {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}

.stage__index-reset {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-stack);
  color: var(--link);
  background: var(--accent-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition);
}

.stage__index-reset:hover {
  background: var(--accent);
  color: var(--accent-fg);
}

.stage--activated .stage__index-reset {
  display: inline-flex;
}

/* Index as a card grid (initial view) */
.stage__index-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.stage-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition),
    border-color var(--transition), background-color var(--transition),
    padding var(--transition);
}

.stage-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.stage-item__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
  background: var(--accent-soft);
  border-radius: 12px;
  flex-shrink: 0;
  transition: all var(--transition);
}

.stage-item__title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--heading);
  transition: font-size var(--transition);
}

.stage-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Detail panel — hidden until activated */
.stage__detail {
  display: none;
}

/* Store: visible without JS so all content remains accessible */
.stage--ready .stage__store {
  display: none;
}

/* --- Activated: index docks left (smaller), detail at right --- */
.stage--activated {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.stage--activated .stage__index {
  position: sticky;
  top: calc(var(--header-height) + 20px);
}

.stage--activated .stage__index-head {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.stage--activated .stage__index-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: calc(100vh - var(--header-height) - 150px);
  overflow-y: auto;
  scrollbar-width: thin;
  padding-right: 4px;
}

.stage--activated .stage-item {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: transparent;
  border-color: transparent;
  border-radius: 10px;
}

.stage--activated .stage-item:hover {
  transform: none;
  box-shadow: none;
  background: var(--accent-soft);
}

.stage--activated .stage-item__icon {
  width: 30px;
  height: 30px;
  font-size: 0.95rem;
  border-radius: 9px;
}

.stage--activated .stage-item__title {
  font-size: 0.86rem;
}

.stage--activated .stage-item.active {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.stage--activated .stage__detail {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 38px;
  box-shadow: var(--shadow-sm);
  animation: stageDetailIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.12s backwards;
}

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

/* Moved-in sections drop their standalone spacing */
.stage__detail .program {
  padding: 0;
  border-bottom: none;
}

.stage__detail .step-card {
  max-width: none;
  margin: 0;
}

/* Prev / Next navigation under the detail */
.stage-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
}

.stage-nav__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.stage-nav__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.stage-nav__btn:disabled:hover {
  transform: none;
  background: transparent;
  color: var(--link);
  border-color: var(--border);
}

.stage-nav__pos {
  margin: 0 auto;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

/* Medium widths: stack the program body inside the narrower panel */
@media (min-width: 1024px) and (max-width: 1280px) {
  .stage__detail .program__body {
    grid-template-columns: 1fr;
  }
}

/* Mobile / tablet: activated index becomes a sticky chips bar */
@media (max-width: 1023px) {
  .stage__index-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .stage--activated {
    display: block;
  }

  .stage--activated .stage__index {
    top: var(--header-height);
    z-index: 900;
    margin: 0 -24px 24px;
    padding: 10px 24px;
    background: var(--header-bg);
    -webkit-backdrop-filter: saturate(1.5) blur(14px);
    backdrop-filter: saturate(1.5) blur(14px);
    border-bottom: 1px solid var(--border);
  }

  .stage--activated .stage__index-head {
    display: none;
  }

  .stage--activated .stage__index-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    max-height: none;
    overflow-x: auto;
    padding-right: 0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .stage--activated .stage__index-grid::-webkit-scrollbar {
    display: none;
  }

  .stage--activated .stage-item {
    flex: 0 0 auto;
    padding: 7px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
  }

  .stage--activated .stage-item__icon {
    width: auto;
    height: auto;
    font-size: 0.95rem;
    background: none;
    border-radius: 0;
  }

  .stage--activated .stage-item__title {
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .stage--activated .stage-item.active {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: none;
  }

  .stage--activated .stage-item.active .stage-item__title {
    color: var(--accent-fg);
  }

  .stage--activated .stage__detail {
    padding: 26px 20px;
  }
}

@media (max-width: 480px) {
  .stage--activated .stage__index {
    margin: 0 -16px 20px;
    padding: 10px 16px;
  }

  .stage-nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .stage-nav__pos {
    order: 3;
    width: 100%;
    margin: 4px 0 0;
  }

  /* Tiny phones: shrink the horizontal stepper so all 5 nodes fit */
  .stage--progress:not(.stage--activated) .stage-item__icon {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
  }

  .stage--progress:not(.stage--activated) .stage__index-grid::before {
    top: 28px;
  }

  .stage--progress:not(.stage--activated) .stage-item__title {
    font-size: 0.68rem;
  }

  /* Tiny phones: legal tables scroll sideways if ever too wide */
  .legal table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Print: always show the full store, hide the stage chrome */
@media print {
  .stage .stage__index,
  .stage .stage__detail {
    display: none !important;
  }

  .stage .stage__store {
    display: block !important;
  }
}

/* ============================================
   Progress stepper variant (Loan Process)
   Horizontal progress bar → vertical timeline
   ============================================ */

.stage--progress .stage__index-grid {
  position: relative;
}

/* Smooth size/spacing changes while nodes glide (FLIP handles position) */
.stage--progress .stage-item {
  transition: padding 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.stage--progress .stage-item__icon {
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    font-size 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.3s ease, border-color 0.3s ease,
    color 0.3s ease, box-shadow 0.3s ease;
}

.stage--progress .stage-item__title {
  transition: font-size 0.5s cubic-bezier(0.22, 1, 0.36, 1), color 0.3s ease;
}

/* --- Horizontal bar (initial view) --- */
.stage--progress:not(.stage--activated) .stage__index-grid {
  display: flex;
  gap: 0;
}

/* track behind the nodes */
.stage--progress:not(.stage--activated) .stage__index-grid::before {
  content: "";
  position: absolute;
  top: 34px;
  left: 10%;
  right: 10%;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
}

.stage--progress:not(.stage--activated) .stage-item {
  flex: 1 1 0;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 10px 6px;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.stage--progress:not(.stage--activated) .stage-item:hover {
  transform: translateY(-2px);
  box-shadow: none;
}

.stage--progress .stage-item__icon {
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
}

.stage--progress:not(.stage--activated) .stage-item__icon {
  width: 48px;
  height: 48px;
  font-size: 1.1rem;
  border-radius: 50%;
  position: relative;
  z-index: 1;
}

.stage--progress:not(.stage--activated) .stage-item__title {
  font-size: 0.82rem;
  color: var(--text-light);
}

.stage--progress:not(.stage--activated) .stage-item:hover .stage-item__icon {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-md);
}

.stage--progress:not(.stage--activated) .stage-item:hover .stage-item__title {
  color: var(--heading);
}

/* --- Vertical timeline (activated view) --- */
.stage--progress.stage--activated .stage__index-grid::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 23px;
  bottom: 23px;
  width: 3px;
  background: var(--border);
  border-radius: 2px;
  transform-origin: top center;
  animation: stageLineGrow 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.15s backwards;
}

@keyframes stageLineGrow {
  from {
    opacity: 0;
    transform: scaleY(0.15);
  }
  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

/* gold fill from first node to the active node (height set by JS) */
.stage__index-progress {
  display: none;
  position: absolute;
  left: 27px;
  top: 23px;
  width: 3px;
  height: 0;
  background: linear-gradient(180deg, var(--gold), var(--gold-strong));
  border-radius: 2px;
  transition: height 0.45s ease, top 0.45s ease;
  z-index: 1;
}

.stage--progress.stage--activated .stage__index-progress {
  display: block;
}

.stage--progress.stage--activated .stage-item__icon {
  border-radius: 50%;
  position: relative;
  z-index: 2;
}

/* completed steps */
.stage--progress .stage-item.done .stage-item__icon {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--gold-fg);
}

/* current step */
.stage--progress .stage-item.active {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.stage--progress .stage-item.active .stage-item__icon {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
  box-shadow: 0 0 0 5px var(--accent-soft);
}

.stage--progress .stage-item.active .stage-item__title {
  color: var(--link);
}

/* hint under the horizontal bar */
.stage__hint {
  text-align: center;
  margin-top: 28px;
  font-size: 0.95rem;
  color: var(--text-light);
}

.stage--activated .stage__hint {
  display: none;
}

/* Progress stepper on small screens */
@media (max-width: 1023px) {
  .stage--progress:not(.stage--activated) .stage-item__icon {
    width: 40px;
    height: 40px;
    font-size: 0.95rem;
  }

  .stage--progress:not(.stage--activated) .stage__index-grid::before {
    top: 30px;
    left: 9%;
    right: 9%;
  }

  .stage--progress:not(.stage--activated) .stage-item__title {
    font-size: 0.72rem;
  }

  /* chips bar mode: hide the timeline track/fill */
  .stage--progress.stage--activated .stage__index-grid::before,
  .stage--progress.stage--activated .stage__index-progress {
    display: none;
  }

  .stage--progress.stage--activated .stage-item__icon {
    border: none;
    box-shadow: none;
  }

  .stage--progress.stage--activated .stage-item.done .stage-item__icon {
    background: none;
    color: var(--gold-strong);
  }

  .stage--progress.stage--activated .stage-item.active .stage-item__icon {
    background: none;
    color: var(--accent-fg);
    box-shadow: none;
  }
}

/* ============================================
   Timeline mode (Loan Process) — all steps as
   one continuous scrolling page
   ============================================ */

/* The detail panel / prev-next nav are never used in timeline mode */
.stage--timeline .stage__detail {
  display: none !important;
}

/* Store becomes the right (scrolling) column once activated */
.stage--timeline.stage--ready.stage--activated .stage__store {
  display: block;
}

.stage--timeline .stage__store .step-card {
  max-width: none;
  margin: 0 0 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 38px;
  box-shadow: var(--shadow-sm);
}

.stage--timeline .stage__store .step-card:last-child {
  margin-bottom: 0;
}

/* Steps cascade in when the timeline activates */
.stage--timeline.stage--activated .stage__store .step-card {
  animation: stageStepIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.stage--timeline.stage--activated .stage__store .step-card:nth-child(1) { animation-delay: 0.10s; }
.stage--timeline.stage--activated .stage__store .step-card:nth-child(2) { animation-delay: 0.18s; }
.stage--timeline.stage--activated .stage__store .step-card:nth-child(3) { animation-delay: 0.26s; }
.stage--timeline.stage--activated .stage__store .step-card:nth-child(4) { animation-delay: 0.34s; }
.stage--timeline.stage--activated .stage__store .step-card:nth-child(5) { animation-delay: 0.42s; }

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

@media (max-width: 768px) {
  .stage--timeline .stage__store .step-card {
    padding: 26px 20px;
    margin-bottom: 20px;
  }
}

/* --- Contact Form --- */
.contact-form {
  max-width: 640px;
  margin: 0 auto;
}

.contact-form__group {
  margin-bottom: 20px;
}

.contact-form__label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 6px;
}

.contact-form__input,
.contact-form__textarea {
  width: 100%;
  padding: 13px 17px;
  font-size: 1rem;
  font-family: var(--font-stack);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  background-color: var(--input-bg);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.contact-form__input:focus,
.contact-form__textarea:focus {
  outline: none;
  border-color: var(--link);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.contact-form__textarea {
  resize: vertical;
  min-height: 140px;
}

.contact-form__submit {
  width: 100%;
}

.contact-form__consent {
  font-size: 0.8rem;
  color: var(--text-light);
  line-height: 1.6;
  margin: 4px 0 20px;
}

/* --- Page Header (sub-pages) --- */
.page-header {
  position: relative;
  background: var(--hero-bg);
  color: var(--hero-title);
  padding: 84px 0 68px;
  text-align: center;
  overflow: hidden;
}

.page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse 85% 90% at 50% 35%, #000 5%, transparent 62%);
  mask-image: radial-gradient(ellipse 85% 90% at 50% 35%, #000 5%, transparent 62%);
  pointer-events: none;
}

.page-header .container {
  position: relative;
  z-index: 1;
}

.page-header__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--hero-span);
  margin-bottom: 14px;
}

.page-header__eyebrow::before,
.page-header__eyebrow::after {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--hero-span);
  border-radius: 2px;
  opacity: 0.7;
}

.page-header__title {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: var(--hero-title);
}

.page-header__subtitle {
  font-size: 1.1rem;
  color: var(--hero-sub);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.65;
}

/* --- Glossary Hint Pill --- */
.glossary-hint {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 24px;
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #eaf2ff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-pill);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.glossary-hint .term {
  color: #ffd97a;
  border-bottom-color: rgba(255, 217, 122, 0.75);
}

/* --- Glossary Terms & Tooltip --- */
.term {
  color: var(--link);
  font-weight: 600;
  border-bottom: 2px dotted var(--accent);
  cursor: help;
  transition: background-color var(--transition), color var(--transition);
  border-radius: 2px;
}

.term:hover,
.term:focus-visible,
.term.term--active {
  background: var(--accent-soft);
  color: var(--link-hover);
}

/* Terms on dark backgrounds (hero, page headers, CTA banner) */
.hero .term,
.page-header .term,
.cta-banner .term,
.hero__stats .term {
  color: #ffd97a;
  border-bottom-color: rgba(255, 217, 122, 0.75);
}

.hero .term:hover,
.page-header .term:hover,
.cta-banner .term:hover,
.hero .term:focus-visible,
.page-header .term:focus-visible,
.cta-banner .term:focus-visible,
.hero .term.term--active,
.page-header .term.term--active,
.cta-banner .term.term--active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffe9ae;
}

.glossary-tip {
  position: fixed;
  z-index: 3000;
  max-width: 320px;
  padding: 14px 16px;
  background: var(--tip-bg);
  color: var(--tip-fg);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  line-height: 1.55;
  opacity: 0;
  transform: translateY(6px) scale(0.97);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.glossary-tip.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.glossary-tip__title {
  display: block;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
  margin-bottom: 5px;
}

[data-theme="dark"] .glossary-tip__title {
  color: var(--gold-strong);
}

.glossary-tip__text {
  color: var(--tip-sub);
}

.glossary-tip::after {
  content: "";
  position: absolute;
  left: var(--arrow-left, 50%);
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: var(--tip-bg);
  transform: translateX(-50%) rotate(45deg);
  border-radius: 2px;
}

.glossary-tip--below::after {
  bottom: auto;
  top: -6px;
}

/* --- Loan Process Steps (Step Cards) --- */
.step-card {
  display: flex;
  gap: 34px;
  align-items: flex-start;
  max-width: 820px;
  margin: 0 auto;
}

.step-card__number {
  flex-shrink: 0;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background-image: linear-gradient(135deg, var(--gold), var(--gold-strong));
  color: var(--gold-fg);
  font-size: 1.55rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(217, 150, 26, 0.35), 0 0 0 6px var(--gold-soft);
}

.step-card__body {
  flex: 1;
}

.step-card__title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--heading);
  margin-bottom: 16px;
}

.step-card__body p {
  font-size: 1rem;
  color: var(--text-light);
  line-height: 1.75;
  margin-bottom: 12px;
}

.step-card__list {
  padding-left: 0;
  margin-bottom: 16px;
}

.step-card__list li {
  padding: 7px 0 7px 26px;
  position: relative;
  font-size: 0.96rem;
  color: var(--text-light);
  line-height: 1.65;
}

.step-card__list li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 15px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.step-card__list li strong {
  color: var(--heading);
}

.step-card__cta {
  margin-top: 24px;
}

.step-card__tips {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-top: 22px;
}

.section--alt .step-card__tips {
  background-color: var(--page-bg);
}

.step-card__tips-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--heading);
  margin-bottom: 12px;
}

/* --- Credit Score Factors --- */
.credit-factor {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  transition: all var(--transition);
}

.credit-factor:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--gold);
}

.credit-factor__header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.credit-factor__title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--heading);
}

.credit-factor__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-image: linear-gradient(135deg, var(--gold), var(--gold-strong));
  color: var(--gold-fg);
  font-size: 1rem;
  font-weight: 800;
  padding: 5px 16px;
  border-radius: 20px;
  white-space: nowrap;
}

.credit-factor__bar {
  width: 100%;
  height: 8px;
  background-color: var(--border-soft);
  border-radius: 4px;
  margin-bottom: 24px;
  overflow: hidden;
}

.credit-factor__bar-fill {
  height: 100%;
  background-image: linear-gradient(90deg, var(--gold), var(--gold-strong));
  border-radius: 4px;
}

.credit-factor__body p {
  font-size: 1rem;
  color: var(--text-light);
  line-height: 1.75;
  margin-bottom: 16px;
}

.credit-factor__tips {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 22px 26px;
}

.section--alt .credit-factor__tips {
  background-color: var(--page-bg);
}

.credit-factor__tips-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--heading);
  margin-bottom: 12px;
}

.credit-factor__tips {
  padding-left: 0;
}

.credit-factor__tips li {
  padding: 7px 0 7px 26px;
  position: relative;
  font-size: 0.94rem;
  color: var(--text);
  line-height: 1.6;
}

.credit-factor__tips li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--gold-strong);
  font-weight: 800;
}

/* --- Credit Score Pie Chart (Stage Animation) --- */
.pie-stage {
  position: relative;
  max-width: 1000px;
  margin: 48px auto 0;
  min-height: 500px;
}

.pie-stage__chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  transform: translateX(0);
}

.pie-stage.activated .pie-stage__chart {
  width: 45%;
  transform: translateX(0);
}

.pie-chart-container {
  position: relative;
  width: 400px;
  height: 400px;
  flex-shrink: 0;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1), height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.pie-stage.activated .pie-chart-container {
  width: 280px;
  height: 280px;
}

.pie-chart-container svg {
  width: 100%;
  height: 100%;
  display: block;
}

.pie-slice {
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.25s ease;
  transform-origin: 200px 200px;
  stroke: var(--alt-bg);
}

.pie-slice:hover,
.pie-slice.active {
  opacity: 1;
  transform: scale(1.04);
  filter: brightness(1.1);
}

.pie-slice.dimmed {
  opacity: 0.3;
}

.pie-chart-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.pie-chart-center__label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.pie-chart-center__value {
  font-size: 1.75rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.pie-chart-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 320px;
}

.pie-legend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid transparent;
}

.pie-legend-item:hover,
.pie-legend-item.active {
  background-color: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.pie-legend-item__swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  flex-shrink: 0;
}

.pie-legend-item__label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--heading);
}

.pie-legend-item__value {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--muted);
  margin-left: auto;
}

/* --- Pie Detail Panel (Stage) --- */
.pie-stage__detail {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.5s ease 0.15s, transform 0.5s ease 0.15s;
  pointer-events: none;
}

.pie-stage.activated .pie-stage__detail {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.pie-detail-panel {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
}

.pie-detail-panel__header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.pie-detail-panel__title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--heading);
}

.pie-detail-panel__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-image: linear-gradient(135deg, var(--gold), var(--gold-strong));
  color: var(--gold-fg);
  font-size: 1rem;
  font-weight: 800;
  padding: 5px 16px;
  border-radius: 20px;
  white-space: nowrap;
}

.pie-detail-panel__bar {
  width: 100%;
  height: 8px;
  background-color: var(--border-soft);
  border-radius: 4px;
  margin-bottom: 20px;
  overflow: hidden;
}

.pie-detail-panel__bar-fill {
  height: 100%;
  background-image: linear-gradient(90deg, var(--gold), var(--gold-strong));
  border-radius: 4px;
  transition: width 0.3s ease;
}

.pie-detail-panel__description {
  font-size: 1rem;
  color: var(--text-light);
  line-height: 1.75;
  margin-bottom: 20px;
}

.pie-detail-panel__tips {
  background-color: var(--alt-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 22px 26px;
}

.pie-detail-panel__tips-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--heading);
  margin-bottom: 12px;
}

.pie-detail-panel__tips ul li {
  padding: 6px 0 6px 24px;
  position: relative;
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.6;
}

.pie-detail-panel__tips ul li::before {
  content: "•";
  position: absolute;
  left: 4px;
  color: var(--gold-strong);
  font-weight: 800;
  font-size: 1.2rem;
}

/* --- Credit Score Intro --- */
.credit-intro {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.credit-intro p {
  font-size: 1.08rem;
  color: var(--text-light);
  line-height: 1.75;
  margin-bottom: 12px;
}

/* --- Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.22, 0.61, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

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

/* --- Back to Top --- */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1500;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background-image: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--accent-fg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
}

.back-to-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  transform: translateY(-3px);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
}

/* --- Legal Pages (Licensing & Disclosures, Privacy) --- */
.legal {
  max-width: 820px;
  margin: 0 auto;
}

.legal h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--heading);
  margin: 32px 0 10px;
}

.legal h2:first-child {
  margin-top: 0;
}

.legal p,
.legal li {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 10px;
}

.legal ul {
  list-style: disc;
  padding-left: 22px;
  margin-bottom: 14px;
}

.legal ul li {
  margin-bottom: 6px;
}

.legal table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 22px;
  font-size: 0.92rem;
}

.legal th,
.legal td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
  color: var(--text-light);
}

.legal th {
  background-color: var(--alt-bg);
  color: var(--heading);
  font-weight: 800;
}

.legal .legal-updated {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 24px;
}

/* --- Responsive --- */

/* --- Mobile & touch polish --- */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  -webkit-tap-highlight-color: transparent;
}

/* Safe-area insets (notched phones) */
.footer {
  padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
}

.back-to-top {
  right: calc(24px + env(safe-area-inset-right, 0px));
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

/* Bigger touch targets on coarse pointers */
@media (pointer: coarse) {
  .theme-toggle {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }

  .nav__toggle {
    padding: 11px 10px;
  }

  .back-to-top {
    width: 52px;
    height: 52px;
  }

  .collapsible__trigger {
    min-height: 56px;
  }
}

/* Touch devices: no sticky hover-lift after taps */
@media (hover: none) {
  .card:hover,
  .why-item:hover,
  .contact-info__item:hover,
  .stage-item:hover,
  .credit-factor:hover,
  .collapsible:hover,
  .btn:hover,
  .back-to-top:hover {
    transform: none;
  }
}

/* Hamburger nav below 900px (desktop nav + CTA don't fit between 768–900px) */
@media (max-width: 900px) {
  .nav__toggle {
    display: block;
    order: 3;
  }

  .theme-toggle {
    order: 2;
    margin-left: auto;
    margin-right: 4px;
  }

  .nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--page-bg);
    padding: 32px 24px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 999;
    overflow-y: auto;
    margin-left: 0;
  }

  .nav.open {
    transform: translateX(0);
  }

  .nav__list {
    flex-direction: column;
    gap: 0;
    align-items: stretch;
  }

  .nav__list li {
    border-bottom: 1px solid var(--border-soft);
  }

  .nav__link {
    display: block;
    padding: 16px 0;
    font-size: 1.05rem;
  }

  .nav__link::after {
    display: none;
  }

  .nav__cta {
    margin-left: 0;
    margin-top: 16px;
  }

  .nav__cta .btn {
    display: block;
    text-align: center;
    padding: 14px 24px;
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  .section {
    padding: 60px 0;
  }

  .section__header {
    margin-bottom: 40px;
  }

  .hero {
    padding: 84px 0 72px;
  }

  .hero__stats {
    margin-top: 48px;
    padding-top: 32px;
    gap: 20px 32px;
  }

  .page-header {
    padding: 60px 0 48px;
  }

  /* Step cards stack */
  .step-card {
    flex-direction: column;
    gap: 20px;
  }

  .step-card__number {
    width: 48px;
    height: 48px;
    font-size: 1.3rem;
  }

  .step-card__title {
    font-size: 1.3rem;
  }

  /* Credit factor */
  .credit-factor {
    padding: 24px 20px;
  }

  .credit-factor__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .credit-factor__title {
    font-size: 1.3rem;
  }

  /* Program body stacks */
  .program__body {
    grid-template-columns: 1fr;
  }

  /* Cards */
  .cards-grid {
    grid-template-columns: 1fr;
  }

  /* Hero buttons stack */
  .hero__actions {
    flex-direction: column;
    align-items: center;
  }

  .hero__actions .btn {
    width: 100%;
    max-width: 320px;
  }

  .cta-banner__actions {
    flex-direction: column;
    align-items: center;
  }

  .cta-banner__actions .btn {
    width: 100%;
    max-width: 320px;
  }

  /* Contact info */
  .contact-info {
    grid-template-columns: 1fr;
  }

  /* Pie chart */
  .pie-stage {
    min-height: auto;
  }

  .pie-stage__chart {
    width: 100% !important;
    transform: none !important;
  }

  .pie-chart-container {
    width: 260px;
    height: 260px;
  }

  .pie-stage.activated .pie-chart-container {
    width: 260px;
    height: 260px;
  }

  .pie-chart-legend {
    width: 100%;
    max-width: 400px;
  }

  .pie-stage__detail {
    position: static;
    width: 100%;
    margin-top: 32px;
  }

  /* Glossary tooltip */
  .glossary-tip {
    max-width: min(320px, calc(100vw - 32px));
  }

  /* Footer */
  .footer__grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer__link:hover {
    transform: none;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .btn--lg {
    padding: 15px 30px;
    font-size: 1rem;
  }

  .card {
    padding: 26px 22px;
  }

  .program__header {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .program__cta {
    flex-direction: column;
    align-items: stretch;
  }

  .program__cta .btn {
    width: 100%;
  }

  .glossary-hint {
    font-size: 0.8rem;
    padding: 9px 16px;
  }

  .back-to-top {
    right: 16px;
    bottom: 16px;
  }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* --- Print --- */
@media print {
  .header,
  .footer,
  .cta-banner,
  .nav__toggle,
  .theme-toggle,
  .back-to-top,
  .glossary-tip {
    display: none;
  }

  .collapsible__content {
    max-height: none !important;
    padding: 0 24px 20px !important;
  }
}
