:root {
  --primary: #005f56;
  --primary-dark: #00443d;
  --primary-light: #e6f2f0;
  --accent: #f5a623;
  --accent-dark: #d98e0f;
  --ink: #1c2b2a;
  --muted: #5a6b69;
  --surface: #ffffff;
  --bg: #f7faf9;
  --border: #dce6e4;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0, 63, 56, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Demo banner ---------- */
.demo-banner {
  background: var(--ink);
  color: #cfe0de;
  font-size: 0.85rem;
}

.demo-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  flex-wrap: wrap;
}

.demo-banner strong { color: #fff; }
.demo-banner a { color: #fff; }

.btn-tour {
  background: var(--accent);
  color: var(--ink);
  border: none;
  border-radius: 999px;
  padding: 0.35rem 1.1rem;
  font-weight: 600;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.btn-tour:hover { background: var(--accent-dark); }

/* ---------- Guided tour ---------- */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(12, 36, 33, 0.62);
}

.tour-highlight {
  position: relative !important;
  z-index: 10001 !important;
  box-shadow: 0 0 0 4px var(--accent), 0 0 0 100vmax rgba(12, 36, 33, 0.62) !important;
  border-radius: 10px;
}

.tour-card {
  position: absolute;
  z-index: 10002;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  padding: 1.5rem;
  width: min(360px, calc(100vw - 2rem));
}

.tour-card.tour-centered {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.tour-step-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 0.4rem;
}

.tour-card h3 {
  color: var(--primary-dark);
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.tour-card p {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.tour-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tour-actions .btn {
  padding: 0.5rem 1.1rem;
  font-size: 0.85rem;
}

.tour-skip {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
}

/* ---------- Powered by ---------- */
.powered-by {
  margin-top: 1.5rem;
  font-size: 0.9rem;
}

.powered-by a { font-weight: 700; }

/* ---------- Header ---------- */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
}

.logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.logo-text strong {
  display: block;
  font-size: 1.1rem;
  line-height: 1.2;
}

.logo-text span {
  font-size: 0.75rem;
  color: var(--muted);
}

nav ul {
  display: flex;
  gap: 1.4rem;
  list-style: none;
  align-items: center;
  flex-wrap: wrap;
}

nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.95rem;
}

nav a:hover { color: var(--primary); }

nav a.active {
  color: var(--primary);
  font-weight: 700;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s ease, color 0.15s ease;
  border: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-accent {
  background: var(--accent);
  color: var(--ink);
}
.btn-accent:hover { background: var(--accent-dark); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 4.5rem 0 5rem;
}

.hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  line-height: 1.15;
  margin-bottom: 1rem;
  max-width: 22ch;
}

.hero p {
  font-size: 1.15rem;
  max-width: 55ch;
  opacity: 0.92;
  margin-bottom: 2rem;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero .btn-outline {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.7);
}
.hero .btn-outline:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #fff;
  color: #fff;
}

/* ---------- Page hero (subpages) ---------- */
.page-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 3rem 0;
}

.page-hero h1 {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1.15;
  margin-bottom: 0.6rem;
}

.page-hero p {
  font-size: 1.1rem;
  max-width: 60ch;
  opacity: 0.92;
}

.page-hero .eyebrow { color: var(--accent); }

/* ---------- Sections ---------- */
section { padding: 4rem 0; }

.section-heading {
  text-align: center;
  max-width: 60ch;
  margin: 0 auto 2.5rem;
}

.section-heading h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin-bottom: 0.6rem;
  color: var(--primary-dark);
}

.section-heading p {
  color: var(--muted);
  font-size: 1.05rem;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 0.5rem;
}

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.6rem;
  color: var(--primary-dark);
}

.card p {
  color: var(--muted);
  flex-grow: 1;
  margin-bottom: 1.5rem;
}

.card .btn { align-self: flex-start; }

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 1.1rem;
}

.card .product-meta {
  list-style: none;
  margin-bottom: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  font-size: 0.9rem;
}

.card .product-meta li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.25rem 0;
}

.card .product-meta li span:first-child { color: var(--muted); }
.card .product-meta li span:last-child { font-weight: 600; }

/* ---------- Join / highlight band ---------- */
.join-band {
  background: var(--primary-light);
}

.join-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
  align-items: center;
}

.join-inner h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  color: var(--primary-dark);
  margin-bottom: 0.75rem;
}

.join-inner > div > p {
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.join-benefits {
  list-style: none;
  margin-bottom: 2rem;
}

.join-benefits li {
  padding-left: 1.8rem;
  position: relative;
  margin-bottom: 0.6rem;
}

.join-benefits li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 700;
}

.join-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.25rem 2rem;
  text-align: center;
}

.join-panel h3 {
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
}

.join-panel p {
  color: var(--muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

/* ---------- Loan calculator ---------- */
.calculator-frame {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  overflow: hidden;
  max-width: 880px;
  margin: 0 auto;
}

.calculator-frame iframe {
  border: 0;
  display: block;
  width: 100%;
  /* Sized to the calculator's content; overridden live if the embed
     posts its real height. Overflow degrades to a scrollbar. */
  height: 475px;
}

@media (max-width: 700px) {
  .calculator-frame iframe { height: 688px; }
}

/* Home page embed: 40% narrower than the default frame */
.calculator-frame.calc-tall { max-width: 528px; }

.calculator-frame.calc-tall iframe { height: 475px; }

@media (max-width: 700px) {
  .calculator-frame.calc-tall iframe { height: 693px; }
}

/* Nested inside an apply-card: drop the standalone card chrome */
.calculator-frame.embedded {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  max-width: none;
}

/* ---------- Side-by-side apply section ---------- */
.apply-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.5rem;
  align-items: stretch;
}

.apply-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
}

