/* ---------- Design tokens ---------- */
  :root {
    --trust-navy: #060818;
    --growth-green: #25D366;
    --success-emerald: #10B981;
    --on-surface: #191c1e;
    --on-surface-variant: #46464c;
    --surface: #f7f9fb;
    --surface-container-low: #f2f4f6;
    --surface-container-lowest: #ffffff;
    --border-subtle: #E2E8F0;
    --outline-variant: #c7c5cd;
    --white: #ffffff;

    --font-body: 'Inter', system-ui, sans-serif;
    --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;

    --container-max: 1280px;
    --gutter-mobile: 20px;
    --gutter-desktop: 40px;

    /* Fluid type scale: clamp(min, preferred, max) so text scales
       smoothly between mobile and laptop instead of snapping at
       fixed breakpoints. */
    --fs-headline-xl: clamp(1.75rem, 1.2rem + 2.5vw, 3rem);   /* 28px -> 48px */
    --fs-headline-lg: clamp(1.5rem, 1.2rem + 1.4vw, 2rem);    /* 24px -> 32px */
    --fs-headline-md: clamp(1.125rem, 1rem + 0.6vw, 1.5rem);  /* 18px -> 24px */
    --fs-body-lg: clamp(1rem, 0.94rem + 0.3vw, 1.125rem);     /* 16px -> 18px */
    --fs-body-md: 1rem;                                       /* 16px */
    --fs-label-md: 0.875rem;                                  /* 14px */
    --fs-label-sm: 0.75rem;                                   /* 12px */
  }

  *, *::before, *::after { box-sizing: border-box; }

  html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

  body {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--fs-body-md);
    line-height: 1.5;
    color: var(--on-surface);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
    padding-top: 72px; /* space for fixed nav */
  }

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

  a { text-decoration: none; }

  button { font-family: inherit; cursor: pointer; }

  .material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    font-family: 'Material Symbols Outlined';
    line-height: 1;
  }

  .container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding-left: var(--gutter-mobile);
    padding-right: var(--gutter-mobile);
  }

  @media (min-width: 768px) {
    .container { padding-left: var(--gutter-desktop); padding-right: var(--gutter-desktop); }
  }

  .visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
  }

  /* Focus visibility for accessibility */
  a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 2px solid var(--growth-green);
    outline-offset: 2px;
  }

  @media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  }

  /* ---------- Top nav ---------- */
  .navbar {
    position: fixed;
    top: 0; left: 0; width: 100%;
    z-index: 50;
    background: var(--surface-container-lowest);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  }

  .navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
  }

  .brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--fs-headline-md);
    color: var(--trust-navy);
    white-space: nowrap;
  }

  .nav-links {
    display: none;
    gap: 2rem;
    align-items: center;
  }

  .nav-links a {
    font-size: var(--fs-label-md);
    font-weight: 600;
    color: var(--on-surface-variant);
    transition: color 0.2s ease;
  }

  .nav-links a:hover { color: var(--growth-green); }

  .nav-links a.active {
    color: var(--growth-green);
    border-bottom: 2px solid var(--growth-green);
    padding-bottom: 4px;
  }

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

  .btn {
    font-size: var(--fs-label-md);
    font-weight: 600;
    border-radius: 9999px;
    padding: 0.6rem 1.25rem;
    border: none;
    transition: opacity 0.2s ease, background-color 0.2s ease;
    white-space: nowrap;
  }

  .btn-outline {
    display: none;
    background: transparent;
    border: 1px solid var(--trust-navy);
    color: var(--trust-navy);
  }
  .btn-outline:hover { background: var(--surface-container-low); }

  .btn-primary {
    background: var(--growth-green);
    color: var(--white);
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  }
  .btn-primary:hover { opacity: 0.9; }

  @media (min-width: 768px) {
    .nav-links { display: flex; }
    .btn-outline { display: inline-block; }
  }

  /* ---------- Hero ---------- */
  .hero {
    padding: 3.5rem 0;
  }

  .hero-inner {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    align-items: center;
  }

  .hero-copy { width: 100%; }

  .badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-emerald);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 9999px;
    padding: 0.35rem 1rem;
    font-size: var(--fs-label-sm);
    font-weight: 500;
  }

  .badge .material-symbols-outlined { font-size: 16px; }

  h1.hero-title {
    font-family: var(--font-display);
    font-size: var(--fs-headline-xl);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--trust-navy);
    margin: 1.25rem 0 1rem;
  }

  .hero-sub {
    font-size: var(--fs-body-lg);
    color: var(--on-surface-variant);
    max-width: 46ch;
  }

  /* Lead-gen form card */
  .lead-form {
    background: var(--surface-container-lowest);
    border: 1px solid var(--border-subtle);
    border-radius: 0.75rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 1.5rem;
    margin-top: 2rem;
  }

  .lead-form h3 {
    font-family: var(--font-display);
    font-size: var(--fs-headline-md);
    color: var(--trust-navy);
    margin: 0 0 1rem;
  }

  .field { margin-bottom: 1rem; }

  .field label {
    display: block;
    font-size: var(--fs-label-sm);
    color: var(--on-surface-variant);
    margin-bottom: 0.35rem;
  }

  .field input {
    width: 100%;
    border: 1px solid var(--outline-variant);
    border-radius: 0.5rem;
    background: var(--surface);
    padding: 0.85rem 1rem;
    font-size: var(--fs-body-md);
    font-family: inherit;
  }

  .field input:focus {
    border-color: var(--trust-navy);
    outline: none;
    box-shadow: 0 0 0 2px rgba(6,8,24,0.08);
  }

  .phone-row { display: flex; }
  .phone-prefix {
    display: inline-flex;
    align-items: center;
    padding: 0 1rem;
    border: 1px solid var(--outline-variant);
    border-right: none;
    border-radius: 0.5rem 0 0 0.5rem;
    background: var(--surface-container-low);
    color: var(--on-surface-variant);
    font-size: var(--fs-body-md);
  }
  .phone-row input { border-radius: 0 0.5rem 0.5rem 0; }

  .submit-btn {
    width: 100%;
    background: var(--growth-green);
    color: var(--white);
    font-size: var(--fs-label-md);
    font-weight: 600;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 8px 30px rgba(37,211,102,0.2);
    margin-top: 0.5rem;
  }
  .submit-btn:hover { opacity: 0.9; }

  .hero-media {
    width: 100%;
    position: relative;
  }

  .hero-media img {
    width: 100%;
    border-radius: 1rem;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
  }

  @media (min-width: 900px) {
    .hero { padding: 5rem 0 6rem; }
    .hero-inner { flex-direction: row; align-items: center; }
    .hero-copy, .hero-media { width: 50%; }
  }

  /* ---------- Lender strip ---------- */
  .lender-strip {
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--surface-container-low);
    padding: 2rem 0;
    text-align: center;
  }

  .lender-strip p {
    font-size: var(--fs-label-sm);
    color: var(--on-surface-variant);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 1.5rem;
  }

  .lender-logos {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 2rem;
    align-items: center;
    justify-content: center;
    opacity: 0.75;
  }

  .lender-logos span {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--fs-headline-md);
    color: var(--trust-navy);
  }

  /* ---------- Section shared ---------- */
  section.page-section { padding: 4rem 0; }

  .section-head { text-align: center; margin-bottom: 3rem; }

  .section-head h2 {
    font-family: var(--font-display);
    font-size: var(--fs-headline-lg);
    color: var(--trust-navy);
    margin: 0 0 0.75rem;
  }

  .section-head p {
    color: var(--on-surface-variant);
    max-width: 46ch;
    margin: 0 auto;
  }

  /* ---------- Feature cards ---------- */
  .feature-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  @media (min-width: 768px) {
    .feature-grid { grid-template-columns: repeat(3, 1fr); }
  }

  .feature-card {
    background: var(--surface-container-lowest);
    border: 1px solid var(--border-subtle);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s ease;
  }
  .feature-card:hover { box-shadow: 0 8px 30px rgba(6,8,24,0.08); }

  .feature-icon {
    width: 48px; height: 48px;
    border-radius: 0.75rem;
    background: rgba(37,211,102,0.1);
    color: var(--growth-green);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1.5rem;
  }

  .feature-card h3 {
    font-family: var(--font-display);
    font-size: var(--fs-headline-md);
    color: var(--trust-navy);
    margin: 0 0 0.75rem;
  }

  .feature-card p { color: var(--on-surface-variant); margin: 0; }

  /* ---------- How it works ---------- */
  .how-it-works { background: var(--surface-container-low); }

  .steps {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
  }

  @media (min-width: 900px) {
    .steps {
      flex-direction: row;
      position: relative;
    }
    .steps::before {
      content: "";
      position: absolute;
      top: 48px; left: 12%; right: 12%;
      height: 1px;
      border-top: 1px dashed var(--border-subtle);
      z-index: 0;
    }
  }

  .step { flex: 1; text-align: center; position: relative; z-index: 1; }

  .step-num {
    width: 96px; height: 96px;
    margin: 0 auto 1.5rem;
    border-radius: 9999px;
    background: var(--surface-container-lowest);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-size: var(--fs-headline-xl);
    color: var(--trust-navy);
  }

  .step h3 {
    font-family: var(--font-display);
    font-size: var(--fs-headline-md);
    color: var(--trust-navy);
    margin: 0 0 0.75rem;
  }

  .step p { color: var(--on-surface-variant); margin: 0; }

  /* ---------- Footer ---------- */
  footer {
    background: var(--trust-navy);
    padding: 4rem var(--gutter-mobile);
    text-align: center;
  }

  .footer-brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--fs-headline-md);
    color: var(--white);
    margin-bottom: 2rem;
  }

  .footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
  }

  .footer-links a {
    color: rgba(224,227,229,0.8);
    font-size: var(--fs-label-sm);
  }
  .footer-links a:hover { color: var(--growth-green); }

  footer .copyright {
    color: var(--surface-container-lowest);
    font-size: var(--fs-body-md);
    max-width: 46ch;
    margin: 0 auto;
  }

  /* ---------- Auth pages (Sign Up / Sign In) ---------- */
  .auth-main {
    min-height: calc(100vh - 72px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
  }

  .auth-wrap {
    width: 100%;
    max-width: 460px;
  }

  .auth-badge-row {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
  }

  .auth-title {
    font-family: var(--font-display);
    font-size: var(--fs-headline-lg);
    color: var(--trust-navy);
    text-align: center;
    margin: 0 0 0.5rem;
  }

  .auth-subtitle {
    text-align: center;
    color: var(--on-surface-variant);
    font-size: var(--fs-body-md);
    margin: 0 0 2rem;
  }

  .auth-card {
    background: var(--surface-container-lowest);
    border: 1px solid var(--border-subtle);
    border-radius: 0.75rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 2rem;
  }

  @media (max-width: 480px) {
    .auth-card { padding: 1.5rem; }
  }

  .field-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  @media (min-width: 480px) {
    .field-row.two-col { grid-template-columns: 1fr 1fr; }
  }

  .input-with-icon {
    position: relative;
  }

  .input-with-icon input {
    padding-right: 2.75rem;
  }

  .input-icon-btn {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--on-surface-variant);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    border-radius: 0.25rem;
  }

  .input-icon-btn:hover { color: var(--trust-navy); }

  .field-hint {
    font-size: var(--fs-label-sm);
    color: var(--on-surface-variant);
    margin-top: 0.35rem;
  }

  .checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin: 1.25rem 0 1.5rem;
  }

  .checkbox-row input[type="checkbox"] {
    margin-top: 0.2rem;
    width: 16px;
    height: 16px;
    accent-color: var(--growth-green);
    flex-shrink: 0;
  }

  .checkbox-row label {
    font-size: var(--fs-label-sm);
    color: var(--on-surface-variant);
    line-height: 1.5;
  }

  .checkbox-row a { color: var(--trust-navy); font-weight: 600; }
  .checkbox-row a:hover { color: var(--growth-green); }

  .divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
  }

  .divider::before, .divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
  }

  .divider span {
    font-size: var(--fs-label-sm);
    color: var(--on-surface-variant);
  }

  .social-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    border: 1px solid var(--outline-variant);
    background: var(--surface-container-lowest);
    color: var(--on-surface);
    font-size: var(--fs-label-md);
    font-weight: 600;
    padding: 0.85rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease;
  }

  .social-btn:hover { background: var(--surface-container-low); }

  .auth-switch {
    text-align: center;
    font-size: var(--fs-body-md);
    color: var(--on-surface-variant);
    margin-top: 1.75rem;
  }

  .auth-switch a {
    color: var(--growth-green);
    font-weight: 600;
  }
  .auth-switch a:hover { text-decoration: underline; }

  .auth-security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 1.5rem;
    color: var(--on-surface-variant);
    font-size: var(--fs-label-sm);
  }

  .auth-security-note .material-symbols-outlined {
    font-size: 16px;
    color: var(--success-emerald);
  }
