/* ==========================================================================
   Happy Mortgage - single hand-written stylesheet.
   No framework, no CDN assets, no external fonts.

   Compliance-critical rules live in the "SMS consent block" section below.
   Do not add truncation, clamping, max-height, accordions, or reduced
   contrast to anything inside .consent-block: the rendered consent text is
   screenshotted as carrier evidence and must stay fully legible.
   ========================================================================== */

:root {
  --ink: #1b1f24;
  --ink-soft: #3b424a;
  --consent-ink: #2f343a;      /* darker than the #555 floor, on white */
  --brand: #14476b;
  --brand-dark: #0e3350;
  --brand-tint: #eef3f8;
  --surface: #f5f7f9;
  --border: #d3dae1;
  --border-strong: #9aa7b3;
  --error: #a4231f;
  --white: #ffffff;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --maxw: 1120px;
}

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

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

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 18px;
}

a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--white);
  padding: 10px 14px;
  z-index: 10;
}
.skip-link:focus {
  left: 8px;
  top: 8px;
}

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--white);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 66px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.wordmark {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.wordmark-text {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--brand-dark);
}

.header-phone {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-decoration: none;
  line-height: 1.25;
}

.header-phone-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-soft);
}

.header-phone-number {
  font-size: 17px;
  font-weight: 700;
  color: var(--brand);
}

/* ---------- hero ---------- */

.hero {
  background: var(--brand-tint);
  border-bottom: 1px solid var(--border);
  padding: 26px 0 24px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 27px;
  line-height: 1.22;
  letter-spacing: -0.015em;
  color: var(--brand-dark);
}

.hero-subhead {
  margin: 0;
  font-size: 16px;
  color: var(--ink-soft);
  max-width: 62ch;
}

/* ---------- page layout ---------- */

.split {
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 24px 0 40px;
}

/* ---------- value props ---------- */

.value-props h2 {
  margin: 0 0 12px;
  font-size: 19px;
  color: var(--brand-dark);
}

.value-prop-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.value-prop-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}

.value-prop-list h3 {
  margin: 0 0 4px;
  font-size: 16px;
  color: var(--brand-dark);
}

.value-prop-list p {
  margin: 0;
  font-size: 15px;
  color: var(--ink-soft);
}

.value-props-note {
  margin: 14px 0 0;
  font-size: 15px;
  color: var(--ink-soft);
}

/* ---------- form ---------- */

.form-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 18px 24px;
}

.form-panel h2 {
  margin: 0 0 6px;
  font-size: 22px;
  color: var(--brand-dark);
}

.form-intro {
  margin: 0 0 18px;
  font-size: 15px;
  color: var(--ink-soft);
}

