/* ══════════════════════════════════════
   JUNTAR PDFs — Estilos locais
   ══════════════════════════════════════ */

/* Garante que [hidden] funcione mesmo em elementos com display explícito no CSS */
[hidden] { display: none !important; }

:root {
  --pdf-accent:     #4338ca;
  --pdf-accent-dim: #3730a3;
  --pdf-accent-bg:  rgba(67, 56, 202, 0.07);
  --pdf-border:     #e2e8f0;
  --pdf-border2:    #f1f5f9;
  --pdf-surface:    #ffffff;
  --pdf-bg:         #f8fafc;
  --pdf-text:       #0f172a;
  --pdf-text2:      #475569;
  --pdf-text3:      #94a3b8;
  --pdf-mono:       'IBM Plex Mono', monospace;
  --pdf-sans:       'IBM Plex Sans', sans-serif;
  --pdf-radius:     6px;
  --pdf-shadow:     0 1px 3px rgba(0,0,0,0.07), 0 4px 16px rgba(0,0,0,0.05);
  --pdf-del:        #ef4444;
  --pdf-del-bg:     rgba(239,68,68,0.08);
  --pdf-warn:       #f59e0b;
}

/* ── HEADER ── */
.pdf-header {
  background: var(--pdf-accent);
  border-bottom: 3px solid #f59e0b;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pdf-header-logo-link {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: opacity 0.2s;
  color: inherit;
}
.pdf-header-logo-link:hover { opacity: 0.85; }

.pdf-header-logo {
  height: 44px;
  width: auto;
  display: block;
}

.pdf-header-title {
  font-family: 'Playfair Display', 'IBM Plex Sans', serif;
  color: #fff;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
  display: flex;
  flex-direction: column;
}
.pdf-header-title span {
  font-family: var(--pdf-mono);
  color: #f59e0b;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: -2px;
}

.pdf-header-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.pdf-header-badge {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.85);
  font-family: var(--pdf-mono);
  font-size: 0.68rem;
  padding: 3px 10px;
  border-radius: 2px;
  letter-spacing: 0.08em;
}

/* ── LAYOUT ── */
.pdf-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.pdf-col-main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pdf-col-side {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── CARDS ── */
.pdf-card {
  background: var(--pdf-surface);
  border: 1px solid var(--pdf-border);
  border-radius: var(--pdf-radius);
  padding: 1.5rem;
  box-shadow: var(--pdf-shadow);
}

.pdf-card--privacy {
  border-left: 3px solid var(--pdf-accent);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pdf-card-title {
  font-family: var(--pdf-sans);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--pdf-text);
  margin: 0 0 0.2rem;
}

.pdf-card-desc {
  font-family: var(--pdf-sans);
  font-size: 0.82rem;
  color: var(--pdf-text2);
  margin: 0 0 1.25rem;
  line-height: 1.6;
}
.pdf-card--privacy .pdf-card-desc { margin-bottom: 0; }

.pdf-divider {
  border: none;
  border-top: 1px solid var(--pdf-border2);
  margin: 1.25rem 0;
}

/* ── DROPZONE ── */
.pdf-dropzone {
  border: 2px dashed var(--pdf-border);
  border-radius: var(--pdf-radius);
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--pdf-bg);
  text-align: center;
  margin-bottom: 1.25rem;
}
.pdf-dropzone:hover,
.pdf-dropzone.drag-over {
  border-color: var(--pdf-accent);
  background: var(--pdf-accent-bg);
}
.pdf-dropzone:focus-visible {
  outline: 2px solid var(--pdf-accent);
  outline-offset: 2px;
}

.pdf-dropzone-icon { color: var(--pdf-text3); margin-bottom: 0.25rem; }
.pdf-dropzone:hover .pdf-dropzone-icon,
.pdf-dropzone.drag-over .pdf-dropzone-icon { color: var(--pdf-accent); }

