.protected-pdf {
  margin: 1.25rem 0 2rem;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  background: var(--white-color, #ffffff);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.04));
  color: var(--text-color, #2c3e50);
  overflow: hidden;
  user-select: none;
}

.protected-pdf__header {
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  background: var(--secondary-bg, #f5f5f5);
}

.protected-pdf__title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
}

.protected-pdf__meta {
  margin: 0;
  color: var(--text-muted, #6b7280);
  font-size: 0.92rem;
}

.protected-pdf__form {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  align-items: center;
}

.protected-pdf__password {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 6px;
  background: var(--bg-color, #fafafa);
  color: var(--text-color, #2c3e50);
  font: inherit;
  padding: 0.62rem 0.75rem;
}

.protected-pdf__password:focus {
  border-color: var(--theme-color, #1a1a1a);
  outline: 2px solid rgba(178, 34, 34, 0.16);
  outline-offset: 1px;
}

.protected-pdf__button {
  flex: 0 0 auto;
  border: 1px solid var(--theme-color, #1a1a1a);
  border-radius: 6px;
  background: var(--theme-color, #1a1a1a);
  color: var(--white-color, #ffffff);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 0.62rem 1rem;
}

.protected-pdf__button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.protected-pdf__status {
  margin: 0;
  min-height: 1.4rem;
  padding: 0 1rem 1rem;
  color: var(--text-muted, #6b7280);
  font-size: 0.92rem;
}

.protected-pdf__status--error {
  color: #b22222;
}

.protected-pdf__status--success {
  color: #2e7d32;
}

.protected-pdf__status--loading {
  color: var(--text-muted, #6b7280);
}

.protected-pdf__pages {
  display: grid;
  gap: 1rem;
  padding: 0 1rem 1rem;
}

.protected-pdf__page {
  margin: 0;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 6px;
  background: var(--bg-color, #fafafa);
  overflow: hidden;
}

.protected-pdf__image {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
}

.protected-pdf__page figcaption {
  border-top: 1px solid var(--border-color, #e5e7eb);
  color: var(--text-muted, #6b7280);
  font-size: 0.82rem;
  padding: 0.4rem 0.6rem;
  text-align: right;
}

@media (max-width: 640px) {
  .protected-pdf__form {
    align-items: stretch;
    flex-direction: column;
  }

  .protected-pdf__button {
    width: 100%;
  }
}

@media print {
  .protected-pdf__pages {
    display: none;
  }

  .protected-pdf::after {
    content: "Protected preview is not available for printing.";
    display: block;
    padding: 1rem;
  }
}
