/* White paper dedicated preview tab.
   Displays only the PDF viewer and 2 buttons: Download and Send email.
   Arial font only. Text >= 14px. Phosphor icons. */

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: Arial, sans-serif;
  background: #525659;
  color: #0a2940;
  -webkit-font-smoothing: antialiased;
}

.wp-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
}

/* TOP TOOLBAR */
.wp-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
  padding: 0 24px;
  background: #ffffff;
  border-bottom: 1px solid #dbe5ea;
  flex: none;
  z-index: 10;
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.wp-brand-group {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex: 1;
}

.wp-logo-link {
  display: inline-flex;
  align-items: center;
  flex: none;
  text-decoration: none;
}

.wp-logo-link img {
  display: block;
  height: 28px;
  width: auto;
}

.wp-title-sep {
  width: 1px;
  height: 24px;
  background: #dbe5ea;
  flex: none;
}

.wp-title {
  font-size: 15px;
  font-weight: 700;
  color: #0a2940;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ACTIONS */
.wp-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.wp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 18px;
  border-radius: 6px;
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
  box-sizing: border-box;
  white-space: nowrap;
}

.wp-btn:focus-visible {
  outline: 3px solid rgba(0, 151, 214, 0.4);
  outline-offset: 2px;
}

.wp-btn:hover {
  transform: translateY(-1px);
}

.wp-btn:active {
  transform: translateY(0);
}

.wp-btn-download {
  background: #0097d6;
  color: #ffffff;
  border-color: #0097d6;
}

.wp-btn-download:hover {
  background: #007bb0;
  border-color: #007bb0;
  color: #ffffff;
}

.wp-btn-email {
  background: #ffffff;
  color: #0097d6;
  border-color: #0097d6;
}

.wp-btn-email:hover {
  background: #f0f8fd;
  color: #007bb0;
  border-color: #007bb0;
}

.wp-btn[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* PHOSPHOR ICON MASK */
.wp-icon {
  display: inline-block;
  flex: none;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  vertical-align: middle;
}

/* VIEWER AREA */
.wp-viewer-container {
  flex: 1;
  height: calc(100vh - 60px);
  width: 100%;
  position: relative;
  background: #525659;
  overflow: hidden;
}

.wp-pdf-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
  background: #525659;
}

/* FALLBACK / MOBILE */
.wp-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  padding: 32px 24px;
  background: #f4f8fa;
  color: #0a2940;
  box-sizing: border-box;
}

.wp-fallback-icon {
  width: 64px;
  height: 64px;
  color: #0097d6;
  margin-bottom: 16px;
}

.wp-fallback-icon .wp-icon {
  width: 64px;
  height: 64px;
}

.wp-fallback h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 10px;
  color: #0a2940;
}

.wp-fallback p {
  font-size: 15px;
  color: #5a6d7b;
  max-width: 480px;
  margin: 0 0 24px;
  line-height: 1.5;
}

.wp-fallback-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* LOADING & MISSING STATES */
.wp-loading, .wp-missing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  padding: 32px 24px;
  background: #f4f8fa;
  font-size: 16px;
  color: #0a2940;
  box-sizing: border-box;
}

.wp-missing h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 12px;
}

.wp-missing p {
  font-size: 15px;
  color: #5a6d7b;
  max-width: 440px;
  margin: 0 0 24px;
  line-height: 1.5;
}

/* EMAIL MODAL */
.wp-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 41, 64, 0.65);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  box-sizing: border-box;
}

.wp-modal-backdrop[hidden] {
  display: none;
}

.wp-modal-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  padding: 32px;
  box-sizing: border-box;
  animation: wpModalIn 0.2s ease-out;
}

@keyframes wpModalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.wp-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #5a6d7b;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.wp-modal-close:hover {
  background: #f0f4f8;
  color: #0a2940;
}

.wp-modal-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #e6f5fc;
  color: #0097d6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.wp-modal-badge .wp-icon {
  width: 24px;
  height: 24px;
}

.wp-modal-card h2 {
  font-size: 20px;
  font-weight: 700;
  color: #0a2940;
  margin: 0 0 8px;
}

.wp-modal-sub {
  font-size: 14px;
  color: #5a6d7b;
  line-height: 1.5;
  margin: 0 0 20px;
}

.wp-form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.wp-form-field label {
  font-size: 14px;
  font-weight: 700;
  color: #0a2940;
}

.wp-form-field input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid #c9d8e0;
  border-radius: 6px;
  font-size: 15px;
  font-family: Arial, sans-serif;
  color: #0a2940;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.wp-form-field input:focus {
  border-color: #0097d6;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 151, 214, 0.25);
}

.wp-form-field input[aria-invalid="true"] {
  border-color: #c62828;
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.2);
}

.wp-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.wp-modal-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
}

.wp-modal-status[hidden] {
  display: none;
}

.wp-modal-status.is-ok {
  background: #e8f6ee;
  color: #1b5e3a;
}

.wp-modal-status.is-error {
  background: #fdecec;
  color: #8e1c1c;
}

.wp-modal-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.wp-btn-cancel {
  background: #ffffff;
  color: #5a6d7b;
  border: 1px solid #dbe5ea;
  border-radius: 6px;
  padding: 8px 18px;
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  min-height: 40px;
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color 0.15s, color 0.15s;
}

.wp-btn-cancel:hover {
  background: #f4f8fa;
  color: #0a2940;
}

/* RESPONSIVE */
@media (max-width: 680px) {
  .wp-toolbar {
    padding: 0 14px;
    height: 54px;
  }
  .wp-toolbar-title,
  .wp-title-sep {
    display: none;
  }
  .wp-viewer-container {
    height: calc(100vh - 54px);
  }
  .wp-btn {
    padding: 6px 12px;
    min-height: 38px;
  }
  .wp-modal-card {
    padding: 24px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wp-btn, .wp-modal-card {
    transition: none;
    animation: none;
  }
}
