/* ==========================================================================
   completeazaonline.ro — pdf-tools.css (2026-10-05)
   Stiluri comune pentru uneltele PDF (/unire-pdf, /jpg-in-pdf).
   Folosește token-urile din style.css (--c-*, --r-*, --shadow-*).
   ========================================================================== */

.pdft {
  max-width: 860px;
  margin: 0 auto;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 20px;
}
@media (min-width: 640px) { .pdft { padding: 28px; } }

/* ---- Zonă de încărcare ---- */
.pdft-dz {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 36px 20px;
  border: 2px dashed #b9dcf7;
  border-radius: var(--r-md);
  background: var(--c-accent-tint);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast), padding var(--t-base);
}
.pdft-dz:hover,
.pdft-dz:focus-within { border-color: var(--c-accent); background: var(--c-accent-soft); }
.pdft-dz.is-over { border-color: var(--c-accent-700); background: var(--c-accent-soft); }
.pdft-dz.is-compact { padding: 18px 16px; flex-direction: row; flex-wrap: wrap; }
.pdft-dz.is-compact .pdft-dz__hint { display: none; }
.pdft-dz.is-disabled { opacity: .5; pointer-events: none; }

.pdft-dz__icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: #fff;
  color: var(--c-accent-700);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}
.pdft-dz__icon svg { width: 26px; height: 26px; }
.pdft-dz.is-compact .pdft-dz__icon { width: 38px; height: 38px; border-radius: 10px; }
.pdft-dz.is-compact .pdft-dz__icon svg { width: 20px; height: 20px; }

