:root {
  --blue: #2563eb;
  --blue-dark: #1e40af;
  --ink: #111827;
  --muted: #5f6b7a;
  --line: #e5e7eb;
  --card: rgba(255, 255, 255, .95);
  --panel: rgba(255, 255, 255, .9);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html,
body {
  width: 100%;
  max-width: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #020617;
  overflow-x: hidden;
}

svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

a { color: inherit; }

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(135deg, rgba(0, 0, 0, .68), rgba(0, 0, 0, .62), rgba(0, 0, 0, .76)), url("assets/background.png") center / cover no-repeat;
}

.home-page .page-bg {
  background: linear-gradient(135deg, rgba(0, 0, 0, .62), rgba(0, 0, 0, .58), rgba(0, 0, 0, .72)), url("assets/background.png") center / cover no-repeat;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(0, 0, 0, .4);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  backdrop-filter: blur(22px);
}

.topbar__inner {
  width: 100%;
  max-width: 1280px;
  height: 64px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.brand__icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  box-shadow: 0 10px 24px rgba(37, 99, 235, .3);
}

.brand__text {
  display: grid;
  line-height: 1.1;
}

.brand__text strong {
  font-size: 16px;
}

.brand__text small {
  margin-top: 5px;
  color: #d1d5db;
  font-size: 12px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav__link,
.theme-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  color: #d1d5db;
  background: transparent;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}

.nav__link:hover,
.theme-button:hover,
.nav__link.is-active {
  color: #fff;
  background: rgba(255, 255, 255, .15);
}

.home {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: start center;
  padding: 38px 24px 48px;
}

.home-hero {
  width: min(100%, 908px);
  text-align: center;
  color: #fff;
}

.home-hero h1 {
  margin: 0 0 10px;
  color: #fff;
  font-size: clamp(44px, 6vw, 64px);
  line-height: 1;
  font-weight: 800;
  text-shadow: 0 2px 20px rgba(0, 0, 0, .22);
}

.home-hero__lead {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, .88);
  font-size: clamp(22px, 3vw, 28px);
}

.home-hero__sub {
  margin: 0 0 34px;
  color: rgba(255, 255, 255, .78);
  font-size: 18px;
}

.start-panel {
  min-height: 343px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 14px;
  background:
    radial-gradient(circle at 32% 48%, rgba(14, 165, 233, .16), transparent 34%),
    radial-gradient(circle at 68% 58%, rgba(127, 29, 29, .28), transparent 38%),
    rgba(8, 15, 23, .76);
  box-shadow: 0 28px 64px rgba(0, 0, 0, .28);
  backdrop-filter: blur(10px);
}

.start-panel__icon {
  width: 80px;
  height: 80px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 999px;
  background: #2563eb;
  box-shadow: 0 18px 34px rgba(37, 99, 235, .34);
  font-size: 40px;
}

.start-panel h2 {
  display: block;
  margin: 0 0 12px;
  color: #fff;
  font-size: 30px;
  line-height: 1.15;
}

.start-panel p {
  margin-bottom: 26px;
  color: rgba(255, 255, 255, .88);
  font-size: 18px;
}

.start-panel .button {
  width: 248px;
  text-decoration: none;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 32px;
}

.stat-card {
  min-height: 95px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 8px;
  background: rgba(255, 255, 255, .12);
  backdrop-filter: blur(12px);
}

.stat-card strong {
  color: #60a5fa;
  font-size: 30px;
  line-height: 1;
}

.stat-card span {
  color: rgba(255, 255, 255, .86);
  font-size: 14px;
}

.screen {
  min-height: calc(100vh - 64px);
  padding: 28px 0 48px;
}

