/* ============================================================
   THEOS INFRASTRUCTURE GROUP — HOUSING NETWORK
   Shared stylesheet for index.html + referral.html
   Brand: deep navy / near-black base, gold accents, geometric sans
   Mobile-first: base styles target small screens; media queries
   scale layouts up at 640px and 960px.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --navy-950: #0a0e18;      /* page background */
  --navy-900: #0f1524;      /* section alt background */
  --navy-800: #161f33;      /* card background */
  --navy-700: #1f2a44;      /* borders / dividers */
  --gold: #c9a44c;          /* primary accent */
  --gold-light: #e0c274;    /* hover / highlights */
  --ink: #eef1f7;           /* primary text */
  --ink-muted: #9aa4b8;     /* secondary text */
  --steel: #6b7a94;         /* logo building tone */
  --success: #3ecf8e;
  --error: #ff6b6b;
  --radius: 12px;
  --font-head: 'Montserrat', 'Segoe UI', Arial, sans-serif;
  --font-body: 'Inter', 'Segoe UI', Arial, sans-serif;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--navy-950);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

a { color: var(--gold-light); text-decoration: none; }
a:hover { color: var(--gold); }

.container { width: min(1120px, 92%); margin-inline: auto; }

/* Section label — small gold uppercase kicker above headings */
.kicker {
  display: block;
  color: var(--gold);
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

section { padding: 4.5rem 0; }
.section-alt { background: var(--navy-900); }

.section-head { max-width: 640px; margin-bottom: 2.5rem; }
.section-head h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: 0.75rem; }
.section-head p { color: var(--ink-muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.9rem 1.8rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  text-align: center;
}
.btn:active { transform: translateY(1px); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold), #b8933f);
  color: #14100a;
}
.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #14100a;
  box-shadow: 0 6px 24px rgba(201, 164, 76, 0.35);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--navy-700);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold-light); transform: translateY(-2px); }

/* ---------- Sticky navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 24, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--navy-700);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  gap: 1rem;
}
.nav-brand { display: flex; align-items: center; gap: 0.65rem; color: var(--ink); }
.nav-brand svg { width: 34px; height: 38px; }
.nav-brand .brand-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.22em;
}
.nav-brand .brand-sub {
  display: block;
  font-size: 0.58rem;
  letter-spacing: 0.3em;
  color: var(--ink-muted);
  font-weight: 500;
}
.nav-links { display: none; list-style: none; gap: 1.6rem; align-items: center; }
.nav-links a {
  color: var(--ink-muted);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.nav-links a:hover { color: var(--gold-light); }
.nav .btn { padding: 0.6rem 1.1rem; font-size: 0.75rem; }

@media (min-width: 960px) {
  .nav-links { display: flex; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 5.5rem 0 6rem;
  text-align: center;
  overflow: hidden;
  /* subtle blueprint-grid texture echoing the logo card */
  background-image:
    linear-gradient(rgba(31, 42, 68, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 42, 68, 0.35) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 0%, rgba(201, 164, 76, 0.08), transparent 60%);
  background-size: 56px 56px, 56px 56px, 100% 100%;
}
.hero-logo { width: 120px; margin: 0 auto 2rem; }
.hero h1 {
  font-size: clamp(2rem, 6vw, 3.4rem);
  letter-spacing: 0.05em;
  margin-bottom: 1.1rem;
}
.hero h1 .gold { color: var(--gold); }
.hero-tag {
  color: var(--ink-muted);
  max-width: 620px;
  margin: 0 auto 2.4rem;
  font-size: clamp(1rem, 2.2vw, 1.15rem);
}
.hero-ctas { display: flex; flex-direction: column; gap: 0.9rem; align-items: center; }
@media (min-width: 640px) {
  .hero-ctas { flex-direction: row; justify-content: center; }
}

