@font-face {
  font-family: "Geist";
  src: url("./assets/Geist-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --midnight: #000000;
  --sky: #addeff;
  --mist: #ceebff;
  --haze: #eff8ff;
  --ink: #101010;
  --muted: #555f66;
  --line: #b8d6e9;
  --line-strong: #83bee4;
  --panel: #ffffff;
  --focus: #004f80;
  --danger: #b42318;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--haze);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(173, 222, 255, 0.45) 0, rgba(239, 248, 255, 0.88) 520px, #ffffff 100%),
    var(--haze);
  font-family: "Geist", Arial, Helvetica, sans-serif;
  font-size: 16px;
  font-weight: 350;
  line-height: 1.55;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(180px, 300px) 1fr auto;
  align-items: center;
  gap: 22px;
  min-height: 88px;
  padding: 18px clamp(20px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand img {
  display: block;
  width: min(220px, 42vw);
  height: auto;
}

.top-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  color: var(--muted);
  font-size: 0.92rem;
}

.top-links a {
  border-bottom: 1px solid transparent;
}

.top-links a:hover {
  border-bottom-color: var(--midnight);
  color: var(--midnight);
}

.save-state {
  justify-self: end;
  padding: 8px 12px;
  color: var(--midnight);
  background: var(--haze);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 520;
  white-space: nowrap;
}

.portal-user {
  justify-self: end;
  min-width: 42px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(260px, 0.88fr);
  gap: clamp(18px, 3vw, 42px);
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(34px, 5vw, 64px) clamp(20px, 4vw, 56px) clamp(22px, 4vw, 42px);
}

.hero-copy {
  max-width: 820px;
}

.eyebrow,
.progress-kicker {
  margin: 0 0 12px;
  color: var(--midnight);
  font-size: 0.76rem;
  font-weight: 720;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 830px;
  margin-bottom: 16px;
  font-size: clamp(2.7rem, 5.7vw, 4.95rem);
  font-weight: 650;
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-copy p:last-child {
  max-width: 720px;
  margin-bottom: 0;
  color: #1f2a30;
  font-size: clamp(1rem, 1.5vw, 1.14rem);
  line-height: 1.5;
}

.hero-metrics {
  display: grid;
  align-self: end;
  gap: 12px;
}

.hero-metrics div {
  min-height: 96px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-metrics span {
  display: block;
  margin-bottom: 5px;
  color: var(--focus);
  font-weight: 720;
}

.hero-metrics strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1.08rem;
  font-weight: 680;
}

.hero-metrics p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(270px, 340px) minmax(0, 1fr);
  gap: clamp(22px, 3vw, 40px);
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 56px) clamp(44px, 6vw, 80px);
}

.sidebar {
  position: sticky;
  top: 112px;
  align-self: start;
  max-height: calc(100vh - 128px);
  overflow: auto;
  padding-bottom: 2px;
}

.progress-block,
.contact-panel,
.intro,
.privacy-panel,
.import-panel,
.field,
.submit-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.progress-block {
  padding: 18px;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.progress-track {
  height: 11px;
  overflow: hidden;
  background: var(--haze);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: var(--midnight);
  transition: width 160ms ease;
}

.contact-panel {
  margin-top: 12px;
  padding: 18px;
  background: var(--midnight);
  color: #ffffff;
  border-color: var(--midnight);
}

.contact-panel p {
  margin-bottom: 10px;
  font-size: 0.96rem;
  font-weight: 540;
}

.contact-panel a {
  color: var(--sky);
  font-size: 0.92rem;
}

nav {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.section-nav {
  margin-top: 14px;
  margin-bottom: 0;
}

.nav-button {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  color: var(--ink);
  text-align: left;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 430;
}

.nav-button:hover {
  border-color: var(--line-strong);
  background: var(--haze);
}

.nav-button[aria-current="step"] {
  color: var(--midnight);
  background: var(--sky);
  border-color: var(--midnight);
  font-weight: 680;
}

.form-shell {
  min-width: 0;
}

.intro {
  margin-bottom: 18px;
  padding: clamp(22px, 4vw, 34px);
}

.status-pill {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 6px 11px;
  color: var(--midnight);
  background: var(--sky);
  border: 1px solid var(--midnight);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 680;
}

.intro h2 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 3.3rem);
  font-weight: 640;
  line-height: 1;
  letter-spacing: 0;
}

.intro p:last-child {
  max-width: 78ch;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.privacy-panel {
  margin-bottom: 12px;
  padding: clamp(18px, 3vw, 24px);
}

.privacy-panel h2 {
  margin-bottom: 10px;
  font-size: 1.25rem;
  font-weight: 680;
}

.privacy-panel p {
  max-width: 82ch;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

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

.import-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
  padding: clamp(18px, 3vw, 24px);
}

.import-panel h2 {
  margin-bottom: 8px;
  font-size: 1.25rem;
  font-weight: 680;
}

.import-panel p {
  max-width: 78ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.file-picker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 18px;
  color: #ffffff;
  background: var(--midnight);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 680;
}

.file-picker:hover {
  background: #2a2a2a;
}

.file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.import-status {
  grid-column: 1 / -1;
  font-weight: 620;
}

#fields {
  display: grid;
  gap: 12px;
}

.field {
  padding: clamp(18px, 3vw, 24px);
}

.field label,
.fieldset-label {
  display: block;
  margin-bottom: 8px;
  font-size: 1.02rem;
  font-weight: 640;
}

.hint {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

input,
select,
textarea {
  width: 100%;
  min-height: 50px;
  padding: 13px 14px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #8cbedd;
  border-radius: 8px;
  font-weight: 360;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--midnight);
}

textarea {
  min-height: 138px;
  resize: vertical;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
  gap: 10px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 50px;
  padding: 11px 13px;
  background: var(--haze);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.choice:hover {
  border-color: var(--midnight);
  background: #ffffff;
}

.choice input {
  flex: 0 0 21px;
  width: 21px;
  min-height: 21px;
  margin: 0;
  accent-color: var(--midnight);
}

.form-actions,
.submit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

button {
  min-height: 48px;
  padding: 11px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 680;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 680;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.primary {
  color: #ffffff;
  background: var(--midnight);
}

.primary:hover {
  background: #2a2a2a;
}

.secondary {
  color: var(--midnight);
  background: #ffffff;
  border-color: var(--midnight);
}

.secondary:hover {
  background: var(--sky);
}

.danger-action {
  color: var(--danger);
  border-color: var(--danger);
}

.danger-action:hover {
  color: #ffffff;
  background: var(--danger);
}

.submit-panel {
  margin-top: 22px;
  padding: clamp(22px, 4vw, 34px);
}

.submit-panel h2 {
  margin-bottom: 10px;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 640;
}

.submit-panel p {
  max-width: 76ch;
  color: var(--muted);
}

.submit-status {
  min-height: 28px;
  margin: 14px 0 0;
  color: var(--midnight);
  font-weight: 620;
}

.technical-preview {
  margin-top: 22px;
  padding: 16px;
  background: var(--haze);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.technical-preview summary {
  cursor: pointer;
  color: var(--midnight);
  font-weight: 680;
}

.technical-preview p {
  margin: 10px 0 14px;
  font-size: 0.95rem;
}

code {
  font-family: "Geist", Arial, Helvetica, sans-serif;
  font-weight: 620;
}

pre {
  max-height: 360px;
  overflow: auto;
  padding: 16px;
  background: var(--midnight);
  color: var(--haze);
  border-radius: 8px;
  font-size: 0.88rem;
  white-space: pre-wrap;
}

.required {
  color: var(--danger);
}

.portal-page {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(34px, 5vw, 64px) clamp(20px, 4vw, 56px) clamp(44px, 6vw, 80px);
}

.portal-hero {
  max-width: 820px;
  margin-bottom: 24px;
}

.portal-hero h1 {
  max-width: 760px;
  margin-bottom: 16px;
  font-size: clamp(2.7rem, 6vw, 5rem);
  font-weight: 650;
  line-height: 0.96;
  letter-spacing: 0;
}

.portal-hero p:last-child {
  max-width: 720px;
  margin-bottom: 0;
  color: #1f2a30;
  font-size: clamp(1rem, 1.5vw, 1.14rem);
}

.portal-panel {
  padding: clamp(22px, 4vw, 34px);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.portal-panel + .portal-panel {
  margin-top: 16px;
}

.portal-panel h2 {
  margin-bottom: 8px;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 640;
  line-height: 1.08;
}

.portal-panel p {
  max-width: 76ch;
  color: var(--muted);
}

.portal-panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.portal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.portal-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.portal-summary div {
  padding: 18px;
  background: var(--haze);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.portal-summary span {
  display: block;
  color: var(--midnight);
  font-size: 2rem;
  font-weight: 680;
  line-height: 1;
}

.portal-summary p {
  margin: 8px 0 0;
  font-size: 0.94rem;
}

.clerk-mount {
  max-width: 480px;
}

.records-list {
  display: grid;
  gap: 10px;
}

.record-row,
.empty-records {
  padding: 18px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.record-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.record-row h3,
.empty-records h3 {
  margin-bottom: 4px;
  font-size: 1.08rem;
  font-weight: 680;
}

.record-row p,
.empty-records p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.record-meta span,
.record-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 640;
}

.record-meta span {
  background: var(--sky);
  border: 1px solid var(--line-strong);
}

.record-link {
  color: #ffffff;
  background: var(--midnight);
}

.matching-page .portal-panel {
  margin-bottom: 16px;
}

.matching-form {
  display: grid;
  gap: 12px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.match-result {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  margin: 18px 0;
  padding: clamp(18px, 3vw, 24px);
  background: var(--haze);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.match-score {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 160px;
  padding: 18px;
  color: var(--midnight);
  background: var(--sky);
  border: 1px solid var(--midnight);
  border-radius: 8px;
}

.match-score span {
  display: block;
  font-size: clamp(3rem, 7vw, 5rem);
  font-weight: 680;
  line-height: 0.9;
}

.match-score p {
  margin: 10px 0 0;
  color: var(--midnight);
  font-weight: 680;
  text-align: center;
}

.match-result h3 {
  margin-bottom: 14px;
  font-size: 1.18rem;
  font-weight: 680;
}

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

.criteria-grid div {
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.criteria-grid strong,
.criteria-grid span {
  display: block;
}

.criteria-grid span {
  margin-top: 3px;
  color: var(--focus);
  font-size: 0.88rem;
  font-weight: 680;
}

.criteria-grid p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.brief-panel {
  margin-bottom: 16px;
  padding: clamp(18px, 3vw, 24px);
  background: var(--haze);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.brief-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.brief-heading h3 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  font-weight: 680;
  line-height: 1.04;
}

.brief-pill {
  flex: 0 0 auto;
  padding: 8px 12px;
  color: var(--midnight);
  background: var(--sky);
  border: 1px solid var(--midnight);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 680;
}

.brief-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.brief-grid div,
.brief-list {
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.brief-grid strong,
.brief-list strong {
  display: block;
  margin-bottom: 6px;
  font-weight: 680;
}

.brief-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.brief-list {
  margin-top: 10px;
}

.brief-list ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.auto-search-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: clamp(18px, 3vw, 24px);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.referral-picker-panel {
  margin-bottom: 16px;
  padding: clamp(18px, 3vw, 24px);
  background: var(--sky);
  border: 1px solid var(--midnight);
  border-radius: 8px;
}

.referral-picker-panel .field {
  margin: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.referral-dropdown-field {
  margin-top: 14px !important;
}

.referral-dropdown-field select {
  opacity: 0.9;
}

.auto-search-panel h3 {
  margin-bottom: 6px;
  font-size: 1.35rem;
  font-weight: 680;
}

.auto-search-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.property-type-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 2px 0 0;
  padding: 0;
  border: 0;
}

.property-type-options legend {
  width: 100%;
  margin-bottom: 2px;
  font-size: 0.98rem;
  font-weight: 680;
}

.property-type-options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  background: var(--haze);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 620;
}

.property-type-options input {
  width: 18px;
  height: 18px;
}

@media (max-width: 1080px) {
  .app-header {
    grid-template-columns: 1fr auto;
  }

  .top-links {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 900px) {
  .app-header {
    position: static;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .save-state {
    justify-self: start;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }

  nav {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }

  .portal-panel-heading,
  .record-row {
    grid-template-columns: 1fr;
  }

  .portal-panel-heading {
    display: grid;
  }

  .record-meta {
    justify-content: flex-start;
  }

  .field-grid,
  .match-result,
  .criteria-grid,
  .brief-grid {
    grid-template-columns: 1fr;
  }

  .brief-heading {
    display: grid;
  }
}

@media (max-width: 640px) {
  .hero {
    padding-top: 0;
  }

  .hero h1 {
    font-size: clamp(2.6rem, 16vw, 4.4rem);
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .form-actions button,
  .submit-actions button {
    width: 100%;
  }

  .import-panel {
    grid-template-columns: 1fr;
  }

  .file-picker {
    width: 100%;
  }

  .portal-summary {
    grid-template-columns: 1fr;
  }

  .portal-actions,
  .portal-actions .button-link,
  .portal-actions button {
    width: 100%;
  }
}

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