/* Public partner pages. Matches myfamilysignal.com: Fraunces + Plus Jakarta Sans,
   cream #FFF8F1, orange #F5821F, navy #143A57.
   Primary buttons use a darker orange so white text clears WCAG AA. */

:root {
  --orange: #F5821F;
  --orange-deep: #9A4A0A;
  --orange-soft: #FEEDDD;
  --navy: #143A57;
  --navy-deep: #0E2A40;
  --cream: #FFF8F1;
  --ink: #1B2A38;
  --muted: #3E5163;
  --line: #EDE3D8;
  --white: #ffffff;
  --green: #0F6B3C;
  --green-soft: #E7F6EE;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 18px 46px rgba(20, 58, 87, 0.12);
  --maxw: 1160px;
  --font-body: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: Fraunces, Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  font-size: 17px;
}
img { max-width: 100%; display: block; }
a { color: var(--navy); }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--navy);
  line-height: 1.15;
  margin: 0 0 0.45em;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; color: var(--muted); }
.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--navy);
  color: #fff;
  padding: 8px 12px;
  z-index: 100;
}
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--orange-deep); outline-offset: 3px; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 248, 241, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(237, 227, 216, 0.9);
}
.nav { display: flex; align-items: center; justify-content: space-between; min-height: 74px; gap: 12px; }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--navy);
  text-decoration: none;
}
.brand img { width: 40px; height: 40px; }
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 48px;
  background: none;
  border: 0;
  color: var(--navy);
  cursor: pointer;
}
.nav-toggle svg { width: 26px; height: 26px; }
.nav-links {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 74px;
  flex-direction: column;
  gap: 4px;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  padding: 8px 20px 18px;
  box-shadow: var(--shadow);
}
.nav-links.open { display: flex; }
.nav-links a {
  font-weight: 700;
  color: var(--navy);
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 999px;
}
.nav-links a:hover, .nav-links a.active { background: var(--orange-soft); color: var(--orange-deep); }
.nav-cta { text-align: center; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--orange-deep); color: #fff; }
.btn-primary:hover { background: #7C3B08; }
.btn-navy { background: var(--navy); color: #fff; }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.btn[disabled] { opacity: 0.65; cursor: not-allowed; }
.btn.full { width: 100%; }

.hero { padding: 40px 0 16px; }
.hero-stack { display: flex; flex-direction: column; align-items: center; gap: 32px; }
.hero-intro { max-width: 760px; text-align: center; }
.hero-intro h1 { margin-bottom: 0.4em; }
.hero-link { font-size: 0.98rem; }
.hero-link strong { color: var(--navy); }
.form-wrap { width: 100%; max-width: 640px; }
.eyebrow {
  display: inline-flex;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange-deep);
  background: var(--orange-soft);
  padding: 7px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.lead { font-size: 1.12rem; }

section { padding: 28px 0; }
.card, .step, .who, .form, .success, .faq details, .terms {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 4px 18px rgba(20, 58, 87, 0.06);
}
.steps, .who-grid, .split { display: grid; gap: 16px; }
.step, .who { padding: 22px 20px 18px; position: relative; }
.num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--navy);
  color: #fff;
  font-family: var(--font-display);
  margin-bottom: 8px;
}
.step h3, .who h3, .card h3 { font-family: var(--font-body); font-weight: 800; }

.terms { padding: 8px 18px; }
.terms li { margin: 12px 0; color: var(--ink); }
.estimate { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius-sm); overflow: hidden; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.estimate th, .estimate td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.estimate th { color: var(--navy); font-size: 0.82rem; }
.estimate caption { caption-side: bottom; text-align: left; padding: 12px 4px 0; color: var(--muted); font-size: 0.95rem; }

.split { }
.do, .dont { padding: 18px 18px 8px; }
.do h3 { color: var(--green); }
.dont h3 { color: var(--orange-deep); }
ul.clean { margin: 0 0 12px; padding-left: 1.1rem; }
ul.clean li { margin: 0 0 8px; }

