:root {
  --ink: #1e2a38;
  --muted: #6b7280;
  --soft: #f7f9fc;
  --panel: #ffffff;
  --line: #e6ebf1;
  --primary: #1e2a38;
  --blue: #3a86ff;
  --grey: #adb5bd;
  --green: #2ecc71;
  --green-soft: #eafaf1;
  --orange: #ff9f1c;
  --red: #dc4e41;
  --shadow: 0 24px 70px rgba(30, 42, 56, 0.14);
  --small-shadow: 0 12px 34px rgba(30, 42, 56, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 12px clamp(18px, 4vw, 56px);
  background: rgba(247, 249, 252, 0.9);
  border-bottom: 1px solid rgba(230, 235, 241, 0.95);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
}

.nav-links {
  display: flex;
  gap: 26px;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
  text-decoration: none;
}

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

.ghost-button,
.primary-button,
.filter-chip,
.social-button,
.close-button,
.secondary-button {
  border-radius: 8px;
  font-weight: 800;
}

.ghost-button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--primary);
}

.primary-button {
  min-height: 54px;
  padding: 0 22px;
  border: 0;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 12px 24px rgba(58, 134, 255, 0.28);
}

.compact-button {
  min-height: 42px;
  padding: 0 16px;
  box-shadow: none;
}

.primary-button:hover,
.ghost-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

.hero {
  position: relative;
  display: grid;
  min-height: 620px;
  overflow: hidden;
  isolation: isolate;
}

.hero-media,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-media {
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(30, 42, 56, 0.72), rgba(30, 42, 56, 0.82)),
    url("https://images.unsplash.com/photo-1449965408869-eaa3f722e40d?auto=format&fit=crop&w=1800&q=82") center / cover;
  filter: saturate(0.65) contrast(0.92);
  transform: scale(1.01);
}

.hero-overlay {
  z-index: -1;
  background: linear-gradient(0deg, var(--soft) 0%, rgba(247, 249, 252, 0) 22%);
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(980px, 100%);
  margin: 0 auto;
  padding: clamp(42px, 7vw, 86px) clamp(18px, 4vw, 56px) 96px;
  color: #fff;
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--orange);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: clamp(2.7rem, 5.6vw, 5.3rem);
  line-height: 1;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 560px;
  margin-bottom: 30px;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1.03rem, 1.8vw, 1.22rem);
  line-height: 1.6;
}

.search-panel {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr 0.9fr auto;
  gap: 12px;
  width: min(900px, 100%);
  padding: 14px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-top: 4px solid var(--blue);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-title {
  display: none;
}

.input-group {
  display: grid;
  gap: 7px;
}

.input-group label,
.email-form label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.input-shell,
select,
.email-form input {
  display: flex;
  align-items: center;
  min-height: 54px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.input-shell {
  gap: 10px;
  padding: 0 14px;
}

.input-shell span {
  color: var(--blue);
  font-size: 0.74rem;
  font-weight: 900;
}

input,
select {
  color: var(--ink);
}

.input-shell input {
  width: 100%;
  border: 0;
  outline: 0;
}

select {
  padding: 0 12px;
}

.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 24px clamp(18px, 4vw, 56px) 10px;
}

.filter-chip {
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.filter-chip.is-active {
  border-color: var(--green);
  background: var(--green-soft);
  color: #1f8f51;
}

.results-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 22px;
  padding: 24px clamp(18px, 4vw, 56px) 68px;
}

.refine-panel,
.result-card,
.workflow-grid article,
.dashboard-preview,
.auth-modal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.refine-panel {
  position: sticky;
  top: 92px;
  align-self: start;
  display: grid;
  gap: 15px;
  padding: 18px;
  box-shadow: var(--small-shadow);
}

.refine-panel h2 {
  margin-bottom: 2px;
  font-size: 1.1rem;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.range-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 700;
}

#distanceRange {
  accent-color: var(--blue);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.65rem, 3vw, 2.3rem);
  line-height: 1.05;
}

.section-heading > p {
  margin-bottom: 4px;
  color: var(--muted);
  font-weight: 800;
}

.result-list {
  display: grid;
  gap: 14px;
}

.result-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 18px;
  border-top: 4px solid var(--primary);
  box-shadow: var(--small-shadow);
}

.profile-top {
  display: flex;
  gap: 14px;
}

.avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background: #edf4ff;
  color: var(--blue);
  font-weight: 900;
}

.profile-title h3 {
  margin-bottom: 5px;
  font-size: 1.12rem;
}