/* ---------- Partner strip (Who we serve) ---------- */
.partner-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}
.partner {
  background: var(--navy-800);
  border: 1px solid var(--navy-700);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  font-size: 0.92rem;
  color: var(--ink-muted);
}
.partner strong { color: var(--ink); display: block; margin-bottom: 0.15rem; font-family: var(--font-head); font-size: 0.9rem; letter-spacing: 0.04em; }
.partner strong a { color: var(--ink); }
.partner strong a:hover { color: var(--gold-light); }
/* auto-fit keeps the strip balanced at any partner count */
@media (min-width: 640px) { .partner-strip { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }

/* ---------- Suite cards ---------- */
.suite-grid { display: grid; grid-template-columns: 1fr; gap: 1.3rem; }
@media (min-width: 640px) { .suite-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .suite-grid { grid-template-columns: repeat(4, 1fr); } }

.suite-card {
  background: var(--navy-800);
  border: 1px solid var(--navy-700);
  border-radius: var(--radius);
  padding: 1.7rem 1.5rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.suite-card:hover {
  transform: translateY(-6px);
  border-color: var(--gold);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}
.suite-card h3 { font-size: 1.05rem; letter-spacing: 0.1em; text-transform: uppercase; }
.suite-price {
  font-family: var(--font-head);
  color: var(--gold-light);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.7rem 0 0.2rem;
}
.suite-price span { font-size: 0.8rem; color: var(--ink-muted); font-weight: 500; }
.suite-card ul { list-style: none; margin-top: 1rem; flex: 1; }
.suite-card li {
  color: var(--ink-muted);
  font-size: 0.9rem;
  padding: 0.35rem 0 0.35rem 1.3rem;
  position: relative;
}
.suite-card li::before { content: "◆"; position: absolute; left: 0; color: var(--gold); font-size: 0.6rem; top: 0.65rem; }
.suite-badge {
  align-self: flex-start;
  font-size: 0.62rem;
  font-family: var(--font-head);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #14100a;
  background: var(--gold);
  border-radius: 99px;
  padding: 0.25rem 0.7rem;
  margin-bottom: 0.9rem;
}

/* ---------- Features grid ---------- */
.feature-grid { display: grid; grid-template-columns: 1fr; gap: 1.3rem; }
@media (min-width: 640px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .feature-grid { grid-template-columns: repeat(4, 1fr); } }

.feature {
  background: var(--navy-800);
  border: 1px solid var(--navy-700);
  border-radius: var(--radius);
  padding: 1.6rem 1.4rem;
}
.feature-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 1px solid var(--gold);
  border-radius: 10px;
  color: var(--gold);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}
.feature h3 { font-size: 0.98rem; margin-bottom: 0.45rem; }
.feature p { color: var(--ink-muted); font-size: 0.9rem; }

/* ---------- Referral steps ---------- */
.steps { display: grid; grid-template-columns: 1fr; gap: 1.3rem; counter-reset: step; }
@media (min-width: 960px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step {
  background: var(--navy-800);
  border: 1px solid var(--navy-700);
  border-radius: var(--radius);
  padding: 1.8rem 1.5rem;
  position: relative;
}
.step-num {
  font-family: var(--font-head);
  font-size: 2.4rem;
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 1px var(--gold);
  line-height: 1;
  margin-bottom: 0.9rem;
}
.step h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.step p { color: var(--ink-muted); font-size: 0.9rem; }

/* ---------- Terms list ---------- */
.terms { display: grid; grid-template-columns: 1fr; gap: 1rem; max-width: 780px; }
.term {
  display: flex; gap: 1rem;
  background: var(--navy-800);
  border: 1px solid var(--navy-700);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
}
.term-check { color: var(--gold); font-size: 1.1rem; line-height: 1.5; }
.term strong { display: block; font-family: var(--font-head); font-size: 0.92rem; margin-bottom: 0.2rem; }
.term p { color: var(--ink-muted); font-size: 0.9rem; }

/* ---------- Vision / ecosystem section ---------- */
.vision-quote {
  position: relative;
  max-width: 820px;
  margin: 0 0 3rem;
  padding: 1.8rem 2rem 1.8rem 2.6rem;
  background: var(--navy-800);
  border: 1px solid var(--navy-700);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  font-weight: 500;
  line-height: 1.6;
  color: var(--gold-light);
}
.vision-subhead {
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 1.4rem;
}
.pillar-grid { display: grid; grid-template-columns: 1fr; gap: 1.3rem; margin-bottom: 3rem; }
@media (min-width: 960px) { .pillar-grid { grid-template-columns: repeat(3, 1fr); } }
.pillar {
  background: var(--navy-800);
  border: 1px solid var(--navy-700);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 1.8rem 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pillar:hover { transform: translateY(-5px); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45); }
.pillar-tag {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(201, 164, 76, 0.45);
  border-radius: 99px;
  padding: 0.3rem 0.75rem;
  margin-bottom: 1rem;
}
.pillar h3 { font-size: 1.05rem; margin-bottom: 0.6rem; }
.pillar p { color: var(--ink-muted); font-size: 0.92rem; }

/* ---------- CTA band ---------- */
.cta-band {
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(201, 164, 76, 0.14), transparent 65%),
    var(--navy-900);
  border-block: 1px solid var(--navy-700);
}
.cta-band h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); margin-bottom: 0.8rem; }
.cta-band p { color: var(--ink-muted); max-width: 560px; margin: 0 auto 2rem; }