.field-row {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.field { margin-bottom: 15px; }

.field label {
  display: block;
  margin-bottom: 5px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.field-optional {
  font-weight: 400;
  color: var(--ink-soft);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field select,
.field textarea {
  width: 100%;
  padding: 11px 12px;
  font-family: inherit;
  font-size: 16px;             /* 16px avoids iOS zoom-on-focus */
  line-height: 1.4;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
}

.field textarea { resize: vertical; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  outline: 2px solid var(--brand);
  outline-offset: 0;
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"] {
  border-color: var(--error);
}

.field-error {
  margin: 5px 0 0;
  font-size: 14px;
  color: var(--error);
}

.error-summary {
  border: 1px solid var(--error);
  border-left-width: 5px;
  background: #fdf4f3;
  border-radius: 6px;
  padding: 12px 14px;
  margin: 0 0 18px;
}

.error-summary-title {
  margin: 0 0 6px;
  font-weight: 700;
  font-size: 15px;
  color: var(--error);
}

.error-summary ul {
  margin: 0;
  padding-left: 20px;
  font-size: 15px;
  color: var(--ink);
}

/* honeypot: off-screen for humans, still present for bots */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.btn-submit {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 15px 20px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  color: var(--white);
  background: var(--brand);
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.btn-submit:hover { background: var(--brand-dark); }

/* ==========================================================================
   SMS consent block - carrier evidence. Full text, always visible.
   ========================================================================== */

.consent-block {
  margin: 22px 0 0;
  padding: 14px 16px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--white);
  /* no max-height, no overflow rules - the text must never be clipped */
}

/* Floating the legend makes it lay out as an ordinary block, so a legend
   that wraps to two lines on a narrow screen cannot collide with the
   fieldset border. */
.consent-legend {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.consent-block > .consent-item:first-of-type { clear: both; }

.consent-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 16px;
}

.consent-item input[type="checkbox"] {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--brand);
  cursor: pointer;
}

.consent-label {
  display: block;
  font-size: 15px;          /* floor is 14px; 15px for headroom */
  line-height: 1.55;        /* normal line height, never condensed */
  color: var(--consent-ink);
  font-weight: 400;
  cursor: pointer;
  /* explicitly NOT truncated: no line-clamp, no ellipsis, no fixed height */
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: break-word;
}

.consent-link {
  color: var(--brand);
  text-decoration: underline;
  font-weight: 600;
}

.consent-optional-notice {
  margin: 4px 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--consent-ink);
  font-weight: 600;
}

/* ---------- document pages ---------- */

.doc {
  padding: 26px 0 44px;
  max-width: 74ch;
}

.doc-narrow { max-width: 66ch; }

.doc h1 {
  margin: 0 0 6px;
  font-size: 28px;
  line-height: 1.25;
  color: var(--brand-dark);
}

.doc h2 {
  margin: 30px 0 8px;
  font-size: 20px;
  color: var(--brand-dark);
}

.doc h3 {
  margin: 20px 0 6px;
  font-size: 17px;
  color: var(--ink);
}

.doc p, .doc li {
  font-size: 16px;
  color: var(--ink-soft);
}

.doc li { margin-bottom: 6px; }

.doc-effective {
  color: var(--ink-soft);
  font-size: 15px;
  margin-top: 0;
}

.doc-callout {
  border-left: 4px solid var(--brand);
  background: var(--brand-tint);
  padding: 14px 16px;
  border-radius: 0 6px 6px 0;
  color: var(--ink) !important;
  font-size: 16px;
  line-height: 1.6;
}

.confirmation .lead {
  font-size: 18px;
  color: var(--ink);
}

.back-link {
  display: inline-block;
  margin-top: 18px;
  font-weight: 600;
  text-decoration: none;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 26px 0 32px;
}

.footer-entity {
  margin: 0 0 4px;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
}

.footer-line {
  margin: 0 0 4px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.footer-eho {
  font-weight: 700;
  color: var(--ink);
  margin-top: 10px;
}

.footer-links {
  margin-top: 10px;
  font-weight: 600;
}

.footer-sep { padding: 0 6px; color: var(--border-strong); }

.footer-copyright {
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}

/* ---------- wider screens ---------- */

@media (min-width: 620px) {
  .container { padding: 0 24px; }
  .hero { padding: 40px 0 36px; }
  .hero h1 { font-size: 34px; }
  .hero-subhead { font-size: 17px; }
  .form-panel { padding: 26px 26px 30px; }
  .field-row {
    flex-direction: row;
    gap: 16px;
  }
  .field-row .field { flex: 1 1 0; }
  .btn-submit { width: auto; min-width: 260px; }
  .doc h1 { font-size: 32px; }
}

@media (min-width: 940px) {
  .hero { padding: 52px 0 46px; }
  .hero h1 { font-size: 40px; }
  .split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    align-items: start;
    gap: 40px;
    padding: 36px 0 56px;
  }
  /* DOM order is form-first so mobile reaches it within one scroll;
     on desktop the value props sit in the left column. */
  .form-panel { order: 2; }
  .value-props { order: 1; }
  .consent-label { font-size: 15px; }
}