.pdft-dz__title { font-weight: 600; font-size: 17px; color: var(--c-text); margin: 0; }
.pdft-dz__hint { font-size: 13.5px; color: var(--c-text-2); margin: 0; }
.pdft-dz__btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* input-ul real e ascuns vizual, dar accesibil (label-ul îl activează) */
.pdft-sr {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.pdft-pick {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 18px;
  border-radius: var(--r-sm);
  background: var(--c-accent-700);
  color: #fff;
  font-weight: 600; font-size: 14.5px;
  cursor: pointer;
  transition: background var(--t-fast);
}
.pdft-pick:hover { background: #0d5f9a; }
.pdft-pick svg { width: 17px; height: 17px; }
.pdft-pick--ghost { background: #fff; color: var(--c-accent-700); border: 1px solid #b9dcf7; }
.pdft-pick--ghost:hover { background: var(--c-accent-soft); }
/* butonul „Fă o poză” are sens doar pe telefon/tabletă */
@media (hover: hover) and (pointer: fine) { .pdft-pick--camera { display: none; } }

.pdft-privacy {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 14px 0 0;
  font-size: 13px; color: #065f46;
  background: var(--c-success-soft);
  border-radius: var(--r-sm);
  padding: 10px 12px;
}
.pdft-privacy svg { flex: 0 0 16px; width: 16px; height: 16px; margin-top: 2px; }

/* ---- Lista de fișiere ---- */
.pdft-work[hidden] { display: none; }
.pdft-work { margin-top: 20px; }

.pdft-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 10px;
  font-size: 13.5px; color: var(--c-text-2);
}
.pdft-bar button {
  background: none; border: 0; padding: 4px 6px;
  color: var(--c-text-2); font: inherit; font-size: 13px;
  text-decoration: underline; cursor: pointer;
}
.pdft-bar button:hover { color: var(--c-danger); }

.pdft-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.pdft-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: #fff;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
@media (hover: hover) { .pdft-item { cursor: grab; } }
.pdft-item.is-dragging { opacity: .45; }
.pdft-item.is-over { border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-soft); }
.pdft-item.is-error { border-color: #fecaca; background: var(--c-danger-soft); }
.pdft-item.is-error .pdft-item__meta { color: #b91c1c; }

.pdft-item__num {
  flex: 0 0 22px;
  font-size: 12px; font-weight: 700; color: var(--c-text-3);
  text-align: center;
}
.pdft-item__thumb {
  flex: 0 0 56px; width: 56px; height: 56px;
  border-radius: var(--r-sm);
  background: var(--c-bg-muted);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.pdft-item__thumb img { width: 100%; height: 100%; object-fit: contain; transition: transform var(--t-base); }
.pdft-rot-90  { transform: rotate(90deg); }
.pdft-rot-180 { transform: rotate(180deg); }
.pdft-rot-270 { transform: rotate(270deg); }
.pdft-item__ph { display: flex; flex-direction: column; align-items: center; color: #dc2626; }
.pdft-item__ph svg { width: 22px; height: 22px; }
.pdft-item__ph b { font-size: 10px; letter-spacing: .05em; }

.pdft-item__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.pdft-item__name {
  font-size: 14px; font-weight: 600; color: var(--c-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pdft-item__meta { font-size: 12.5px; color: var(--c-text-2); }

.pdft-item__actions { flex: 0 0 auto; display: flex; gap: 2px; }
.pdft-icon-btn {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--c-text-2);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.pdft-icon-btn svg { width: 17px; height: 17px; }
.pdft-icon-btn:hover:not(:disabled) { background: var(--c-bg-muted); color: var(--c-text); }
.pdft-icon-btn--danger:hover:not(:disabled) { background: var(--c-danger-soft); color: #b91c1c; }
.pdft-icon-btn:disabled { opacity: .3; cursor: default; }
.pdft-icon-btn:focus-visible { outline: 2px solid var(--c-accent-700); outline-offset: 1px; }

@media (max-width: 480px) {
  .pdft-item { flex-wrap: wrap; }
  .pdft-item__num { display: none; }
  .pdft-item__body { flex-basis: calc(100% - 70px); }
  .pdft-item__actions { width: 100%; justify-content: flex-end; border-top: 1px solid var(--c-border-soft); padding-top: 4px; }
}

/* ---- Opțiuni ---- */
.pdft-options {
  margin-top: 20px;
  display: grid; gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .pdft-options { grid-template-columns: 1fr 1fr; } }

.pdft-opt { border: 0; margin: 0; padding: 0; min-width: 0; }
.pdft-opt legend, .pdft-label {
  display: block;
  font-size: 12px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--c-text-2);
  margin-bottom: 8px; padding: 0;
}
.pdft-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.pdft-seg label { position: relative; flex: 1 1 auto; }
.pdft-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pdft-seg span {
  display: block; text-align: center;
  padding: 8px 10px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-bg-muted);
  font-size: 13.5px; font-weight: 500; color: var(--c-text-1);
  transition: all var(--t-fast);
}
.pdft-seg span small { display: block; font-size: 11.5px; font-weight: 400; color: var(--c-text-2); }
.pdft-seg input:checked + span { border-color: var(--c-accent-700); background: var(--c-accent-soft); color: #0d5f9a; font-weight: 600; }
.pdft-seg input:focus-visible + span { outline: 2px solid var(--c-accent-700); outline-offset: 1px; }

.pdft-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--c-text-1); cursor: pointer; }
.pdft-check input { width: 18px; height: 18px; accent-color: var(--c-accent-700); }

/* ---- Acțiune ---- */
.pdft-run {
  margin-top: 20px;
  display: grid; gap: 12px;
  grid-template-columns: 1fr;
  align-items: end;
}
@media (min-width: 640px) { .pdft-run { grid-template-columns: 1fr auto; } }
.pdft-name { display: flex; align-items: center; gap: 0; }
.pdft-name .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.pdft-name__ext {
  height: 44px; display: inline-flex; align-items: center;
  padding: 0 12px;
  border: 1px solid var(--c-border); border-left: 0;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--c-bg-muted); color: var(--c-text-2); font-size: 14px;
}
.pdft-run .btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }

.pdft-status { min-height: 20px; margin: 12px 0 0; font-size: 13.5px; color: var(--c-text-2); }
.pdft-progress { height: 6px; margin-top: 10px; border-radius: 3px; background: var(--c-bg-muted); overflow: hidden; }
.pdft-progress[hidden] { display: none; }
.pdft-progress div { height: 100%; width: 0; background: var(--c-accent-700); transition: width .2s; }

.pdft-error {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--c-danger-soft);
  color: #b91c1c;
  font-size: 13.5px;
}
.pdft-error[hidden] { display: none; }

.pdft-result {
  margin-top: 16px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 14px 16px;
  border: 1px solid #a7f3d0;
  border-radius: var(--r-md);
  background: var(--c-success-soft);
}
.pdft-result[hidden] { display: none; }
.pdft-result__text { flex: 1 1 260px; margin: 0; font-size: 14px; color: #065f46; }
.pdft-result__text strong { display: block; font-size: 15px; }

.is-busy .pdft-dz,
.is-busy .pdft-list,
.is-busy .pdft-options { pointer-events: none; opacity: .6; }

/* ---- Conținut editorial ---- */
.pdft-prose { max-width: 760px; margin: 0 auto; color: var(--c-text-1); }
.pdft-prose h2 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); font-weight: 600; letter-spacing: -.02em; margin: 40px 0 12px; color: var(--c-text); }
.pdft-prose h2:first-child { margin-top: 0; }
.pdft-prose h3 { font-size: 1.1rem; font-weight: 600; margin: 24px 0 8px; color: var(--c-text); }
.pdft-prose p, .pdft-prose li { font-size: 16px; line-height: 1.7; }
.pdft-prose ul, .pdft-prose ol { padding-left: 22px; }
.pdft-prose li { margin-bottom: 6px; }
.pdft-prose a { color: var(--c-accent-700); text-decoration: underline; text-underline-offset: 2px; }
.pdft-note {
  border-left: 3px solid var(--c-warning);
  background: var(--c-warning-soft);
  padding: 12px 16px;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  margin: 18px 0;
}
.pdft-table-wrap { overflow-x: auto; margin: 16px 0; }
.pdft-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.pdft-table th, .pdft-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--c-border); vertical-align: top; }
.pdft-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--c-text-2); background: var(--c-bg-muted); }

