:root {
  color-scheme: light;
  --ink: #15201c;
  --muted: #6c7772;
  --line: #dce3df;
  --paper: #f3f5f2;
  --panel: #ffffff;
  --accent: #1c5a4d;
  --accent-hover: #123f36;
  --danger: #a23939;
  --pdf: #a74545;
  --shadow: 0 24px 70px rgba(25, 47, 40, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 8%, rgba(207, 227, 218, 0.72), transparent 29rem),
    linear-gradient(180deg, #fafbf9, var(--paper));
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.landing-page,
.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.landing-card,
.login-card {
  width: min(100%, 520px);
  padding: clamp(34px, 7vw, 58px);
  border: 1px solid rgba(21, 32, 28, 0.11);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.study-label,
.card-label {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.records-header h1,
.landing-card h1,
.login-card h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(39px, 8vw, 58px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
}

.study-date,
.login-copy {
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.viewer-button {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 34px;
  padding: 0 20px;
  border-radius: 12px;
  color: #ffffff;
  background: var(--accent);
  font-size: 15px;
  font-weight: 750;
  text-decoration: none;
  transition: background 150ms ease, transform 150ms ease;
}

.viewer-button:hover,
.viewer-button:focus-visible,
.primary-action:hover,
.primary-action:focus-visible {
  background: var(--accent-hover);
  transform: translateY(-1px);
  outline: none;
}

form {
  margin-top: 30px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
}

input {
  width: 100%;
  height: 54px;
  padding: 0 15px;
  border: 1px solid #cbd5d0;
  border-radius: 11px;
  color: var(--ink);
  background: #ffffff;
  font: inherit;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(28, 90, 77, 0.12);
}

button {
  width: 100%;
  height: 54px;
  margin-top: 14px;
  border: 0;
  border-radius: 11px;
  color: #ffffff;
  background: var(--accent);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  transition: background 150ms ease;
}

button:hover,
button:focus-visible {
  background: var(--accent-hover);
  outline: none;
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.login-error {
  margin: 13px 0 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 650;
}

.records-page {
  padding: 58px 24px 72px;
}

.records-shell {
  width: min(100%, 860px);
  margin: 0 auto;
}

.records-header {
  margin-bottom: 34px;
}

.ct-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 240px);
  align-items: center;
  gap: 28px;
  padding: 30px;
  border-radius: 20px;
  color: #ffffff;
  background: #173f36;
  box-shadow: var(--shadow);
}

.ct-card .card-label {
  margin-bottom: 10px;
  color: #b8d8cc;
}

.ct-card h2 {
  margin: 0;
  font: 500 clamp(27px, 4vw, 36px)/1.1 Georgia, "Times New Roman", serif;
  letter-spacing: -0.025em;
}

.ct-card p:last-child {
  margin: 10px 0 0;
  color: #c8dbd4;
  font-size: 13px;
}

.primary-action {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 18px;
  border-radius: 11px;
  color: #173f36;
  background: #ffffff;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
  transition: background 150ms ease, transform 150ms ease;
}

.primary-action:hover,
.primary-action:focus-visible {
  color: #ffffff;
}

.documents-section {
  margin-top: 42px;
}

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

.section-heading h2 {
  margin: 0;
  font: 500 27px/1.2 Georgia, "Times New Roman", serif;
}

.section-heading span {
  color: var(--muted);
  font-size: 12px;
}

.document-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 15px 45px rgba(25, 47, 40, 0.07);
}

.document-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 82px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.document-row:last-child {
  border-bottom: 0;
}

.pdf-badge {
  width: 40px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #ffffff;
  background: var(--pdf);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.05em;
}

.document-details {
  min-width: 0;
}

.document-details h3 {
  overflow: hidden;
  margin: 0;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-details p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

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

.document-actions a,
.toolbar-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid #cfd9d4;
  border-radius: 9px;
  color: var(--accent);
  background: #ffffff;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.document-actions a:first-child,
.toolbar-action.primary {
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent);
}

.document-actions a:hover,
.document-actions a:focus-visible,
.toolbar-action:hover,
.toolbar-action:focus-visible {
  border-color: var(--accent-hover);
  outline: none;
  box-shadow: 0 0 0 3px rgba(28, 90, 77, 0.1);
}

.pdf-viewer-page {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #e8ece9;
}

.pdf-toolbar {
  min-height: 72px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.back-link {
  color: var(--accent);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.pdf-title {
  min-width: 0;
}

.pdf-title strong,
.pdf-title span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-title strong {
  font-size: 14px;
}

.pdf-title span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.pdf-toolbar-actions {
  display: flex;
  gap: 8px;
}

.pdf-stage {
  min-height: 0;
  flex: 1;
  padding: 12px;
}

.pdf-stage iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 8px 30px rgba(28, 43, 37, 0.12);
}

@media (max-width: 680px) {
  .records-page {
    padding: 34px 14px 48px;
  }

  .ct-card {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .document-row {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 13px;
  }

  .document-actions {
    grid-column: 2;
  }

  .document-actions a {
    flex: 1;
  }

  .pdf-toolbar {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
  }

  .pdf-toolbar-actions {
    grid-column: 1 / -1;
  }

  .toolbar-action {
    flex: 1;
  }

  .pdf-stage {
    padding: 6px;
  }
}

@media (max-width: 520px) {
  .landing-card,
  .login-card {
    border-radius: 18px;
  }

  .records-header h1 {
    font-size: 42px;
  }
}