.profile-title p,
.result-meta,
.profile-copy {
  color: var(--muted);
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pill {
  padding: 6px 9px;
  border-radius: 8px;
  background: #eef4ff;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 800;
}

.profile-copy {
  margin: 12px 0 0;
  line-height: 1.55;
}

.card-actions {
  display: grid;
  align-content: center;
  gap: 10px;
  min-width: 172px;
}

.secondary-button {
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.rating {
  color: #1f8f51;
  font-weight: 900;
}

.workflow-band,
.school-panel {
  padding: 64px clamp(18px, 4vw, 56px);
}

.workflow-band {
  background: var(--primary);
  color: #fff;
}

.workflow-band .section-heading {
  max-width: 760px;
}

.compact {
  align-items: start;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.workflow-grid article {
  padding: 24px;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
}

.workflow-grid span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 22px;
  border-radius: 8px;
  background: var(--green);
  color: #0c3b21;
  font-weight: 900;
}

.workflow-grid p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.6;
}

.school-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.7fr);
  gap: 36px;
  align-items: center;
}

.school-panel .eyebrow {
  color: var(--blue);
}

.school-panel p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.section-action {
  margin-top: 6px;
}

.dashboard-preview {
  padding: 18px;
  box-shadow: var(--shadow);
}

.dashboard-top,
.mini-table div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-top {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 900;
}

.mini-table {
  display: grid;
  gap: 10px;
  padding-top: 14px;
}

.mini-table div {
  padding: 13px;
  border-radius: 8px;
  background: var(--soft);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17, 24, 39, 0.58);
}

.modal-backdrop[hidden] {
  display: none;
}

.auth-modal {
  position: relative;
  width: min(560px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  padding: 28px;
  box-shadow: var(--shadow);
}

.auth-modal .eyebrow {
  color: var(--blue);
}

.auth-modal p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.6;
}

.role-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0 8px;
}

.role-card {
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.role-card strong,
.role-card span {
  display: block;
}

.role-card strong {
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 0.98rem;
}

.role-card span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.45;
}

.role-card.is-active {
  border-color: var(--blue);
  background: #eef4ff;
  box-shadow: inset 0 0 0 1px rgba(58, 134, 255, 0.18);
}

.close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  background: var(--soft);
  color: var(--muted);
  font-size: 1rem;
}

.social-button {
  width: 100%;
  min-height: 48px;
  margin-top: 10px;
  border: 0;
  color: #fff;
}

.google {
  background: var(--red);
}

.facebook {
  background: var(--blue);
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin: 18px 0;
  color: var(--muted);
  font-weight: 800;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.email-form {
  display: grid;
  gap: 9px;
}

.email-form input {
  padding: 0 14px;
}

.otp-panel {
  display: grid;
  gap: 9px;
  padding-top: 4px;
}

.otp-panel[hidden] {
  display: none;
}

.form-message {
  min-height: 22px;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.form-message.success {
  color: #1f8f51;
}

.form-message.error {
  color: #b45309;
}

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

  .hero {
    min-height: 620px;
  }

  .hero-content {
    padding-top: 54px;
  }

  .search-panel,
  .results-layout,
  .workflow-grid,
  .school-panel {
    grid-template-columns: 1fr;
  }

  .search-title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 2px;
    color: var(--ink);
  }

  .search-title span {
    color: var(--orange);
    font-size: 0.9rem;
    font-weight: 700;
  }

  .refine-panel {
    position: static;
  }

  .result-card {
    grid-template-columns: 1fr;
  }

  .card-actions {
    grid-template-columns: 1fr 1fr;
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .site-header {
    min-height: 62px;
    padding: 11px 14px;
  }

  .brand span:last-child {
    display: inline;
  }

  .ghost-button {
    min-height: 38px;
    padding: 0 12px;
  }

  .header-actions {
    gap: 8px;
  }

  .compact-button {
    display: none;
  }

  .hero-content {
    padding: 40px 14px 72px;
  }

  h1 {
    font-size: 2.55rem;
  }

  .hero-copy {
    font-size: 1rem;
  }

  .search-panel {
    padding: 12px;
  }

  .search-title {
    display: grid;
  }

  .role-switch {
    grid-template-columns: 1fr;
  }

  .quick-filters,
  .results-layout,
  .workflow-band,
  .school-panel {
    padding-left: 14px;
    padding-right: 14px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .profile-top {
    align-items: flex-start;
  }

  .card-actions {
    grid-template-columns: 1fr;
  }
}