/* FAQ nativ <details> */
.pdft-faq { max-width: 760px; margin: 0 auto; display: grid; gap: 10px; }
.pdft-faq details { border: 1px solid var(--c-border); border-radius: var(--r-md); background: #fff; }
.pdft-faq summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px 18px; font-weight: 600; color: var(--c-text);
}
.pdft-faq summary::-webkit-details-marker { display: none; }
.pdft-faq summary::after { content: '+'; font-size: 22px; font-weight: 400; color: var(--c-text-3); line-height: 1; }
.pdft-faq details[open] summary::after { content: '−'; }
.pdft-faq details > div { padding: 0 18px 16px; color: var(--c-text-2); line-height: 1.7; }
.pdft-faq details > div p { margin: 0; }

/* Carduri „alte unelte” */
.pdft-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; max-width: 900px; margin: 0 auto; }
.pdft-link {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px; border: 1px solid var(--c-border); border-radius: var(--r-md);
  background: #fff; color: var(--c-text); text-decoration: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.pdft-link:hover { border-color: var(--c-accent); box-shadow: var(--shadow-sm); }
.pdft-link svg { flex: 0 0 22px; width: 22px; height: 22px; color: var(--c-accent-700); }
.pdft-link strong { display: block; font-size: 15px; }
.pdft-link small { display: block; font-size: 13px; color: var(--c-text-2); margin-top: 2px; }

/* ==========================================================================
   v2 (2026-10-05) — comprimare, organizare pagini, semnare, hub
   ========================================================================== */

/* ---- Fișier unic încărcat (comprimare / organizare / semnare) ---- */
.pdft-file {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--c-border); border-radius: var(--r-md);
  background: #fff;
}
.pdft-file .pdft-item__ph { flex: 0 0 40px; }
.pdft-file__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.pdft-file__body strong { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdft-file__body span { font-size: 13px; color: var(--c-text-2); }
.pdft-keep {
  margin: 12px 0 0; padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--c-warning-soft); color: #92400e; font-size: 13.5px;
}
.pdft-keep[hidden] { display: none; }
.pdft-options--one { grid-template-columns: 1fr; }

