/* PDF Combine & Split – based on PDF Compress (../PDFCompressTool/static/style.css);
   colours, fonts, tool bar and theme come from ../shared/rm-tools.css */
* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}
main.container { padding: 28px 20px 60px; }

.pdf-mark { font: 700 .62rem var(--rm-mono); letter-spacing: .02em; }

/* Hero band */
.pdf-hero { padding: 40px 0 34px; }
.pdf-hero h1 { margin: 0 0 8px; font-size: clamp(2rem, 5vw, 2.9rem); line-height: 1.08; }
.pdf-hero p { margin: 0; max-width: 560px; }

.card {
  background: var(--rm-surface);
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--rm-shadow-sm);
}
.card h2 {
  margin: 0 0 14px;
  font-size: 1.35rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--rm-radius-sm);
  background: var(--rm-primary);
  color: var(--rm-primary-ink);
  font: 600 .8rem var(--rm-mono);
}

.dropzone {
  border: 2px dashed var(--rm-border);
  border-radius: var(--rm-radius);
  padding: 28px;
  text-align: center;
  color: var(--rm-muted);
  background: var(--rm-surface-2);
  transition: background 0.15s, border-color 0.15s;
}
.dropzone.is-dragover {
  background: var(--rm-primary-soft);
  border-color: var(--rm-primary);
}
.dropzone p { margin: 0 0 12px; }
.drop-icon { width: 34px; height: 34px; margin-bottom: 6px; fill: none; stroke: var(--rm-primary); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* The file input stays focusable (keyboard users tab to it) but is invisible; the label is the button */
.visually-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.browse-btn { position: relative; }
.browse-btn:focus-within { outline: 2px solid var(--rm-primary); outline-offset: 2px; }

.btn--large { padding: 12px 26px; font-size: 1rem; min-height: 46px; }
.btn--small { padding: 6px 12px; font-size: 0.82rem; min-height: 32px; }
.rm-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.file-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius);
  overflow: hidden;
}
.file-list:empty { display: none; }
.file-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  font-size: 0.9rem;
  word-break: break-all;
}
.file-list li:nth-child(odd) { background: var(--rm-surface); }
.file-list li:nth-child(even) { background: var(--rm-surface-2); }
.file-list li > span:last-child { display: flex; align-items: center; flex-shrink: 0; }
.file-list .file-size { color: var(--rm-primary); margin-right: 14px; font: .82rem var(--rm-mono); white-space: nowrap; }
.file-list .remove-btn {
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: var(--rm-radius-sm);
  background: none;
  color: var(--rm-danger);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
}
.file-list .remove-btn:hover { border-color: var(--rm-danger); }

.level-select { display: flex; gap: 10px; }
.level-btn {
  flex: 1;
  border: 1px solid var(--rm-border);
  background: var(--rm-surface);
  border-radius: var(--rm-radius);
  padding: 12px 10px;
  cursor: pointer;
  font: 700 1.1rem var(--rm-head);
  letter-spacing: .03em;
  color: var(--rm-text);
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: border-color .15s, background .15s;
}
.level-btn span { font: 400 0.76rem var(--rm-body); letter-spacing: 0; color: var(--rm-muted); }
.level-btn:hover { border-color: var(--rm-primary); }
.level-btn.is-active { border-color: var(--rm-primary); background: var(--rm-primary-soft); box-shadow: inset 0 0 0 1px var(--rm-primary); }
.level-btn.is-active span { color: var(--rm-text); }

.action-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.status-msg { font-size: 0.9rem; color: var(--rm-primary); }
.status-msg.is-error { color: var(--rm-danger); }


@media (max-width: 560px) {
  .card { padding: 16px; }
  .file-list li { flex-wrap: wrap; }
  .file-list .file-name { flex-basis: calc(100% - 40px); }
  .file-actions { margin-left: auto; }
  .level-select { flex-direction: column; }
  .action-row .btn--large { width: 100%; }
}

/* ---------- Combine & Split additions ---------- */
.dropzone[hidden] { display: none; }
.drop-meta { margin: 12px 0 0 !important; font: .78rem var(--rm-mono); color: var(--rm-muted); }

.list-hint { margin: 14px 0 0; font-size: .85rem; color: var(--rm-muted); }
.file-list .file-num { font: 600 .78rem var(--rm-mono); color: var(--rm-muted); flex-shrink: 0; }
.file-list .file-name { flex: 1; min-width: 0; }
.file-list li[draggable="true"] { cursor: grab; }
.file-list li.is-dragging { opacity: .45; }
.file-list li.is-over { box-shadow: inset 0 2px 0 var(--rm-primary); background: var(--rm-primary-soft); }
.file-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.row-btn {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius-sm);
  background: var(--rm-surface);
  color: var(--rm-text);
  cursor: pointer;
  padding: 0;
}
.row-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.row-btn:hover:not(:disabled) { border-color: var(--rm-primary); color: var(--rm-primary); }
.row-btn:disabled { opacity: .35; cursor: default; }
.row-btn.is-remove { color: var(--rm-danger); margin-left: 4px; }
.row-btn.is-remove:hover { border-color: var(--rm-danger); color: var(--rm-danger); }

.pages-field { margin-top: 18px; }
.pages-field label { display: block; font-weight: 600; margin-bottom: 6px; }
.pages-field input {
  width: 100%;
  max-width: 420px;
  padding: 10px 12px;
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius);
  background: var(--rm-surface);
  color: var(--rm-text);
  font: 1rem var(--rm-mono);
}
.pages-field input:focus { outline: 2px solid var(--rm-primary); outline-offset: 1px; border-color: var(--rm-primary); }
.field-help { margin: 8px 0 0; font-size: .85rem; color: var(--rm-muted); }

.privacy-note { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--rm-muted); margin: 0; }
.privacy-note svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: var(--rm-success); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
