:root {
  --green-950: #0b3d1c;
  --green-900: #105323;
  --green-800: #176b2d;
  --green-700: #20833a;
  --green-100: #e8f5ec;
  --green-50: #f3faf5;
  --gold: #e7b63f;
  --ink: #17211a;
  --muted: #66736a;
  --line: #dce5df;
  --surface: #ffffff;
  --background: #f4f7f5;
  --danger: #9f2f2f;
  --shadow: 0 16px 48px rgba(16, 83, 35, 0.12);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(32, 131, 58, 0.08), transparent 34rem),
    var(--background);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }

button { cursor: pointer; }

.page-shell {
  min-height: 100vh;
  overflow: hidden;
}

.hero {
  position: relative;
  color: #fff;
  background:
    linear-gradient(120deg, rgba(11, 61, 28, 0.98), rgba(23, 107, 45, 0.94)),
    linear-gradient(45deg, var(--green-950), var(--green-700));
  isolation: isolate;
}

.hero::before,
.hero::after {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  content: "";
}

.hero::before {
  top: -150px;
  right: -110px;
  width: 430px;
  height: 430px;
  border: 62px solid rgba(255, 255, 255, 0.06);
}

.hero::after {
  bottom: -190px;
  left: 38%;
  width: 330px;
  height: 330px;
  background: rgba(231, 182, 63, 0.08);
}

.container {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}

.hero-inner {
  padding: 30px 0 108px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  color: #fff;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: 205px;
  height: auto;
}

.public-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.12);
  font-size: 13px;
  font-weight: 700;
}

.public-badge::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #86e19c;
  box-shadow: 0 0 0 4px rgba(134, 225, 156, 0.13);
  content: "";
}

.hero-copy {
  max-width: 850px;
  padding-top: 72px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: #c8f1d1;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 31px;
  height: 2px;
  background: var(--gold);
  content: "";
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(38px, 6vw, 66px);
  letter-spacing: -0.045em;
  line-height: 1.02;
}

.hero-description {
  max-width: 760px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(16px, 2vw, 19px);
}

main {
  position: relative;
  z-index: 2;
  padding-bottom: 72px;
}

.search-panel {
  margin-top: -62px;
  padding: 28px;
  border: 1px solid rgba(220, 229, 223, 0.82);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.search-panel-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.search-panel h2,
.results-title {
  margin: 0;
  letter-spacing: -0.025em;
}

.search-panel h2 { font-size: 24px; }

.search-panel-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.security-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green-800);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.security-note svg { flex: 0 0 auto; }

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(230px, 0.9fr) auto auto;
  gap: 12px;
  align-items: end;
}

.field { min-width: 0; }

label {
  display: block;
  margin: 0 0 7px 2px;
  color: #38443b;
  font-size: 13px;
  font-weight: 800;
}

.input-wrap { position: relative; }

.input-wrap svg {
  position: absolute;
  top: 50%;
  left: 16px;
  color: #758078;
  transform: translateY(-50%);
  pointer-events: none;
}

