:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #18212f;
  --muted: #5f6b7a;
  --primary: #0f5a45;
  --primary-2: #15725a;
  --border: #e6eaf0;
  --shadow: 0 10px 30px rgba(15, 90, 69, 0.08);
  --radius: 18px;
  --max: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

body.has-page-bg {
  background-color: #dfe5ea;
  background-image:
    linear-gradient(rgba(247, 248, 250, 0.48), rgba(247, 248, 250, 0.48)),
    var(--page-bg-image);
  background-repeat: no-repeat, no-repeat;
  background-position: center, center;
  background-size: cover, cover;
  background-attachment: fixed, fixed;
}

body.page-home { --page-bg-image: url("site_images/pmx-sky-neighborhood.jpg"); }
body.page-about { --page-bg-image: url("site_images/pmx-casual-meeting.jpg"); }
body.page-loan-purpose { --page-bg-image: url("site_images/pmx-big-house-key.jpg"); }
body.page-loan-programs { --page-bg-image: url("site_images/pmx-work.jpg"); }
body.page-contact { --page-bg-image: url("site_images/pmx-round-table.jpg"); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
}

header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  background: rgba(247, 248, 250, 0.85);
  border-bottom: 1px solid rgba(230, 234, 240, 0.8);
}

.page-banner {
  display: none;
  padding: 18px 0 8px;
}

.page-banner-shell {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--surface);
}

.page-banner-image {
  width: 100%;
  height: clamp(180px, 28vw, 310px);
  object-fit: cover;
  object-position: center;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 0;
}

.brand-logo {
  width: 300px;
  height: auto;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted);
  font-weight: 600;
  flex-wrap: wrap;
}

.nav-links a:hover,
.nav-links a.active { color: var(--primary); }

.nav-item {
  position: relative;
}

.submenu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 270px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  display: none;
  z-index: 60;
}

.submenu a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.4;
}

.submenu a strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 2px;
}

.submenu a:hover {
  background: rgba(15, 90, 69, 0.08);
  color: var(--primary);
}

.nav-item:hover .submenu,
.nav-item:focus-within .submenu {
  display: block;
}

.section {
  padding: 84px 0;
}

.eyebrow {
  display: inline-block;
  padding: 6px 12px;
  background: rgba(15, 90, 69, 0.1);
  color: var(--primary);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.section-title {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.1;
  margin: 16px 0 12px;
  letter-spacing: -0.02em;
}

.section-copy {
  color: var(--muted);
  max-width: 760px;
  font-size: 17px;
}

.section-copy-strong {
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: 0.25s ease;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow);
}

.btn-primary:hover { background: #0b4635; transform: translateY(-1px); }

.btn-secondary {
  background: white;
  color: var(--primary);
  border-color: var(--border);
}

.btn-secondary:hover { border-color: var(--primary); }

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

.hero-top-label {
  margin-bottom: 16px;
}

.about-top-label {
  margin-bottom: 16px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 36px;
  align-items: stretch;
}

.hero-content-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
  height: 100%;
}

.hero h1 {
  font-size: clamp(40px, 5.8vw, 68px);
  line-height: 1.02;
  margin: 16px 0;
  letter-spacing: -0.035em;
}

.hero p {
  color: var(--muted);
  font-size: 18px;
  max-width: 650px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 28px 0 22px;
}

.hero-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 26px;
}

.point {
  background: var(--surface);
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.point strong {
  display: block;
  font-size: 20px;
  margin-bottom: 2px;
}

.hero-card {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 28px;
  box-shadow: var(--shadow);
  height: 100%;
}

.hero-card h3 {
  margin-top: 0;
  font-size: 24px;
}

.hero-card-image {
  margin: 0 0 16px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.hero-card-image img {
  width: 100%;
  height: auto;
  display: block;
}

.checklist {
  display: grid;
  gap: 12px;
  margin: 22px 0 28px;
}

.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--muted);
}

.check-badge {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(21, 114, 90, 0.15);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
  margin-top: 2px;
}

.grid-2, .grid-3, .grid-4 {
  display: grid;
  gap: 22px;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.card h2 {
  margin-top: 0;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.card p { color: var(--muted); margin: 0; }

.purpose-gallery-section {
  padding-top: 6px;
}

.purpose-gallery-grid {
  gap: 8px;
}

.purpose-gallery-item {
  margin: 10px;
  padding: 0;
  overflow: hidden;
}

.purpose-gallery-item img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
  display: block;
}

.contact-page-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 22px;
  margin-top: 28px;
}

.contact-form-card {
  border-radius: 20px;
}

.contact-form-card h2 {
  font-size: clamp(28px, 3.2vw, 38px);
  margin-bottom: 8px;
}

.contact-form-card .contact-note {
  font-size: 15px;
  margin-bottom: 16px;
  line-height: 1.55;
}

.contact-form-card .contact-note a {
  text-decoration: underline;
  text-underline-offset: 2px;
  color: var(--primary);
}

.contact-utility-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 18px;
}

