:root {
  --wp-bg: #edf3ff;
  --wp-surface: #ffffff;
  --wp-ink: #17263d;
  --wp-muted: #53627d;
  --wp-line: rgba(23, 38, 61, 0.12);
  --wp-brand: #2457ff;
  --wp-brand-dark: #1237ad;
  --wp-brand-soft: rgba(36, 87, 255, 0.1);
  --wp-shadow: 0 16px 44px rgba(20, 33, 61, 0.16);
  --wp-radius: 20px;
  --wp-font: "Inter", "Segoe UI", Arial, sans-serif;
  --site-primary: #4361ee;
  --site-primary-dark: #3a0ca3;
  --site-secondary: #7209b7;
  --site-text-dark: #0f172a;
  --site-bg-white: #ffffff;
  --site-bg-gray: #eef2ff;
  --site-font-heading: "Poppins", sans-serif;
  --site-font-body: "Inter", sans-serif;
  --site-spacing-xs: 0.5rem;
  --site-spacing-sm: 1rem;
  --site-spacing-md: 1.5rem;
  --site-spacing-lg: 2rem;
  --site-radius-md: 0.5rem;
  --site-shadow-md: 0 4px 8px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
  --site-header-offset: 84px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  min-height: 100vh;
  font-family: var(--wp-font);
  color: var(--wp-ink);
  overflow-wrap: anywhere;
  word-break: break-word;
  background:
    radial-gradient(circle at top left, rgba(36, 87, 255, 0.16), transparent 34%),
    radial-gradient(circle at right bottom, rgba(0, 165, 177, 0.12), transparent 30%),
    linear-gradient(180deg, #f4f7ff 0%, var(--wp-bg) 100%);
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.container {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1.25rem 0;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  transition: all 0.3s ease;
}

.site-header.scrolled {
  background-color: var(--site-bg-white);
  box-shadow: var(--site-shadow-md);
  padding: 1rem 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding: 0;
}

.site-logo {
  z-index: 1001;
}

.site-logo a {
  display: flex;
  align-items: center;
  gap: var(--site-spacing-xs);
  color: var(--site-text-dark);
  text-decoration: none;
  font-family: var(--site-font-heading);
  font-size: 1.5rem;
  font-weight: 700;
}

.site-logo img {
  width: auto;
  height: 2.5rem;
}

.site-cta-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
}

.site-header .btn {
  min-height: auto;
  padding: 0.75rem 1.5rem;
  border-radius: var(--site-radius-md);
  font-family: var(--site-font-body);
  font-size: 1rem;
  font-weight: 500;
}

.site-header .btn-primary {
  background: linear-gradient(135deg, var(--site-primary) 0%, var(--site-secondary) 100%);
  box-shadow: 0 4px 14px rgba(67, 97, 238, 0.3);
}

.site-header .btn-primary:hover,
.site-header .btn-primary:focus-visible {
  background: linear-gradient(135deg, var(--site-primary-dark) 0%, var(--site-secondary) 100%);
  box-shadow: 0 6px 20px rgba(67, 97, 238, 0.4);
  color: #ffffff;
}

.viewer-main {
  padding: calc(var(--site-header-offset) + clamp(1.2rem, 3vw, 1.8rem)) 0 clamp(1.2rem, 3vw, 1.8rem);
}

.viewer-shell {
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: calc(var(--wp-radius) + 4px);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--wp-shadow);
  backdrop-filter: blur(12px);
  padding: clamp(1rem, 2.5vw, 1.5rem);
}

.viewer-shell[hidden] {
  display: none;
}

.viewer-shell__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.95rem;
  position: relative;
  padding-right: 3.4rem;
}

.viewer-shell__meta {
  display: grid;
  gap: 0.5rem;
  max-width: 72ch;
}

.viewer-kicker {
  margin: 0;
  color: var(--wp-brand-dark);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.viewer-shell h1 {
  margin: 0;
  font-size: clamp(1.25rem, 2.8vw, 1.8rem);
  line-height: 1.35;
}

.viewer-shell p {
  margin: 0;
  color: var(--wp-muted);
  line-height: 1.55;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 46px;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(36, 87, 255, 0.16);
}

.btn:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--wp-brand) 0%, #00a5b1 100%);
  color: #ffffff;
  box-shadow: 0 14px 26px rgba(36, 87, 255, 0.24);
}

.btn-outline {
  color: var(--wp-brand-dark);
  border-color: rgba(36, 87, 255, 0.2);
  background: rgba(255, 255, 255, 0.82);
}

.viewer-download {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 1.2rem;
  line-height: 1;
}

.btn-block {
  width: 100%;
  margin-top: 0.95rem;
}