.pdf-dropzone-text {
  font-family: var(--pdf-sans);
  font-size: 0.9rem;
  color: var(--pdf-text2);
  margin: 0;
}
.pdf-dropzone-link {
  color: var(--pdf-accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pdf-dropzone-hint {
  font-family: var(--pdf-mono);
  font-size: 0.7rem;
  color: var(--pdf-text3);
  margin: 0;
}

/* ── FILE LIST ── */
.pdf-file-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.pdf-file-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 4px;
  background: var(--pdf-bg);
  border: 1px solid var(--pdf-border2);
  cursor: grab;
  user-select: none;
  transition: background 0.15s, box-shadow 0.15s;
}
.pdf-file-item:active { cursor: grabbing; }
.pdf-file-item.dragging {
  opacity: 0.45;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.pdf-file-item.drag-target {
  border-color: var(--pdf-accent);
  background: var(--pdf-accent-bg);
}

.pdf-file-handle {
  color: var(--pdf-text3);
  font-size: 0.9rem;
  flex-shrink: 0;
  line-height: 1;
}

.pdf-file-icon {
  flex-shrink: 0;
  color: var(--pdf-del);
}

.pdf-file-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.pdf-file-name {
  font-family: var(--pdf-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--pdf-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-file-meta {
  font-family: var(--pdf-mono);
  font-size: 0.67rem;
  color: var(--pdf-text3);
}

.pdf-file-pages {
  font-family: var(--pdf-mono);
  font-size: 0.68rem;
  color: var(--pdf-accent);
  background: var(--pdf-accent-bg);
  border-radius: 3px;
  padding: 1px 7px;
  flex-shrink: 0;
  white-space: nowrap;
}

.pdf-file-del {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--pdf-text3);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 3px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.pdf-file-del:hover {
  color: var(--pdf-del);
  background: var(--pdf-del-bg);
}

/* ── CONTROLS ── */
.pdf-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* ── BUTTONS ── */
.pdf-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.25rem;
  background: var(--pdf-accent);
  color: #fff;
  border: none;
  border-radius: var(--pdf-radius);
  font-family: var(--pdf-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.pdf-btn-primary:hover  { background: var(--pdf-accent-dim); }
.pdf-btn-primary:active { transform: translateY(1px); }
.pdf-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.pdf-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  background: transparent;
  color: var(--pdf-accent);
  border: 1px solid var(--pdf-accent);
  border-radius: var(--pdf-radius);
  font-family: var(--pdf-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.pdf-btn-secondary:hover { background: var(--pdf-accent-bg); }

.pdf-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0;
  background: none;
  border: none;
  color: var(--pdf-text2);
  font-family: var(--pdf-mono);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s;
  margin-top: 1rem;
}
.pdf-btn-ghost:hover { color: var(--pdf-accent); }

/* ── PROGRESSO ── */
.pdf-progress-wrap {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pdf-progress-bar {
  height: 4px;
  background: var(--pdf-border2);
  border-radius: 2px;
  overflow: hidden;
}

.pdf-progress-fill {
  height: 100%;
  background: var(--pdf-accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.25s ease;
}

.pdf-progress-label {
  font-family: var(--pdf-mono);
  font-size: 0.72rem;
  color: var(--pdf-text2);
  margin: 0;
}

/* ── MENSAGEM ── */
.pdf-mensagem {
  font-family: var(--pdf-mono);
  font-size: 0.78rem;
  min-height: 1.2em;
  border-radius: var(--pdf-radius);
  padding: 0.5rem 0.75rem;
  line-height: 1.5;
  margin-top: 0.75rem;
}
.pdf-mensagem:empty { display: none; }
.pdf-mensagem.sucesso { color: var(--pdf-accent); background: var(--pdf-accent-bg); }
.pdf-mensagem.erro    { color: var(--pdf-del); background: var(--pdf-del-bg); }
.pdf-mensagem.aviso   { color: #92400e; background: rgba(245,158,11,0.1); }

/* ── SAVE OPTIONS ── */
.pdf-save-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.pdf-save-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--pdf-border);
  border-radius: var(--pdf-radius);
  background: var(--pdf-bg);
}

.pdf-save-option-icon {
  flex-shrink: 0;
  color: var(--pdf-text3);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--pdf-surface);
  border: 1px solid var(--pdf-border2);
}

.pdf-save-option-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.pdf-save-option-info strong {
  font-family: var(--pdf-sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--pdf-text);
}
.pdf-save-option-info span {
  font-family: var(--pdf-sans);
  font-size: 0.75rem;
  color: var(--pdf-text2);
}

/* ── PREVIEW ── */
.pdf-preview-wrap { display: flex; flex-direction: column; gap: 0.75rem; }

.pdf-preview-title {
  font-family: var(--pdf-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pdf-text2);
  margin: 0;
}

.pdf-preview-iframe {
  width: 100%;
  height: 480px;
  border: 1px solid var(--pdf-border);
  border-radius: var(--pdf-radius);
  background: var(--pdf-bg);
}

/* ── PRIVACY ICON ── */
.pdf-privacy-icon {
  color: var(--pdf-accent);
  margin-bottom: 0.25rem;
}

/* ── INFO LIST ── */
.pdf-info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0;
  padding: 0;
}

.pdf-info-list li {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}

.pdf-info-num {
  font-family: var(--pdf-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--pdf-accent);
  background: var(--pdf-accent-bg);
  border-radius: 3px;
  padding: 2px 7px;
  flex-shrink: 0;
  margin-top: 2px;
  letter-spacing: 0.04em;
}

.pdf-info-list li > div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.pdf-info-list li strong {
  font-family: var(--pdf-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--pdf-text);
}
.pdf-info-list li p {
  font-family: var(--pdf-sans);
  font-size: 0.78rem;
  color: var(--pdf-text2);
  margin: 0;
  line-height: 1.5;
}

/* ── FIELD ── */
.pdf-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.pdf-label {
  font-family: var(--pdf-mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--pdf-text2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pdf-input {
  width: 100%;
  font-family: var(--pdf-mono);
  font-size: 0.85rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--pdf-border);
  border-radius: var(--pdf-radius);
  background: var(--pdf-bg);
  color: var(--pdf-text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.pdf-input:focus {
  border-color: var(--pdf-accent);
  box-shadow: 0 0 0 2px rgba(67,56,202,0.14);
  background: #fff;
}

.pdf-hint {
  font-family: var(--pdf-mono);
  font-size: 0.68rem;
  color: var(--pdf-text3);
  margin-top: 0.1rem;
}

/* ── RESPONSIVO ── */
@media (max-width: 900px) {
  .pdf-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .pdf-header { padding: 0 1rem; height: auto; min-height: 56px; }
  .pdf-header-logo { height: 36px; }
  .pdf-header-badges { display: none; }
}

@media (max-width: 600px) {
  .pdf-controls { flex-direction: column; }
  .pdf-controls .pdf-btn-primary,
  .pdf-controls .pdf-btn-secondary { width: 100%; justify-content: center; }
  .pdf-save-option { flex-wrap: wrap; }
}