.contact-utility-links a {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(15, 90, 69, 0.22);
  background: rgba(15, 90, 69, 0.07);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.contact-utility-links a:hover {
  background: rgba(15, 90, 69, 0.12);
}

.contact-form {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-field {
  display: grid;
  gap: 7px;
}

.form-field label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.required-marker {
  color: #b42318;
}

.form-field input,
.form-field textarea {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: #fff !important;
  box-shadow: inset 0 1px 1px rgba(16, 24, 40, 0.04);
}

.form-field textarea {
  resize: vertical;
  min-height: 132px;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: 2px solid rgba(15, 90, 69, 0.18);
  outline-offset: 1px;
  border-color: var(--primary);
}

.honeypot-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.consent-box {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  background: rgba(15, 90, 69, 0.04);
  border: 1px solid rgba(15, 90, 69, 0.16);
  border-radius: 12px;
  padding: 12px;
}

.consent-box input {
  margin-top: 3px;
}

.consent-box a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.contact-details-card p {
  margin-bottom: 14px;
  line-height: 1.5;
}

.contact-form .btn {
  justify-self: start;
}

.contact-form .btn[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
}

.form-status {
  margin: 4px 0 0;
  min-height: 22px;
  font-size: 14px;
  font-weight: 600;
}

.form-status.is-success {
  color: #067647;
}

.form-status.is-error {
  color: #b42318;
}

.contact-details-card a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.contact-office-panel p {
  margin-bottom: 14px;
}

.contact-office-panel strong {
  color: #fff;
}

.contact-office-panel a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.contact-side-image {
  margin: 18px 0 0;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.26);
}

.contact-side-image img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
  display: block;
}

.office-actions {
  margin-top: 18px;
  margin-bottom: 0;
}

.split {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 28px;
  align-items: stretch;
}

.icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(15, 90, 69, 0.1);
  color: var(--primary);
  font-weight: 800;
  margin-bottom: 16px;
}

.accent-panel {
  background: linear-gradient(135deg, var(--primary), #1a7a61);
  color: white;
  border-radius: 28px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.accent-panel p { color: rgba(255, 255, 255, 0.88); }

.license-box {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
}

.cta {
  padding: 40px;
  border-radius: 30px;
  background: linear-gradient(135deg, #0f5a45, #1a7a61);
  color: white;
  box-shadow: var(--shadow);
}

.cta p { color: rgba(255, 255, 255, 0.88); max-width: 720px; }

.cta-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.btn-light {
  background: white;
  color: var(--primary);
}

.btn-outline-light {
  background: transparent;
  color: white;
  border-color: rgba(255, 255, 255, 0.28);
}

footer {
  padding: 34px 0 50px;
  color: #000;
}

.compliance {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
  border-radius: 16px;
  padding: 20px 22px;
  margin-bottom: 18px;
  color: #000;
  box-shadow: 0 6px 22px rgba(16, 24, 40, 0.06);
}

.compliance h4 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 15px;
  letter-spacing: -0.01em;
}

.compliance p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.72;
  color: #000;
}

.compliance p + p {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(24, 33, 47, 0.08);
}

.compliance p:last-child { margin-bottom: 0; }

.compliance-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(24, 33, 47, 0.08);
  font-size: 12px;
  font-weight: 600;
}

.compliance-links a {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 90, 69, 0.18);
  background: rgba(15, 90, 69, 0.06);
  text-decoration: underline;
  text-underline-offset: 2px;
  color: #000;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.ehl-logo {
  width: 88px;
  height: auto;
  opacity: 0.9;
}

.small {
  font-size: 14px;
  color: #000;
}

@media (max-width: 980px) {
  .hero-grid, .split, .grid-4, .grid-3, .grid-2, .contact-page-grid, .form-grid {
    grid-template-columns: 1fr;
  }
  .hero-points { grid-template-columns: 1fr; }
  .nav {
    align-items: center;
    padding: 14px 0;
    flex-wrap: wrap;
  }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    min-height: 44px;
  }
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 10px;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
  }
  .nav-links.is-open { display: flex; }
  .nav-links > a,
  .nav-item > a {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    min-height: 44px;
  }
  .nav-item { width: 100%; }
  .nav-item.open > a {
    background: rgba(15, 90, 69, 0.08);
    color: var(--primary);
  }
  .submenu {
    position: static;
    min-width: 0;
    margin-top: 6px;
    width: 100%;
  }
  .nav-item:hover .submenu,
  .nav-item:focus-within .submenu {
    display: none;
  }
  .nav-item.open .submenu {
    display: block;
  }
  .page-banner {
    padding-top: 14px;
  }
  .page-banner-image {
    height: clamp(165px, 34vw, 240px);
  }
}

@media (max-width: 640px) {
  .section { padding: 64px 0; }
  .hero { padding-top: 42px; }
  .hero-card, .accent-panel, .cta, .card { padding: 22px; }
  .hero-content-panel { padding: 22px; }
  .btn { width: 100%; }
  .hero-actions, .cta-actions { flex-direction: column; }
  .brand-logo { width: 175px; }
  .footer-row,
  .footer-meta {
    flex-direction: column;
    align-items: flex-start;
  }
  .ehl-logo { width: 72px; }
  .compliance p {
    font-size: 12px;
    line-height: 1.7;
  }
  .compliance-links {
    gap: 8px;
  }
  .compliance-links a {
    padding: 5px 9px;
  }
  .page-banner {
    padding-top: 12px;
  }
  .page-banner-image {
    height: 160px;
  }
}