/* ---- Organizare pagini ---- */
.pdfp-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: 16px 0 12px;
  font-size: 13.5px; color: var(--c-text-2);
}
.pdfp-toolbar__info { margin-right: auto; font-weight: 600; color: var(--c-text-1); }
.pdfp-chip {
  border: 1px solid var(--c-border); background: #fff; color: var(--c-text-1);
  border-radius: var(--r-pill); padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer;
}
.pdfp-chip:hover { border-color: var(--c-accent); background: var(--c-accent-tint); }
.pdfp-chip--danger:hover { border-color: #fca5a5; background: var(--c-danger-soft); color: #b91c1c; }

.pdfp-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
@media (max-width: 420px) { .pdfp-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; } }
.pdfp-card {
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px;
  border: 1px solid var(--c-border); border-radius: var(--r-md);
  background: #fff;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
@media (hover: hover) { .pdfp-card { cursor: grab; } }
.pdfp-card.is-selected { border-color: var(--c-accent-700); box-shadow: 0 0 0 3px var(--c-accent-soft); }
.pdfp-card.is-dragging { opacity: .45; }
.pdfp-card.is-over { border-color: var(--c-accent); border-style: dashed; }
.pdfp-card__sel {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.92); border-radius: var(--r-xs); padding: 2px 6px;
  font-size: 12px; font-weight: 700; color: var(--c-text-1); cursor: pointer;
  box-shadow: var(--shadow-xs);
}
.pdfp-card__sel input { width: 16px; height: 16px; margin: 0; accent-color: var(--c-accent-700); }
.pdfp-card__thumb {
  aspect-ratio: 1 / 1; width: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--c-bg-muted); border-radius: var(--r-sm); overflow: hidden;
}
.pdfp-card__thumb img {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  box-shadow: 0 1px 4px rgba(15,23,42,.15);
  transition: transform var(--t-base);
}
.pdfp-card__thumb img[src^="data:image/gif"] { width: 70%; height: 90%; background: #fff; }
.pdfp-card__orig { font-size: 11.5px; color: var(--c-text-3); text-align: center; }
.pdfp-card__actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 0; }
.pdfp-card__actions .pdft-icon-btn { width: 30px; height: 30px; }
.pdfp-card__actions .pdft-icon-btn svg { width: 15px; height: 15px; }

