:root {
  --ink: #17213f;
  --muted: #5e6782;
  --line: #dce7f6;
  --paper: #f7fafe;
  --panel: #ffffff;
  --brand-blue: #3d67ad;
  --brand-navy: #2c3a83;
  --brand-sky: #54a8dd;
  --brand-yellow: #faef53;
  --brand-pale: #eaf6fd;
  --brand-soft: #ddf5ff;
  --teal: var(--brand-blue);
  --teal-dark: var(--brand-navy);
  --mint: var(--brand-pale);
  --coral: var(--brand-yellow);
  --gold: var(--brand-yellow);
  --shadow: 0 18px 45px rgba(44, 58, 131, 0.16);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #f5f9ff 0%, #ffffff 480px, var(--paper) 100%);
  color: var(--ink);
}

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

a {
  color: inherit;
}

.masthead {
  position: relative;
  min-height: min(560px, 76vh);
  overflow: hidden;
  color: #fff;
  background: var(--brand-navy);
}

.masthead__image {
  position: absolute;
  inset: 0;
  background: linear-gradient(130deg, #2c3a83 0%, #3456a0 48%, #3d67ad 74%, #54a8dd 100%);
}

.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 16px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-weight: 750;
  text-decoration: none;
  letter-spacing: 0;
}

.brand__mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 50%;
  background: rgba(84, 168, 221, 0.2);
  font-weight: 850;
}

.hero {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(28px, 6vh, 46px) 0 32px;
}

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

.hero .eyebrow {
  color: var(--brand-yellow);
}

.hero h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(2.05rem, 4.15vw, 3.65rem);
  line-height: 1;
  letter-spacing: 0;
}

.hero__copy {
  max-width: 620px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  line-height: 1.45;
}

.hero__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  width: min(720px, 100%);
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
}

.hero__metrics div {
  min-width: 0;
  padding: 14px 16px;
  background: rgba(44, 58, 131, 0.38);
}

.hero__metrics strong,
.hero__metrics span {
  display: block;
}

.hero__metrics strong {
  font-size: 1.55rem;
}

.hero__metrics span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.85rem;
}

.program-rules,
.access-zone {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.program-rules {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.4fr);
  gap: 26px;
  padding: 30px 0 0;
}

.program-rules h2,
.account-panel h2,
.admin-panel h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
}

.program-rules ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.program-rules li {
  padding: 12px 14px;
  border-left: 4px solid var(--brand-sky);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(44, 58, 131, 0.06);
  line-height: 1.45;
}

.access-zone {
  display: grid;
  gap: 18px;
  padding-top: 24px;
}

.account-panel,
.admin-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(44, 58, 131, 0.08);
}

.account-status {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--brand-navy);
  font-weight: 700;
  line-height: 1.4;
}

.account-status[hidden] {
  display: none;
}

.auth-forms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.auth-form {
  display: grid;
  gap: 12px;
  align-content: start;
}

.auth-form:first-child {
  padding-right: 24px;
}

.auth-form + .auth-form {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.auth-form h3,
.admin-grid h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 2px;
  color: var(--brand-navy);
  font-size: 1rem;
}

.auth-form h3::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 22px;
  border-radius: 999px;
  background: var(--brand-blue);
}

.auth-form + .auth-form h3::before {
  background: var(--teal);
}

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

.auth-form label span,
.auth-field > label {
  color: var(--brand-navy);
  font-size: 0.82rem;
  font-weight: 750;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
}

.password-field input {
  border-radius: 8px 0 0 8px;
}

.password-toggle {
  min-height: 43px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: #f5faff;
  color: var(--brand-blue);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: #eaf4ff;
  color: var(--brand-navy);
}

.password-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.signed-in-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.signed-in-panel strong,
.signed-in-panel span {
  display: block;
}

.signed-in-panel span {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.admin-panel__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
  gap: 18px;
  margin-top: 18px;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--brand-navy);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.admin-log {
  display: grid;
  gap: 10px;
}

.admin-request {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.admin-request strong,
.admin-request span {
  display: block;
}

.admin-request span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.85rem;
}

.admin-request ol {
  margin: 10px 0 0;
  padding-left: 20px;
}

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 32px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 38px 0 80px;
}

.filters {
  position: sticky;
  top: 18px;
  align-self: start;
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(44, 58, 131, 0.08);
}

.searchbox {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.searchbox svg,
.icon-button svg,
.button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.searchbox input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

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

.filter-group label,
.request-form label span {
  color: var(--brand-navy);
  font-size: 0.82rem;
  font-weight: 750;
}

select,
.auth-form input,
.request-form input,
.request-form textarea {
  width: 100%;
  min-height: 43px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

select,
.auth-form input,
.request-form input {
  padding: 0 12px;
}

.request-form textarea {
  resize: vertical;
  padding: 12px;
  line-height: 1.45;
}

.filter-actions {
  display: flex;
  justify-content: flex-start;
}

.directory {
  min-width: 0;
}

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

.directory__head h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  letter-spacing: 0;
}

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

.mentor-card {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 26px rgba(44, 58, 131, 0.07);
}

.mentor-card__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.mentor-card__status {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 8px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--teal-dark);
  font-size: 0.75rem;
  font-weight: 800;
}