.apply-card h3 {
  color: var(--primary-dark);
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
}

.apply-card > p {
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.apply-card.member-panel {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  border-top: 4px solid var(--accent);
  color: #fff;
  display: flex;
  flex-direction: column;
}

.member-panel .eyebrow { color: var(--accent); }
.member-panel h3 { color: #fff; }
.member-panel > p { color: rgba(255, 255, 255, 0.9); }

.member-panel .join-benefits { margin-bottom: 1.75rem; }
.member-panel .join-benefits li::before { color: var(--accent); }

.member-panel .panel-note {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  padding-top: 1rem;
  margin-bottom: 1.5rem;
}

.member-panel .panel-note a {
  color: var(--accent);
  font-weight: 600;
}

.member-panel .btn { align-self: flex-start; margin-top: auto; }

@media (max-width: 900px) {
  .apply-grid { grid-template-columns: 1fr; }
}

.calc-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  color: var(--muted);
  padding: 3rem 1rem;
  font-size: 0.95rem;
}

.calc-loading::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: calc-spin 0.8s linear infinite;
}

@keyframes calc-spin {
  to { transform: rotate(360deg); }
}

.calc-note {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 1.25rem;
}
/* ---------- Quick loan / CTA band ---------- */
.quick-loan {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  text-align: center;
}

.quick-loan h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin-bottom: 0.75rem;
}

.quick-loan p {
  max-width: 60ch;
  margin: 0 auto 2rem;
  opacity: 0.92;
  font-size: 1.05rem;
}

/* ---------- Rates table ---------- */
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

table.rates {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  min-width: 560px;
}

table.rates th,
table.rates td {
  text-align: left;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

table.rates th {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

table.rates tr:last-child td { border-bottom: 0; }

table.rates tbody tr:nth-child(even) { background: var(--bg); }

/* ---------- Prose (about page etc.) ---------- */
.prose {
  max-width: 70ch;
  margin: 0 auto;
}

.prose h2 {
  color: var(--primary-dark);
  font-size: 1.5rem;
  margin: 2rem 0 0.75rem;
}

.prose h2:first-child { margin-top: 0; }

.prose p { margin-bottom: 1rem; color: var(--ink); }

.prose ul {
  margin: 0 0 1rem 1.4rem;
}

.prose li { margin-bottom: 0.4rem; }

/* ---------- Stats ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  text-align: center;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem 1rem;
}

.stat strong {
  display: block;
  font-size: 2rem;
  color: var(--primary);
  line-height: 1.2;
}

.stat span {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- People ---------- */
.person .card-icon {
  border-radius: 50%;
  font-size: 1.4rem;
}

.person .role {
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}

.person p { margin-bottom: 0; }

/* ---------- FAQs ---------- */
.faq-group { max-width: 780px; margin: 0 auto 2.5rem; }

.faq-group h2 {
  color: var(--primary-dark);
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

details.faq {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

details.faq summary {
  cursor: pointer;
  padding: 1rem 1.25rem;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

details.faq summary::-webkit-details-marker { display: none; }

details.faq summary::after {
  content: "+";
  font-size: 1.4rem;
  color: var(--primary);
  line-height: 1;
  flex-shrink: 0;
}

details.faq[open] summary::after { content: "-"; }

details.faq .faq-body {
  padding: 0 1.25rem 1.1rem;
  color: var(--muted);
}

details.faq .faq-body p { margin-bottom: 0.6rem; }
details.faq .faq-body p:last-child { margin-bottom: 0; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2.5rem;
  align-items: start;
}

.contact-details {
  display: grid;
  gap: 1.25rem;
}

.contact-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.5rem;
}

.contact-block h3 {
  color: var(--primary-dark);
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contact-block p, .contact-block address {
  color: var(--muted);
  font-style: normal;
  font-size: 0.95rem;
}

.contact-block a { color: var(--primary); font-weight: 600; }

table.hours {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  color: var(--muted);
}

table.hours td { padding: 0.25rem 0; }
table.hours td:last-child { text-align: right; }

/* ---------- Form ---------- */
.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
}

.contact-form h2 {
  color: var(--primary-dark);
  font-size: 1.35rem;
  margin-bottom: 0.4rem;
}

.contact-form > p {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.form-row { margin-bottom: 1.1rem; }

.form-row label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--ink);
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.form-success {
  display: none;
  background: var(--primary-light);
  border: 1px solid var(--primary);
  color: var(--primary-dark);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  font-weight: 600;
}

/* ---------- Footer ---------- */
footer {
  background: var(--ink);
  color: #cfe0de;
  padding: 2.5rem 0;
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

footer a { color: #fff; }

.footer-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

.footer-legal {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  opacity: 0.7;
  max-width: 80ch;
}

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
  .join-inner { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .header-inner { justify-content: center; }
}
