:root {
  --bg: #03132d;
  --panel: rgba(10, 31, 67, 0.86);
  --panel-strong: rgba(15, 42, 84, 0.94);
  --line: rgba(157, 190, 235, 0.24);
  --cyan: #23d8ff;
  --yellow: #ffdf3e;
  --text: #ffffff;
  --muted: #b6c2d4;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 20% -10%, rgba(0, 167, 255, 0.28), transparent 34rem),
    linear-gradient(180deg, #041a3a, var(--bg));
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.page-actions {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 10;
  display: flex;
  gap: 10px;
}

.page-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(6, 22, 49, 0.76);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.results-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 58px;
}

.results-hero,
.folder-panel,
.documents-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

.results-hero {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: center;
  min-height: 150px;
  padding: 28px;
}

.results-hero img {
  width: 100%;
  max-height: 72px;
  object-fit: contain;
}

.results-hero p,
.folder-panel span,
.panel-title span {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0;
  text-transform: uppercase;
}

.results-hero h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 56px);
  line-height: 0.95;
}

.results-hero span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 17px;
  font-weight: 800;
}

.folder-panel {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 380px);
  gap: 18px;
  align-items: end;
  margin-top: 16px;
  padding: 20px 24px;
}

.folder-panel strong {
  display: block;
  font-size: 24px;
}

.folder-panel label {
  display: grid;
  gap: 8px;
}

.folder-panel select {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(35, 216, 255, 0.48);
  border-radius: 999px;
  background: #052c50;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
}

.documents-panel {
  margin-top: 16px;
  padding: 22px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.panel-title h2 {
  margin: 0;
  font-size: 25px;
}

.panel-title strong {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  color: #07152e;
  font-size: 20px;
}

.document-list {
  display: grid;
  gap: 12px;
}

.document-card {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 18px;
  align-items: center;
  min-height: 116px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: var(--panel-strong);
}

.pdf-thumb {
  position: relative;
  height: 94px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: #f5f7fb;
  box-shadow: inset 0 0 0 1px rgba(4, 12, 28, 0.12);
}

.pdf-preview-frame {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 205px;
  border: 0;
  background: #fff;
  pointer-events: none;
  transform: translateY(-8px);
  transform-origin: top left;
}

.pdf-preview-canvas {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  width: 100%;
  height: 100%;
  background: #fff;
}

.pdf-preview-ready .pdf-preview-canvas {
  display: block;
}

.pdf-preview-ready .pdf-preview-fallback {
  opacity: 0;
}

.pdf-preview-fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: 58px 1fr;
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 4px 10px;
  padding: 8px;
  background:
    radial-gradient(circle at 80% 70%, rgba(255, 72, 145, 0.28), transparent 36%),
    radial-gradient(circle at 20% 25%, rgba(35, 216, 255, 0.26), transparent 38%),
    linear-gradient(135deg, #121a31, #030916);
}

.pdf-sheet {
  position: relative;
  width: 52px;
  height: 66px;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 8px 14px 8px 8px;
  box-shadow: 0 0 16px rgba(96, 206, 255, 0.28);
}

.pdf-sheet::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 18px;
  height: 18px;
  border-radius: 0 10px 0 6px;
  background: #fff;
  box-shadow: -4px 4px 12px rgba(255, 76, 160, 0.3);
}

.pdf-sheet span {
  position: absolute;
  left: -9px;
  top: 24px;
  padding: 3px 9px 4px;
  border-radius: 7px;
  background: linear-gradient(180deg, #ff4f62, #d70035);
  color: #fff;
  font-size: 15px;
  font-weight: 1000;
  box-shadow: 0 0 18px rgba(255, 45, 91, 0.46);
}

.pdf-globe {
  position: relative;
  width: 54px;
  height: 54px;
  justify-self: center;
  border: 3px solid #45cfff;
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(69, 207, 255, 0.38);
}

.pdf-globe::before,
.pdf-globe::after {
  content: "";
  position: absolute;
  inset: 10px 5px;
  border-left: 2px solid #45cfff;
  border-right: 2px solid #45cfff;
  border-radius: 50%;
}

.pdf-globe::after {
  inset: 24px 4px 0;
  height: 0;
  border: 0;
  border-top: 2px solid #45cfff;
  border-radius: 0;
}

.pdf-orbit {
  position: absolute;
  right: 6px;
  bottom: 14px;
  width: 76px;
  height: 30px;
  border-bottom: 3px solid #ff5baa;
  border-radius: 50%;
  transform: rotate(-15deg);
  box-shadow: 0 8px 14px rgba(255, 91, 170, 0.22);
}

.pdf-preview-fallback strong {
  grid-column: 2;
  justify-self: center;
  color: #e8edff;
  font-size: 11px;
  letter-spacing: 3px;
}

.doc-signature {
  position: absolute;
  z-index: 2;
  object-fit: contain;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.doc-signature-date {
  position: absolute;
  z-index: 3;
  transform: translateX(-50%);
  padding: 2px 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: #061631;
  font-size: 7px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}

.pdf-thumb::after {
  content: "";
  display: none;
}

.document-card h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.document-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.document-card .document-signature-note {
  margin-top: 8px;
  color: rgba(196, 207, 223, 0.72);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.document-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.document-card a,
.document-card button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--yellow);
  color: #061631;
  font: inherit;
  font-weight: 1000;
  text-decoration: none;
  cursor: pointer;
}

.document-card button.delete-pdf {
  background: #ff3f68;
  color: #fff;
}

.document-card button.move-pdf {
  background: linear-gradient(180deg, #dfe7f3, #9aa8bd);
  color: #061631;
}

.document-card button.move-pdf:hover,
.document-card button.move-pdf:focus-visible {
  background: linear-gradient(180deg, #ffffff, #b9c6d6);
}

.document-card button.move-pdf:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.document-card a.sign-pdf {
  background: linear-gradient(180deg, #b87333, #7b421f);
  color: #fff;
}

.document-card button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.empty-state {
  display: grid;
  gap: 8px;
  min-height: 140px;
  place-items: center;
  border: 1px dashed rgba(255, 255, 255, 0.24);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: #fff;
  font-size: 20px;
}

@media (max-width: 720px) {
  .page-actions {
    position: static;
    justify-content: flex-end;
    padding: 12px 12px 0;
  }

  .results-shell {
    width: min(100% - 18px, 720px);
    padding-top: 12px;
  }

  .results-hero,
  .folder-panel,
  .document-card {
    grid-template-columns: 1fr;
  }

  .results-hero {
    gap: 14px;
    padding: 20px;
  }

  .results-hero img {
    max-width: 210px;
  }

  .pdf-thumb {
    height: 132px;
  }

  .pdf-preview-frame {
    height: 250px;
  }
}
