@charset "UTF-8";
/* =====================================================================
   Vizualizator PDF încorporat
   ===================================================================== */

.pdfv {
  margin: 2rem 0;
  border: 1px solid var(--border, #E3E7EE);
  border-radius: var(--radius-lg, 16px);
  background: #fff;
  overflow: hidden;
}

/* Starea fără JavaScript / înainte de inițializare: doar link-ul de descărcare */
.pdfv__fallback {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 1.4rem 1.5rem;
}
.pdfv__fallback-icon {
  width: 46px; height: 46px; flex: none; border-radius: 10px;
  display: grid; place-items: center;
  background: #FDECEA; color: #C0392B;
  font-size: .68rem; font-weight: 700; letter-spacing: .04em;
}
.pdfv__fallback-body { flex: 1; min-width: 190px; }
.pdfv__fallback-title {
  display: block; font-weight: 600; color: var(--heading, #1D2433);
  font-size: .97rem; line-height: 1.4; overflow-wrap: anywhere;
}
.pdfv__fallback-meta { font-size: .8rem; color: var(--muted, #6F7380); }

/* După inițializare ascundem link-ul din antet — rămâne în bara de unelte */
.pdfv.is-ready .pdfv__fallback { display: none; }
.pdfv.is-failed .pdfv__fallback { display: flex; }

/* ---------- Bara de unelte ---------- */
.pdfv__bar {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  padding: .55rem .7rem;
  background: var(--navy, #1B3C74);
  color: #fff;
}

.pdfv__group { display: flex; align-items: center; gap: .2rem; }
.pdfv__group--right { margin-left: auto; }

.pdfv__btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; padding: 0;
  background: transparent; border: 0; border-radius: 7px;
  color: #fff; cursor: pointer;
  transition: background .16s ease;
}
.pdfv__btn:hover { background: rgba(255, 255, 255, .17); color: #fff; }
.pdfv__btn:disabled { opacity: .4; cursor: default; }
a.pdfv__btn:hover { text-decoration: none; }

.pdfv__page-input {
  width: 48px; padding: .25rem .3rem;
  font: inherit; font-size: .84rem; text-align: center;
  color: #fff; background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22); border-radius: 6px;
  -moz-appearance: textfield;
}
.pdfv__page-input::-webkit-outer-spin-button,
.pdfv__page-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pdfv__page-input:focus { outline: 2px solid var(--coral, #F26247); outline-offset: 1px; }

.pdfv__page-total,
.pdfv__zoom {
  font-size: .82rem; color: #C6D4EC; white-space: nowrap;
  min-width: 2.6rem; text-align: center;
}

.pdfv__title {
  font-size: .84rem; color: #C6D4EC;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 34ch; padding-inline: .4rem;
}
@media (max-width: 760px) { .pdfv__title { display: none; } }

/* ---------- Zona documentului ---------- */
.pdfv__stage {
  height: min(74vh, 860px);
  overflow-y: auto; overflow-x: auto;
  background: #E9EDF4;
  padding: 1rem;
  scroll-behavior: smooth;
}
.pdfv__stage:focus-visible { outline: 3px solid var(--coral, #F26247); outline-offset: -3px; }

@media (prefers-reduced-motion: reduce) { .pdfv__stage { scroll-behavior: auto; } }

.pdfv__page {
  position: relative;
  margin: 0 auto 1rem;
  width: max-content; max-width: 100%;
  box-shadow: 0 2px 10px rgba(23, 43, 77, .16);
  background: #fff;
}
.pdfv__page:last-child { margin-bottom: 0; }

.pdfv__canvas { display: block; max-width: 100%; height: auto; }

.pdfv__skeleton {
  display: grid; place-items: center;
  min-height: 420px; width: min(680px, 100%);
  background: repeating-linear-gradient(
    -45deg, #F4F6FA, #F4F6FA 12px, #EDF1F7 12px, #EDF1F7 24px);
  color: #9AA6BC; font-size: .84rem;
}

.pdfv__status {
  margin: 0; padding: 2.5rem 1rem; text-align: center;
  color: var(--muted, #6F7380); font-size: .9rem;
}
.pdfv__status--error { color: #8C261A; background: #FDECEA; padding: 1rem; }

/* ---------- Stratul de text (selectare, căutare, cititoare de ecran) ---------- */
.pdfv__text {
  position: absolute; inset: 0;
  overflow: hidden;
  opacity: .01;               /* invizibil, dar selectabil și citibil */
  line-height: 1;
  text-align: initial;
  forced-color-adjust: none;
}
.pdfv__text > span {
  position: absolute;
  white-space: pre;
  cursor: text;
  transform-origin: 0 0;
  color: transparent;
}
.pdfv__text ::selection { background: rgba(42, 81, 153, .32); }

/* ---------- Ecran complet ---------- */
.pdfv.is-fullscreen { border: 0; border-radius: 0; display: flex; flex-direction: column; }
.pdfv.is-fullscreen .pdfv__stage { height: auto; flex: 1; }

/* ---------- Fereastră suprapusă (din listele de documente) ---------- */
.pdfv-modal {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(12, 22, 42, .82);
  display: grid; place-items: center;
  padding: clamp(.6rem, 3vw, 2rem);
}
.pdfv-modal__box {
  position: relative;
  width: min(100%, 1000px);
  max-height: 94vh;
  display: flex; flex-direction: column;
}
.pdfv-modal__box .pdfv { margin: 0; width: 100%; }
.pdfv-modal__box .pdfv__stage { height: min(80vh, 900px); }

.pdfv-modal__close {
  position: absolute; top: -46px; right: 0;
  width: 38px; height: 38px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .16); color: #fff;
  border: 0; border-radius: 50%; cursor: pointer;
  transition: background .16s ease;
}
.pdfv-modal__close:hover { background: rgba(255, 255, 255, .3); }
@media (max-height: 620px) {
  .pdfv-modal__close { top: .4rem; right: .4rem; background: rgba(0, 0, 0, .5); }
}

/* ---------- Butonul „Previzualizează” din listele de documente ---------- */
/* Butonul stă lângă link, nu în interiorul lui: două comenzi separate
   nu se pot cuibări una în alta (și ar deruta cititoarele de ecran). */
.doc-row { display: flex; gap: .5rem; align-items: stretch; }
.doc-row .doc-item { flex: 1; min-width: 0; }

.doc-item__preview {
  flex: none; display: grid; place-items: center;
  width: 46px; border-radius: var(--radius, 10px);
  border: 1px solid var(--border, #E3E7EE);
  background: #fff; color: var(--navy, #1B3C74);
  cursor: pointer; transition: border-color .16s ease, background .16s ease, color .16s ease;
}
.doc-item__preview:hover {
  border-color: var(--coral, #F26247);
  background: var(--coral-050, #FEF1EE);
  color: var(--coral, #F26247);
}
@media (max-width: 520px) {
  .doc-item__preview { width: 40px; }
}

/* ---------- Tipărire ---------- */
@media print {
  .pdfv__bar, .pdfv-modal { display: none !important; }
  .pdfv__stage { height: auto; overflow: visible; background: #fff; padding: 0; }
  .pdfv__page { box-shadow: none; break-inside: avoid; }
}