.pdfp-save { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* ---- Semnare ---- */
.pdfs-tools {
  display: grid; gap: 16px; grid-template-columns: 1fr;
  margin-top: 18px;
}
@media (min-width: 800px) { .pdfs-tools { grid-template-columns: 3fr 2fr; } }
.pdfs-box {
  border: 1px solid var(--c-border); border-radius: var(--r-md);
  padding: 14px; background: #fff;
}
.pdfs-box h3 { font-size: 15px; font-weight: 600; margin: 0 0 10px; color: var(--c-text); }
.pdfs-pad {
  display: block; width: 100%; height: auto; aspect-ratio: 3 / 1;
  border: 1px dashed #b9dcf7; border-radius: var(--r-sm);
  background: repeating-linear-gradient(0deg, transparent 0 74%, #e8f4fe 74% 75%, transparent 75% 100%), #fff;
  touch-action: none; cursor: crosshair;
}
.pdfs-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.pdfs-row .input, .pdfs-row .select { flex: 1 1 140px; min-width: 0; }
.pdfs-ink { display: inline-flex; gap: 6px; margin-right: auto; }
.pdfs-ink label { position: relative; cursor: pointer; }
.pdfs-ink input { position: absolute; opacity: 0; }
.pdfs-ink span { display: block; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--c-border); }
.pdfs-ink input:checked + span { box-shadow: 0 0 0 2px var(--c-accent-700); }
.pdfs-ink input:focus-visible + span { outline: 2px solid var(--c-accent-700); outline-offset: 2px; }
.pdfs-or { font-size: 12.5px; color: var(--c-text-3); margin: 12px 0 0; }
.pdfs-upload { font-size: 13.5px; color: var(--c-accent-700); text-decoration: underline; cursor: pointer; }

.pdfs-stamps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pdfs-stamps[hidden] { display: none; }
.pdfs-stamp { position: relative; }
.pdfs-stamp__pick {
  height: 52px; min-width: 70px; max-width: 200px; padding: 6px 10px;
  border: 1px solid var(--c-border); border-radius: var(--r-sm); background: #fff; cursor: pointer;
}
.pdfs-stamp__pick img { max-height: 38px; max-width: 180px; display: block; }
.pdfs-stamp.is-active .pdfs-stamp__pick { border-color: var(--c-accent-700); box-shadow: 0 0 0 3px var(--c-accent-soft); }
.pdfs-stamp__del {
  position: absolute; top: -8px; right: -8px;
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--c-border); background: #fff; color: var(--c-text-2);
  font-size: 15px; line-height: 1; cursor: pointer;
}
.pdfs-stamp__del:hover { color: #b91c1c; border-color: #fca5a5; }

.pdfs-hint {
  margin: 16px 0 12px; padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--c-bg-muted); color: var(--c-text-2); font-size: 13.5px;
}
.pdfs-hint.is-ready { background: var(--c-accent-soft); color: #0d5f9a; font-weight: 500; }

.pdfs-pages {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: 16px 8px; border-radius: var(--r-md); background: #e9edf2;
}
.pdfs-page-wrap { width: 100%; max-width: 700px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pdfs-page {
  position: relative; width: 100%;
  background: #fff; box-shadow: 0 2px 10px rgba(15,23,42,.15);
  user-select: none; -webkit-user-select: none;
}
.pdfs-pages.is-placing .pdfs-page { cursor: copy; }
.pdfs-canvas { display: block; width: 100%; height: 100%; }
.pdfs-page-num { font-size: 12px; color: var(--c-text-2); }
.pdfs-place {
  position: absolute; z-index: 2;
  outline: 1.5px dashed var(--c-accent-700); outline-offset: 2px;
  cursor: move; touch-action: none;
}
.pdfs-place img { display: block; width: 100%; height: auto; pointer-events: none; }
.pdfs-place.is-active { outline-style: solid; }
.pdfs-place__del {
  position: absolute; top: -12px; right: -12px;
  width: 24px; height: 24px; border-radius: 50%;
  border: 0; background: #dc2626; color: #fff; font-size: 15px; line-height: 1; cursor: pointer;
}
.pdfs-place__resize {
  position: absolute; right: -8px; bottom: -8px;
  width: 16px; height: 16px; border-radius: 4px;
  background: var(--c-accent-700); border: 2px solid #fff; cursor: nwse-resize;
}
.pdfs-save { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.pdfs-save span { margin-right: auto; font-size: 13.5px; color: var(--c-text-2); }

/* ---- Hub /unelte-pdf ---- */
.pdft-hub { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); max-width: 1000px; margin: 0 auto; }
.pdft-hub .pdft-link { padding: 20px; flex-direction: column; gap: 10px; }
.pdft-hub .pdft-link svg { width: 28px; height: 28px; }
.pdft-hub .pdft-link strong { font-size: 17px; }
.pdft-hub .pdft-link small { font-size: 14px; line-height: 1.55; }
