@font-face {
  font-family: "Gotham";
  src: url("assets/fonts/Gotham-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Gotham";
  src: url("assets/fonts/Gotham-Black.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #1d1a17;
  --muted: #5f5953;
  --paper: #fbf7f1;
  --paper-strong: #f2ebe2;
  --accent: #d5a253;
  --accent-dark: #9d6f2f;
  --teal: #2f5b59;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.15);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Gotham", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
}

.background {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: radial-gradient(circle at 15% 20%, #f8e9cf 0%, transparent 50%),
    radial-gradient(circle at 85% 10%, #cfe3e0 0%, transparent 45%),
    linear-gradient(160deg, #f9f2e7 0%, #f2e7d5 55%, #f4efe8 100%);
}

.grain {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
  opacity: 0.6;
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(0px);
  opacity: 0.6;
}

.orb-a {
  width: 320px;
  height: 320px;
  top: 8%;
  left: -60px;
  background: radial-gradient(circle at 30% 30%, #ffd9a6, transparent 60%);
}

.orb-b {
  width: 280px;
  height: 280px;
  bottom: 8%;
  right: -80px;
  background: radial-gradient(circle at 30% 30%, #b6d7d4, transparent 60%);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 5vw 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: #125f89;
  color: #fffaf1;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  box-shadow: 0 12px 30px rgba(18, 95, 137, 0.25);
}

.brand-mark img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
}

.brand-title {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.2px;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.4px;
}

.status {
  font-size: 14px;
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(320px, 1fr);
  gap: 32px;
  padding: 16px 5vw 40px;
  align-items: start;
}

.panel {
  background: rgba(255, 255, 255, 0.82);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.controls h1 {
  margin: 0 0 12px;
  font-size: 26px;
  letter-spacing: 0.2px;
}

.lede {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.actions {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.print-callout {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(18, 95, 137, 0.12);
  color: #14344a;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid rgba(18, 95, 137, 0.2);
}

.print-callout span {
  background: rgba(18, 95, 137, 0.18);
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 700;
}

button {
  border: none;
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:active {
  transform: translateY(1px);
}

.primary {
  background: linear-gradient(140deg, var(--teal), #1f413f);
  color: #f7f4ee;
  box-shadow: 0 12px 24px rgba(31, 65, 63, 0.25);
}

.secondary {
  background: #f1e6d4;
  color: #4b3a25;
  border: 1px solid rgba(157, 111, 47, 0.2);
}

.ghost {
  background: transparent;
  border: 1px dashed rgba(95, 89, 83, 0.3);
  color: var(--muted);
}

.callout {
  padding: 18px;
  border-radius: 18px;
  background: #f6efe4;
  border: 1px solid rgba(157, 111, 47, 0.18);
  margin-bottom: 18px;
}

.callout h2 {
  margin: 0 0 8px;
  font-size: 15px;
}

.callout p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.error {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff1f1;
  color: #8a1f1f;
  border: 1px solid rgba(138, 31, 31, 0.2);
}

.viewer {
  padding: 0;
  overflow: auto;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  backdrop-filter: none;
}

.pdf-root {
  display: grid;
  gap: 26px;
  justify-items: center;
}

.page {
  position: relative;
  background: white;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
}

.page canvas {
  display: block;
}

.annotation-layer {
  position: absolute;
  inset: 0;
}

.annotation-layer input,
.annotation-layer textarea {
  position: absolute;
  border: 2px solid rgba(18, 95, 137, 0.85);
  background: rgba(18, 95, 137, 0.2);
  color: var(--ink);
  font-family: "Gotham", "Helvetica Neue", sans-serif;
  font-weight: 300;
  padding: 2px 4px;
  outline: none;
  resize: none;
  line-height: 1.1;
  box-shadow:
    0 0 0 2px rgba(18, 95, 137, 0.2) inset,
    0 4px 10px rgba(18, 95, 137, 0.25);
}

.annotation-layer .field-backdrop {
  position: absolute;
  border-radius: 6px;
  border: 2px solid rgba(255, 140, 0, 0.85);
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 140, 0, 0.35) 0,
      rgba(255, 140, 0, 0.35) 6px,
      rgba(255, 255, 255, 0.25) 6px,
      rgba(255, 255, 255, 0.25) 12px
    );
  box-shadow:
    0 0 0 2px rgba(255, 140, 0, 0.25) inset,
    0 6px 14px rgba(255, 140, 0, 0.3);
  pointer-events: none;
  animation: fieldPulse 1.8s ease-in-out infinite;
}

.annotation-layer input:hover,
.annotation-layer textarea:hover {
  background: rgba(18, 95, 137, 0.28);
}

.annotation-layer input:focus,
.annotation-layer textarea:focus {
  border-color: rgba(18, 95, 137, 1);
  background: rgba(18, 95, 137, 0.35);
  box-shadow:
    0 0 0 3px rgba(18, 95, 137, 0.35),
    0 6px 14px rgba(18, 95, 137, 0.3);
}

.annotation-layer .field-highlight {
  border-style: dashed;
}

.annotation-layer .field-white-text {
  background: rgba(18, 95, 137, 0.55);
  border-color: rgba(18, 95, 137, 1);
  box-shadow:
    0 0 0 2px rgba(18, 95, 137, 0.35) inset,
    0 6px 12px rgba(18, 95, 137, 0.35);
}

@keyframes fieldPulse {
  0% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.02);
    opacity: 0.6;
  }
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
}

.annotation-layer input[type="checkbox"] {
  padding: 0;
  background: rgba(255, 255, 255, 0.8);
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}