input,
select {
  width: 100%;
  min-height: 50px;
  border: 1px solid #cfdad2;
  border-radius: var(--radius-md);
  outline: none;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input { padding: 0 16px 0 47px; }
select { padding: 0 42px 0 14px; }

input::placeholder { color: #939d96; }

input:focus,
select:focus {
  border-color: var(--green-700);
  box-shadow: 0 0 0 4px rgba(32, 131, 58, 0.11);
}

.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 19px;
  border: 0;
  border-radius: var(--radius-md);
  font-weight: 800;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.button:hover { transform: translateY(-1px); }

.button:focus-visible {
  outline: 3px solid rgba(32, 131, 58, 0.28);
  outline-offset: 2px;
}

.button-primary {
  color: #fff;
  background: var(--green-700);
  box-shadow: 0 8px 18px rgba(32, 131, 58, 0.2);
}

.button-primary:hover { background: var(--green-800); }

.button-secondary {
  border: 1px solid var(--line);
  color: #4b574e;
  background: #fff;
}

.button-secondary:hover { background: var(--green-50); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 24px 0 0;
}

.stat-card {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.86);
}

.stat-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  color: var(--green-800);
  background: var(--green-100);
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.stat-value {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  font-size: 20px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-value.stat-date { font-size: 15px; }

.legal-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  margin-top: 24px;
  padding: 20px 22px;
  border-left: 4px solid var(--gold);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: #405047;
  background: #fffaf0;
}

.legal-card svg { color: #a77a10; }

.legal-card p { margin: 0; }
.legal-card strong { color: #57430e; }

.results-section { padding-top: 48px; }

.results-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.results-title { font-size: 27px; }

.results-summary {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.results-count {
  padding: 7px 12px;
  border: 1px solid #cfe3d4;
  border-radius: 999px;
  color: var(--green-800);
  background: var(--green-50);
  font-size: 13px;
  font-weight: 800;
}

.results-grid {
  display: grid;
  gap: 16px;
}

.diploma-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 7px 24px rgba(24, 52, 33, 0.055);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.diploma-card:hover {
  border-color: #bfd6c5;
  box-shadow: 0 13px 32px rgba(24, 52, 33, 0.09);
  transform: translateY(-1px);
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid #edf1ee;
}

.card-heading h3 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.course-name {
  display: block;
  margin-top: 6px;
  color: var(--green-800);
  font-size: 13px;
  font-weight: 750;
}

.status-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  color: #1b6d30;
  background: #eaf7ed;
  font-size: 12px;
  font-weight: 800;
}

.status-badge::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38a354;
  content: "";
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0 24px;
}

.data-item {
  min-width: 0;
  padding: 17px 18px 17px 0;
}

.data-item + .data-item { padding-left: 18px; }

.data-item:not(:nth-child(4n + 1)) { border-left: 1px solid #edf1ee; }

.data-item dt {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.data-item dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 750;
}

.publication {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  margin: 0 24px 22px;
  padding: 15px 16px;
  border-radius: var(--radius-md);
  color: #4c5b52;
  background: #f7f9f7;
  font-size: 13px;
}

.publication svg { color: var(--green-700); }

.publication strong {
  display: block;
  margin-bottom: 2px;
  color: #25362b;
}

.empty-state,
.error-state {
  padding: 50px 24px;
  border: 1px dashed #cbd8ce;
  border-radius: var(--radius-lg);
  text-align: center;
  background: rgba(255, 255, 255, 0.7);
}

.empty-icon {
  display: grid;
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 18px;
  color: var(--green-800);
  background: var(--green-100);
}

.empty-state h3,
.error-state h3 { margin: 0; }

.empty-state p,
.error-state p {
  max-width: 520px;
  margin: 8px auto 0;
  color: var(--muted);
}

.error-state {
  border-color: #e6c9c9;
  color: var(--danger);
  background: #fffafa;
}

.error-state p { color: #7e5555; }

.skeleton-card {
  height: 225px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
}

.skeleton-line {
  height: 13px;
  border-radius: 999px;
  background: linear-gradient(90deg, #eef2ef 25%, #f8faf8 50%, #eef2ef 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}

.skeleton-content { padding: 24px; }

.skeleton-line + .skeleton-line { margin-top: 14px; }

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 28px;
}

.page-button {
  display: grid;
  min-width: 42px;
  height: 42px;
  padding: 0 11px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: #465149;
  background: #fff;
  font-weight: 750;
}

.page-button:hover:not(:disabled) {
  border-color: #b9d1bf;
  color: var(--green-800);
  background: var(--green-50);
}

.page-button.active {
  border-color: var(--green-700);
  color: #fff;
  background: var(--green-700);
}

.page-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.page-ellipsis {
  min-width: 25px;
  text-align: center;
  color: var(--muted);
}

.footer {
  border-top: 1px solid var(--line);
  color: #617067;
  background: #fff;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0;
  font-size: 13px;
}

.footer strong { color: var(--green-900); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 940px) {
  .search-form { grid-template-columns: 1fr 1fr; }
  .search-form .button { width: 100%; }
  .data-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .data-item:not(:nth-child(4n + 1)) { border-left: 0; }
  .data-item:nth-child(even) { border-left: 1px solid #edf1ee; }
}

@media (max-width: 700px) {
  .container { width: min(100% - 24px, 1160px); }
  .hero-inner { padding-top: 20px; }
  .topbar { align-items: flex-start; }
  .brand-logo { width: 158px; }
  .public-badge { margin-top: 5px; font-size: 11px; }
  .hero-copy { padding-top: 54px; }
  .hero-description { font-size: 16px; }
  .search-panel { padding: 21px; }
  .search-panel-header { align-items: flex-start; flex-direction: column; gap: 10px; }
  .security-note { white-space: normal; }
  .search-form { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .legal-card { padding: 18px; }
  .results-header { align-items: flex-start; flex-direction: column; gap: 10px; }
  .card-heading { flex-direction: column; padding: 19px; }
  .data-grid { grid-template-columns: 1fr; padding: 0 19px; }
  .data-item,
  .data-item + .data-item { padding: 14px 0; border-left: 0; }
  .data-item + .data-item { border-top: 1px solid #edf1ee; }
  .data-item:nth-child(even) { border-left: 0; }
  .publication { margin: 2px 19px 19px; }
  .footer-inner { align-items: flex-start; flex-direction: column; }
  .page-button { min-width: 38px; height: 38px; padding: 0 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}