/* ---------- Footer ---------- */
.footer { padding: 3rem 0 2.2rem; border-top: 1px solid var(--navy-700); }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; margin-bottom: 2.2rem; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer h4 {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.9rem;
}
.footer p, .footer li, .footer a { color: var(--ink-muted); font-size: 0.9rem; }
.footer ul { list-style: none; }
.footer li { padding: 0.22rem 0; }
.footer a:hover { color: var(--gold-light); }
.footer-bottom {
  border-top: 1px solid var(--navy-700);
  padding-top: 1.4rem;
  font-size: 0.78rem;
  color: var(--steel);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
}

/* ---------- Scroll reveal (used by script.js IntersectionObserver) ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   REFERRAL FORM PAGE
   ============================================================ */
.form-page-head { padding: 3.5rem 0 1rem; }
.form-page-head h1 { font-size: clamp(1.7rem, 5vw, 2.5rem); margin-bottom: 0.8rem; }
.form-page-head p { color: var(--ink-muted); max-width: 680px; }
.form-page-head .back-link { display: inline-block; margin-bottom: 1.6rem; font-size: 0.85rem; }

.referral-form { padding: 1.5rem 0 5rem; }

.form-section {
  background: var(--navy-800);
  border: 1px solid var(--navy-700);
  border-radius: var(--radius);
  padding: 1.8rem 1.5rem;
  margin-bottom: 1.4rem;
}
@media (min-width: 640px) { .form-section { padding: 2.2rem 2.2rem; } }

.form-section > h2 {
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-light);
  padding-bottom: 0.9rem;
  margin-bottom: 1.4rem;
  border-bottom: 1px solid var(--navy-700);
}
.form-section > h2 .sec-num { color: var(--gold); margin-right: 0.5rem; }
.form-hint { color: var(--ink-muted); font-size: 0.88rem; margin: -0.6rem 0 1.2rem; }

.field-row { display: grid; grid-template-columns: 1fr; gap: 1.1rem; margin-bottom: 1.1rem; }
@media (min-width: 640px) {
  .field-row.cols-2 { grid-template-columns: 1fr 1fr; }
  .field-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
}

.field label {
  display: block;
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 0.45rem;
}
.req { color: var(--gold); }

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="date"],
.field select,
.field textarea {
  width: 100%;
  background: var(--navy-950);
  color: var(--ink);
  border: 1px solid var(--navy-700);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  color-scheme: dark; /* dark-styled native date pickers */
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 164, 76, 0.18);
}
.field textarea { min-height: 110px; resize: vertical; }

/* invalid state applied by script.js */
.field .invalid { border-color: var(--error) !important; }
.field-error { color: var(--error); font-size: 0.78rem; margin-top: 0.35rem; display: none; }
.field.has-error .field-error { display: block; }

/* Radio / checkbox pill groups */
.choice-group { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.choice {
  position: relative;
}
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice span {
  display: inline-block;
  border: 1px solid var(--navy-700);
  background: var(--navy-950);
  color: var(--ink-muted);
  border-radius: 99px;
  padding: 0.5rem 1.05rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.choice input:checked + span {
  border-color: var(--gold);
  background: rgba(201, 164, 76, 0.12);
  color: var(--gold-light);
  font-weight: 600;
}
.choice input:focus-visible + span { box-shadow: 0 0 0 3px rgba(201, 164, 76, 0.25); }

/* Yes/No screening rows */
.screen-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--navy-700);
}
.screen-row:last-of-type { border-bottom: none; }
.screen-row .screen-label { font-size: 0.92rem; }

/* Submit area + status messages */
.form-actions { text-align: center; margin-top: 2rem; }
.form-actions .btn { width: 100%; }
@media (min-width: 640px) { .form-actions .btn { width: auto; min-width: 320px; } }

.form-status {
  display: none;
  margin-top: 1.3rem;
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  font-size: 0.95rem;
  text-align: left;
}
.form-status.success {
  display: block;
  background: rgba(62, 207, 142, 0.1);
  border: 1px solid var(--success);
  color: #b8f4dc;
}
.form-status.error {
  display: block;
  background: rgba(255, 107, 107, 0.08);
  border: 1px solid var(--error);
  color: #ffc9c9;
}

/* Spinner shown inside the submit button while sending */
.btn .spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(20, 16, 10, 0.35);
  border-top-color: #14100a;
  border-radius: 50%;
  margin-right: 0.5rem;
  vertical-align: -2px;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