.faq details { padding: 4px 18px; margin-bottom: 12px; }
.faq summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--navy);
  padding: 16px 0;
  min-height: 48px;
}
.faq summary:focus-visible { outline-offset: 4px; }

.form, .success { padding: 24px 20px; }
.form { box-shadow: var(--shadow); border-top: 4px solid var(--orange); }
.form-head { padding-bottom: 18px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.form-head h2 { font-size: 1.7rem; margin-bottom: 0.3em; }
.form-head p { margin: 0; font-size: 0.98rem; }
.field { margin-bottom: 18px; }
label, .check { display: block; font-weight: 700; font-size: 0.95rem; color: var(--navy); margin: 0 0 7px; }
.optional {
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--muted);
  background: #F3EEE8;
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 6px;
  vertical-align: 1px;
}
.check { font-weight: 600; display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; }
.check input { margin-top: 4px; width: 18px; height: 18px; min-height: 0; accent-color: var(--orange-deep); flex: none; }
input, select, textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid #D8CDC1;
  border-radius: 10px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: #8A97A3; }
input:hover, select:hover, textarea:hover { border-color: #BFB2A4; }
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23143A57' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--orange-deep);
  box-shadow: 0 0 0 4px rgba(245, 130, 31, 0.18);
}
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: #B3261E; }
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { font-weight: 700; font-size: 0.95rem; color: var(--navy); padding: 0; margin-bottom: 4px; }
.hint, .field-error { font-size: 0.9rem; margin: 6px 0 0; }
.field-error { color: #9D2418; font-weight: 700; }
.field-error:empty { display: none; }
.alert {
  background: #FDE8E6;
  color: #9D2418;
  border: 1px solid #F5C6C1;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 18px;
  font-weight: 600;
}
.success { background: var(--green-soft); border-top: 4px solid var(--green); }
.success h2, .success p { color: var(--green); }
.form-foot { margin-top: 6px; padding-top: 20px; border-top: 1px solid var(--line); }
.captcha {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0 0 16px;
  padding: 12px 14px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.captcha-button { min-height: 44px; padding: 8px 18px; font-weight: 700; }
.captcha-button[aria-pressed="true"] { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.captcha-status { margin: 0; min-height: 0; }
.captcha-status:empty { display: none; }
.form-privacy { font-size: 0.85rem; text-align: center; margin: 14px 0 0; color: var(--muted); }
#us-application .btn, #non-us-note .btn { margin-top: 8px; }

.ref-hero { padding: 40px 0 24px; text-align: center; }
.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(1.8rem, 6vw, 3rem);
  letter-spacing: 0.08em;
  color: var(--navy);
  margin: 8px 0 12px;
  overflow-wrap: anywhere;
}
.store-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 18px; }
.note { font-size: 0.95rem; }

.site-footer { background: var(--navy-deep); color: #C5D4E0; padding: 48px 0 28px; margin-top: 20px; }
.footer-grid { display: grid; gap: 28px; }
.footer-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-family: var(--font-display); font-size: 1.15rem; margin-bottom: 8px; }
.footer-brand img { width: 36px; height: 36px; }
.site-footer p { color: #AFC2D0; }
.footer-col h2 { font-family: var(--font-body); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: #fff; }
.footer-col a { display: block; color: #D5E2EC; text-decoration: none; padding: 6px 0; }
.footer-col a:hover { text-decoration: underline; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.12); margin-top: 28px; padding-top: 16px; color: #9FB3C3; font-size: 0.92rem; }

@media (min-width: 800px) {
  .nav-toggle { display: none; }
  .nav-links {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    background: none;
    border: 0;
    box-shadow: none;
    padding: 0;
    gap: 2px;
  }
  .nav-links a { padding: 8px 12px; }
  .hero { padding: 56px 0 20px; }
  .steps, .who-grid { grid-template-columns: repeat(3, 1fr); }
  .split { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
  .form, .success { padding: 36px 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