.container {
  width: 100%;
  max-width: 896px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--wide { max-width: 1180px; }

.hero-panel,
.section-head {
  width: 100%;
  max-width: 100%;
  margin-bottom: 24px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 12px;
  background: var(--panel);
  backdrop-filter: blur(8px);
}

.hero-panel {
  display: flex;
  align-items: center;
  gap: 18px;
}

.hero-panel__logo {
  width: 76px;
  height: 76px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
}

p { margin: 0; }

p,
li,
span,
strong {
  overflow-wrap: anywhere;
}

.section-head p,
.hero-panel p {
  color: var(--muted);
  font-size: 16px;
}

.grid--search {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .85fr);
  gap: 24px;
  align-items: start;
}

.stack,
.about-stack,
.form-flow {
  display: grid;
  gap: 20px;
}

.section-head + .alert,
.alert + .form-flow {
  margin-bottom: 20px;
}

.card,
.alert {
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(8px);
  box-shadow: 0 20px 48px rgba(15, 23, 42, .16);
}

.card__header {
  padding: 22px 24px;
}

.card__body {
  padding: 0 24px 24px;
  display: grid;
  gap: 16px;
  color: #374151;
}

.card__body p + p { margin-top: 14px; }

.card__body ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.8;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: #111827;
}

.field b,
.consent b { color: #ef4444; }

input,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #111827;
  background: #fff;
  font: inherit;
}

textarea { resize: vertical; }

input:focus,
textarea:focus {
  outline: 2px solid rgba(37, 99, 235, .25);
  border-color: var(--blue);
}

.upload {
  min-height: 96px;
  display: grid;
  place-items: center;
  border: 2px dashed #d1d5db;
  border-radius: 10px;
  color: #64748b;
  background: rgba(249, 250, 251, .8);
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #374151;
  font-size: 14px;
}

.consent input {
  width: auto;
  min-height: auto;
  margin-top: 4px;
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 14px 26px rgba(37, 99, 235, .25);
  text-decoration: none;
}

.button:hover { background: #1d4ed8; }

.button--right {
  justify-self: end;
}

.button--compact {
  min-height: 34px;
  padding: 7px 13px;
  font-size: 14px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .22);
}

.ghost-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 13px;
  border: 1px solid #d5dbe4;
  border-radius: 7px;
  color: #111827;
  background: rgba(255, 255, 255, .86);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .08);
}

.alert {
  display: flex;
  gap: 12px;
  padding: 16px;
  font-size: 14px;
  line-height: 1.55;
  box-shadow: none;
}

.alert svg {
  flex: 0 0 auto;
  margin-top: 2px;
}

.alert--blue {
  border-color: #bfdbfe;
  background: rgba(239, 246, 255, .95);
  color: #374151;
}

.alert--blue svg { color: var(--blue); }

.alert--yellow {
  border-color: #fde68a;
  background: rgba(254, 252, 232, .95);
}

.result-box div,
.contact-box {
  padding: 14px;
  border-radius: 8px;
  background: #f9fafb;
}

.result-box div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.result-box span,
.contact-box small {
  color: #64748b;
}

.contact-box {
  display: grid;
  gap: 8px;
}

.contact-box a {
  color: var(--blue);
  text-decoration: none;
}

.contact-box a:hover { text-decoration: underline; }

.state-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.apply-form-view,
.search-progress-view {
  transition: opacity .35s ease, transform .35s ease, visibility .35s ease;
}

.search-progress-view {
  display: grid;
  gap: 24px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(.985);
  max-height: 0;
  overflow: hidden;
}

.state-toggle:checked ~ .apply-form-view {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-16px) scale(.985);
  max-height: 0;
  overflow: hidden;
}

.state-toggle:checked ~ .search-progress-view {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  max-height: 1200px;
  overflow: visible;
}

.progress-panel,
.results-panel {
  border: 1px solid rgba(191, 219, 254, .9);
  border-radius: 12px;
  background: rgba(239, 246, 255, .95);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 48px rgba(15, 23, 42, .16);
}

.progress-panel {
  padding: 24px;
}

.progress-panel__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 20px;
  border-bottom: 1px solid #bfdbfe;
}