.viewer-toolbar {
  padding: 0.85rem;
  border: 1px solid var(--wp-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.viewer-toolbar::-webkit-scrollbar {
  height: 8px;
}

.viewer-toolbar::-webkit-scrollbar-thumb {
  background: rgba(23, 38, 61, 0.2);
  border-radius: 999px;
}

.toolbar-track {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: nowrap;
  min-width: max-content;
}

.toolbar-button,
.toolbar-link,
.toolbar-chip {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(23, 38, 61, 0.12);
  padding: 0.65rem 0.9rem;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--wp-ink);
  background: #ffffff;
  flex: 0 0 auto;
  white-space: nowrap;
}

.toolbar-button {
  cursor: pointer;
}

.toolbar-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.toolbar-chip {
  background: var(--wp-brand-soft);
  color: var(--wp-brand-dark);
  border-color: rgba(36, 87, 255, 0.18);
}

.toolbar-button--icon,
.toolbar-link--icon {
  width: 44px;
  padding: 0;
  font-size: 1.15rem;
  line-height: 1;
}

.toolbar-link--icon {
  text-decoration: none;
}

.pdf-stage {
  margin-top: 0.9rem;
  border: 1px solid rgba(23, 38, 61, 0.1);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(23, 38, 61, 0.03) 0%, rgba(23, 38, 61, 0.01) 100%);
  padding: 0.75rem;
}

.viewer-status {
  min-height: 1.4rem;
  font-size: 0.93rem;
  font-weight: 600;
  margin: 0 0 0.65rem;
}

.viewer-status[data-state="error"],
.form-status[data-state="error"] {
  color: #b42318;
}

.viewer-status[data-state="success"],
.form-status[data-state="success"] {
  color: #146c2e;
}

.viewer-status[data-state="loading"],
.form-status[data-state="loading"] {
  color: var(--wp-brand-dark);
}

.pdf-stage__scroller {
  min-height: 200px;
  overflow: auto;
  border-radius: 12px;
  background: linear-gradient(180deg, #dce6ff 0%, #edf3ff 100%);
  padding: 0.75rem;
}

.pdf-canvas {
  display: block;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 14px 30px rgba(20, 33, 61, 0.22);
}

.viewer-footer {
  padding: 0 0 1.2rem;
}

.viewer-footer__inner {
  color: var(--wp-muted);
  font-size: 0.92rem;
}

.gate-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.gate-modal[aria-hidden="true"] {
  display: none;
}

.gate-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 16, 31, 0.56);
  backdrop-filter: blur(4px);
}

.gate-modal__card {
  position: relative;
  width: min(560px, 100%);
  border-radius: var(--wp-radius);
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 52px rgba(20, 33, 61, 0.32);
  padding: clamp(1.1rem, 4vw, 1.6rem);
}

.gate-modal__kicker {
  margin: 0;
  color: var(--wp-brand-dark);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.gate-modal h2 {
  margin: 0.45rem 0 0.55rem;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  line-height: 1.3;
}

.gate-modal__copy {
  margin: 0;
  color: var(--wp-muted);
  line-height: 1.55;
}

#whitepaperAccessForm {
  margin-top: 1rem;
}

.field-group {
  display: grid;
  gap: 0.45rem;
}

.field-group label {
  font-size: 0.93rem;
  font-weight: 700;
}

.field-group input {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(23, 38, 61, 0.16);
  padding: 0.7rem 0.85rem;
  color: var(--wp-ink);
  background: #ffffff;
}

.field-group input:focus {
  outline: none;
  border-color: rgba(36, 87, 255, 0.36);
  box-shadow: 0 0 0 4px rgba(36, 87, 255, 0.14);
}

.field-group input[aria-invalid="true"] {
  border-color: rgba(180, 35, 24, 0.45);
}

.field-error {
  margin: 0;
  color: #b42318;
  font-size: 0.9rem;
}

.field-error[hidden] {
  display: none;
}

.form-status {
  min-height: 1.25rem;
  margin: 0.75rem 0 0;
  font-size: 0.92rem;
  font-weight: 600;
}

@media (max-width: 960px) {
  .viewer-toolbar {
    padding: 0.75rem;
  }

  .toolbar-track {
    gap: 0.4rem;
  }

  .toolbar-button,
  .toolbar-link,
  .toolbar-chip {
    min-height: 40px;
    padding: 0.45rem 0.65rem;
    font-size: 0.9rem;
  }

  .toolbar-button--icon,
  .toolbar-link--icon {
    width: 40px;
    padding: 0;
    font-size: 1.05rem;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100%, calc(100% - 1rem));
  }

  .viewer-shell__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .viewer-shell__header {
    padding-right: 2.8rem;
  }

  .viewer-download {
    width: 40px;
    min-height: 40px;
    font-size: 1.05rem;
  }

  .viewer-toolbar {
    padding: 0.55rem;
  }

  .toolbar-track {
    gap: 0.32rem;
  }

  .toolbar-button,
  .toolbar-link,
  .toolbar-chip {
    min-height: 36px;
    padding: 0.35rem 0.5rem;
    border-radius: 10px;
    font-size: 0.82rem;
  }

  .toolbar-button--icon,
  .toolbar-link--icon {
    width: 36px;
    padding: 0;
    font-size: 1rem;
  }

  .pdf-stage {
      padding: 0.4rem;
  }

  .pdf-stage__scroller {
      padding: 0.4rem;
  }

  .gate-modal {
    align-items: flex-end;
    padding: 0.65rem;
  }
}

@media (max-width: 640px) {
  .site-header .container {
    gap: 0.75rem;
  }

  .site-logo a {
    font-size: 1.2rem;
  }

  .site-logo img {
    height: 2rem;
  }

  .site-header .btn {
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
  }
}