.mentor-card__status[data-status="case-by-case"] {
  background: #fffbd0;
  color: #5e5400;
}

.mentor-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-bottom: 7px;
}

.mentor-card__badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid #008cff;
  background: #008cff;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
}

.mentor-card h3 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.mentor-card__name-link {
  color: var(--brand-navy);
  text-decoration: none;
}

.mentor-card__name-link:hover,
.mentor-card__name-link:focus-visible {
  color: var(--brand-blue);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.mentor-card__title,
.mentor-card__institution {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.mentor-card__institution {
  margin: 0;
  font-weight: 680;
}

.mentor-card__tags,
.mentor-card__engagement {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag,
.engagement-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.tag {
  background: var(--brand-pale);
  color: var(--brand-navy);
}

.engagement-chip {
  border: 1px solid #f4e768;
  color: var(--brand-navy);
  background: #fffde4;
}

.mentor-card__focus,
.mentor-card__engagement-section {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-top: 2px;
}

.mentor-card__focus h4,
.mentor-card__engagement-section h4 {
  margin: 0;
  color: var(--brand-navy);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.mentor-card__focus p {
  margin: 0;
  color: var(--ink);
  font-size: 0.94rem;
  line-height: 1.45;
}

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  text-decoration: none;
}

.button {
  gap: 8px;
  min-height: 42px;
  padding: 0 15px;
  border-radius: 8px;
  font-weight: 800;
}

.button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.button--tiny {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--brand-navy);
  font-size: 0.8rem;
}

.button--primary {
  background: var(--teal);
  color: #fff;
}

.button--ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--brand-navy);
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--teal-dark);
}

.icon-button--light {
  gap: 7px;
  width: auto;
  min-width: 58px;
  padding: 0 12px;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.mentor-card__select[data-selected="true"] {
  background: var(--teal);
  color: #fff;
}

.mentor-card__select[disabled] {
  cursor: not-allowed;
  opacity: 0.42;
}

.empty-state {
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.request-panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
}

.request-panel[aria-hidden="false"] {
  display: block;
}

.request-panel__scrim {
  position: absolute;
  inset: 0;
  background: rgba(23, 33, 63, 0.48);
}

.request-panel__sheet {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 18px;
  width: min(720px, 100%);
  height: 100%;
  overflow: auto;
  padding: 26px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.request-panel__head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.request-panel__head h2 {
  margin: 0;
  font-size: 1.65rem;
}

.request-panel__note {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

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

.selected-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.rank-badge {
  width: fit-content;
  margin: 0 0 6px !important;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--brand-pale);
  color: var(--brand-navy) !important;
  font-size: 0.75rem !important;
  font-weight: 850;
}

.selected-item strong,
.selected-item span {
  display: block;
}

.selected-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.88rem;
}

.selected-item button {
  flex: 0 0 auto;
}

.selected-item__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 7px;
}

.request-form {
  display: grid;
  gap: 15px;
}

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

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

.checkbox-row {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px !important;
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.checkbox-row span {
  color: var(--brand-navy);
  font-weight: 650;
  line-height: 1.35;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.form-status {
  min-height: 22px;
  margin: 0;
  color: var(--teal-dark);
  font-weight: 700;
}

@media (max-width: 980px) {
  .program-rules,
  .admin-grid {
    grid-template-columns: 1fr;
  }

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

  .filters {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .searchbox,
  .filter-actions {
    grid-column: 1 / -1;
  }

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

@media (max-width: 680px) {
  .topbar,
  .hero,
  .program-rules,
  .access-zone,
  .shell {
    width: min(100% - 28px, 1180px);
  }

  .masthead {
    min-height: auto;
  }

  .hero {
    padding: 48px 0 38px;
  }

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

  .filters,
  .auth-forms,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .auth-form:first-child {
    padding-right: 0;
    padding-bottom: 20px;
  }

  .auth-form + .auth-form {
    padding-top: 20px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .signed-in-panel,
  .admin-panel__head,
  .selected-item {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .signed-in-panel,
  .admin-panel__head {
    flex-direction: column;
  }

  .selected-item__actions {
    justify-content: start;
  }

  .directory__head {
    align-items: stretch;
    flex-direction: column;
  }

  .directory__head .button {
    width: 100%;
  }

  .request-panel__sheet {
    padding: 20px 14px;
  }
}
