/* Apex Finance — a demonstration lender's marketing site.
   Deliberately plain CSS: this stands in for a CLIENT's own website, which will
   not be built with our design system, and the point of the demo is that the
   capture works from an ordinary page. */

:root {
  --ink: #0d1424;
  --ink-soft: #4a5568;
  --paper: #ffffff;
  --wash: #f6f8fc;
  --line: #e2e8f2;
  --brand: #11508a;
  --brand-dark: #0d3f6e;
  --brand-wash: #eaf2fb;
  --accent: #0f9d76;
  --danger: #b42318;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(13, 20, 36, 0.06);
  --shadow-md: 0 10px 30px rgba(13, 20, 36, 0.1);
  --gutter: 1rem;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family:
    Inter,
    -apple-system,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}

h1,
h2,
h3 {
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0;
}

/* ── buttons ─────────────────────────────────────────────────────────── */
.btn {
  font: inherit;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.65rem 1.1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* 44px minimum target */
  min-height: 2.75rem;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    opacity 0.15s ease;
}
.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover {
  background: var(--brand-dark);
}
.btn-ghost {
  background: transparent;
  color: var(--brand);
  border-color: var(--line);
}
.btn-ghost:hover {
  background: var(--brand-wash);
}
.btn-lg {
  padding: 0.85rem 1.4rem;
  min-height: 3rem;
}
.btn-block {
  width: 100%;
}
.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}
.btn:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(17, 80, 138, 0.35);
  outline-offset: 2px;
}

/* ── header ──────────────────────────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  gap: var(--gutter);
  padding: 0.85rem var(--gutter);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
}
.brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
}
.brand-name {
  font-weight: 700;
  letter-spacing: -0.01em;
}
.site-nav {
  display: none;
  gap: 1.25rem;
  margin-left: auto;
}
.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
}
.site-nav a:hover {
  color: var(--ink);
}
.site-header .btn {
  margin-left: auto;
}
.site-nav + .btn {
  margin-left: 0;
}

/* ── hero ────────────────────────────────────────────────────────────── */
.hero {
  display: grid;
  gap: 2rem;
  padding: 2.5rem var(--gutter) 2rem;
  max-width: 72rem;
  margin: 0 auto;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand);
  margin: 0 0 0.6rem;
}
.hero h1 {
  font-size: clamp(1.9rem, 6vw, 3.1rem);
}
.lede {
  color: var(--ink-soft);
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  margin: 1rem 0 0;
  max-width: 34em;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.hero-points {
  list-style: none;
  padding: 0;
  margin: 1.75rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.hero-points li::before {
  content: "✓";
  color: var(--accent);
  font-weight: 700;
  margin-right: 0.45rem;
}
.hero-panel {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat {
  background: var(--wash);
  padding: 1.1rem 1.25rem;
}
.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.stat-label {
  display: block;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* ── products ────────────────────────────────────────────────────────── */
.products,
.how {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2.5rem var(--gutter);
}
.products {
  background: var(--wash);
  max-width: none;
}
.products > h2,
.how > h2 {
  font-size: clamp(1.4rem, 4vw, 2rem);
  margin-bottom: 1.5rem;
  max-width: 72rem;
  margin-inline: auto;
}
.product-grid {
  display: grid;
  gap: 1rem;
  max-width: 72rem;
  margin: 0 auto;
}
.product-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.product-card h3 {
  font-size: 1.3rem;
}
.product-card p {
  margin: 0;
  color: var(--ink-soft);
}
.product-facts {
  display: flex;
  gap: 2rem;
  margin: 0;
}
.product-facts div {
  margin: 0;
}
.product-facts dt {
  font-size: 0.8rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.product-facts dd {
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
}
.product-card .btn {
  margin-top: auto;
}

/* ── steps ───────────────────────────────────────────────────────────── */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1.25rem;
}
.steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1rem;
  align-items: start;
}
.step-n {
  grid-row: span 2;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--brand-wash);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-weight: 700;
}
.steps h3 {
  font-size: 1.05rem;
}
.steps p {
  margin: 0;
  color: var(--ink-soft);
}

/* ── footer ──────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem var(--gutter);
  color: var(--ink-soft);
}
.site-footer p {
  margin: 0 0 0.35rem;
  max-width: 72rem;
  margin-inline: auto;
}
.fine {
  font-size: 0.875rem;
}

/* ── modal ───────────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: end center;
}
.modal[hidden] {
  display: none;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 20, 36, 0.55);
}
.modal-card {
  position: relative;
  background: var(--paper);
  width: 100%;
  max-width: 30rem;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 16px 16px 0 0;
  padding: 1.5rem var(--gutter) 1.75rem;
  box-shadow: var(--shadow-md);
}
.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 8px;
}
.modal-close:hover {
  background: var(--wash);
}
.modal-card h2 {
  font-size: 1.4rem;
  padding-right: 2.5rem;
}
.modal-sub {
  color: var(--ink-soft);
  margin: 0.4rem 0 1.25rem;
}

.field {
  margin-bottom: 1rem;
  border: 0;
  padding: 0;
}
.field label,
.field legend {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.4rem;
  padding: 0;
}
.optional {
  font-weight: 400;
  color: var(--ink-soft);
}
.field input[type="text"],
.field input[type="tel"],
.field input[type="email"] {
  width: 100%;
  font: inherit;
  padding: 0.7rem 0.85rem;
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: inherit;
}
.field input[aria-invalid="true"] {
  border-color: var(--danger);
}
.field-row {
  display: grid;
  gap: 0 0.75rem;
  grid-template-columns: 1fr 1fr;
}
.hint {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--danger);
  min-height: 1.1rem;
}
.hint:empty {
  min-height: 0;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.segmented label {
  margin: 0;
}
.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.segmented span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  padding: 0.5rem;
}
.segmented input:checked + span {
  border-color: var(--brand);
  background: var(--brand-wash);
  color: var(--brand);
}
.segmented input:focus-visible + span {
  outline: 3px solid rgba(17, 80, 138, 0.35);
  outline-offset: 2px;
}

.consent {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-bottom: 0.25rem;
}
.consent input {
  margin-top: 0.3rem;
  width: 1.1rem;
  height: 1.1rem;
}

.form-error {
  margin: 0.85rem 0 0;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  background: #fdf0ef;
  color: var(--danger);
  border: 1px solid #f3c9c5;
  font-size: 0.92rem;
}

.success {
  text-align: center;
  padding: 1rem 0 0.5rem;
}
.success-mark {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  margin: 0 auto 1rem;
  background: #e6f6f1;
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 1.6rem;
}
.success p {
  color: var(--ink-soft);
  margin: 0.5rem 0 1.5rem;
}

@media (min-width: 40rem) {
  :root {
    --gutter: 2rem;
  }
  .site-nav {
    display: flex;
  }
  .product-grid {
    grid-template-columns: 1fr 1fr;
  }
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
  .modal {
    place-items: center;
  }
  .modal-card {
    border-radius: 16px;
    padding: 1.75rem 1.75rem 2rem;
  }
}

@media (min-width: 60rem) {
  .hero {
    grid-template-columns: 1.4fr 1fr;
    align-items: center;
    padding-block: 4rem 3.5rem;
  }
  .hero-panel {
    grid-template-columns: 1fr;
  }
}

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