.progress-title {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.progress-title h1 {
  margin: 0 0 2px;
  font-size: 16px;
  line-height: 1.4;
}

.progress-title p {
  color: #4b5563;
  font-size: 14px;
}

.spinner {
  width: 18px;
  height: 18px;
  margin-top: 6px;
  border: 2px solid rgba(37, 99, 235, .18);
  border-top-color: var(--blue);
  border-radius: 999px;
  animation: spin 1s linear infinite;
}

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

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

.source-item {
  position: relative;
  min-height: 41px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  background: rgba(255, 255, 255, .92);
  color: #374151;
  font-size: 12px;
  font-weight: 600;
}

.source-item::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  left: 24px;
  top: 8px;
  border-radius: 999px;
  background: var(--blue);
}

.source-item svg {
  color: #4b5563;
  font-size: 16px;
}

.results-panel {
  overflow: hidden;
  background: rgba(255, 255, 255, .96);
  border-color: rgba(229, 231, 235, .9);
}

.results-toolbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid #e5e7eb;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
}

.found,
.pager,
.pager span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pager button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  color: #6b7280;
  background: #fff;
}

.results-table {
  min-width: 860px;
}

.results-row {
  display: grid;
  grid-template-columns: 1.6fr .9fr 1.1fr 1.25fr 1fr .8fr;
  gap: 22px;
  align-items: center;
  min-height: 56px;
  padding: 0 16px;
  border-bottom: 1px solid #e5e7eb;
}

.results-row--head {
  min-height: 42px;
  color: #737373;
  font-size: 14px;
  font-weight: 700;
}

.results-row:not(.results-row--head) span:not(.person-skel),
.person-skel b,
.person-skel i,
.skeleton {
  display: block;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e5e7eb 0%, #f3f4f6 45%, #e5e7eb 100%);
  background-size: 220% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.results-row:not(.results-row--head) span:nth-child(2) { width: 64px; }
.results-row:not(.results-row--head) span:nth-child(3) { width: 128px; }
.results-row:not(.results-row--head) span:nth-child(4) { width: 144px; }
.results-row:not(.results-row--head) span:nth-child(5) { width: 96px; }
.results-row:not(.results-row--head) span:nth-child(6) { width: 80px; }

.person-skel {
  display: flex;
  align-items: center;
  gap: 12px;
}

.person-skel i {
  width: 40px;
  height: 40px;
}

.person-skel b {
  width: 160px;
}

.skeleton--short { width: 48px; }
.skeleton--tiny { width: 24px; height: 18px; }

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

@keyframes shimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

@media (max-width: 820px) {
  .grid--search,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .brand__text,
  .nav__link span {
    display: none;
  }

  .topbar__inner {
    padding: 0 16px;
  }

  .nav {
    gap: 4px;
  }

  .nav__link,
  .theme-button {
    padding: 8px;
  }

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

  .progress-panel__top,
  .results-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .progress-actions {
    justify-content: flex-start;
  }

  .results-panel {
    overflow-x: auto;
  }
}

@media (max-width: 560px) {
  .home {
    align-items: start;
    padding: 34px 16px;
  }

  .home-hero h1 {
    font-size: 38px;
  }

  .home-hero__lead {
    font-size: 21px;
  }

  .home-hero__sub,
  .start-panel p {
    font-size: 16px;
  }

  .start-panel {
    min-height: 300px;
    padding: 34px 18px;
  }

  .start-panel__icon {
    width: 68px;
    height: 68px;
    font-size: 34px;
  }

  .start-panel h2 {
    font-size: 26px;
  }

  .start-panel .button {
    width: 100%;
  }

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

  .screen {
    padding: 20px 0 36px;
  }

  .container {
    padding: 0 16px;
    overflow: hidden;
  }

  .hero-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-panel > div {
    min-width: 0;
    width: 100%;
  }

  .hero-panel__logo {
    width: 64px;
    height: 64px;
  }

  .hero-panel,
  .section-head,
  .card__header,
  .card__body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .button,
  .button--right {
    width: 100%;
    justify-self: stretch;
  }
}
