/* ============================================================
   Pagina "Module" — catalog vizual al modulelor DocManager
   Extinde design system-ul din style.css (tokens, .hero, .cat-icon,
   .btn-brand/.btn-ghost, .empty-state, accent-* rămân neschimbate)
   ============================================================ */

/* ---- hero: conținut deasupra cloud-ului de tag-uri ---- */
.hero-content {
  position: relative; z-index: 1;
  min-height: 230px;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center;
}

/* ---- tag cloud de fundal (avantaje digitalizare), pe mai multe rânduri, în spatele textului ---- */
.tag-cloud-bg {
  position: absolute; inset: 0; z-index: 0; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; gap: 8px;
  pointer-events: none;
}
.tag-row {
  flex: none;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}
.tag-row .tag-track {
  display: flex; width: max-content; gap: 8px;
  animation-name: tag-scroll; animation-timing-function: linear; animation-iteration-count: infinite;
}
.tag-row.rev .tag-track { animation-direction: reverse; }
.tag-row:nth-child(odd) .tag-pill { opacity: .32; }
.tag-row:nth-child(even) .tag-pill { opacity: .22; }
.tag-pill {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: 11.5px; font-weight: 500; padding: 6px 12px; border-radius: 999px;
  background: var(--bs-body-bg); border: 1px solid var(--bs-border-color);
  color: var(--bs-secondary-color); box-shadow: var(--shadow-sm);
}
.tag-pill i { color: var(--brand); }
@keyframes tag-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .tag-row .tag-track { animation: none; }
}
@media (max-width: 767.98px) {
  .tag-cloud-bg { gap: 6px; }
  .tag-pill { font-size: 10.5px; padding: 5px 10px; }
}

/* ---- secțiunea "De ce DocManager?" ---- */
.why-section { position: relative; z-index: 1; padding: 3.25rem 0 2.5rem; }
.why-head .eyebrow { justify-content: center; }
.why-head p { color: var(--bs-secondary-color); font-size: 14.5px; max-width: 42rem; margin: 0 auto; }
.why-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(2, 1fr);
  margin-top: 2.25rem;
}
.why-card {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 14px;
  background: linear-gradient(160deg, var(--c-soft), var(--bs-body-bg) 60%);
  border: 1px solid color-mix(in srgb, var(--c) 22%, var(--bs-border-color));
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.6rem 1.5rem;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
/* halou discret de accent în colțul cardului */
.why-card::before {
  content: ""; position: absolute; top: -50px; right: -50px;
  width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, var(--c-soft) 0%, transparent 70%);
  pointer-events: none;
}
.why-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--c) 35%, var(--bs-border-color));
}
.why-ico {
  width: 46px; height: 46px; border-radius: 14px; flex: none;
  display: grid; place-items: center; font-size: 22px;
  background: var(--c); color: #fff;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--c) 35%, transparent);
  margin-bottom: 0;
}
.why-card h3 { font-size: 15.5px; font-weight: 600; line-height: 1.35; margin-bottom: 0; }
.why-list { grid-column: 1 / -1; list-style: none; margin: 1.05rem 0 0; padding: 0; display: grid; gap: 8px; }
.why-list li {
  position: relative; padding-left: 20px;
  font-size: 13.5px; line-height: 1.55; color: var(--bs-secondary-color);
}
.why-list li::before {
  content: ""; position: absolute; left: 3px; top: 7px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--c, var(--brand));
}

@media (max-width: 767.98px) {
  .why-grid { grid-template-columns: 1fr; }
  .why-section { padding-top: 2.5rem; }
}

/* ---- dialogul configuratorului ---- */
#configuratorModal .modal-body { overflow: hidden; }
#configurator-frame { display: block; width: 100%; height: 100%; border: 0; background: var(--bs-body-bg); }

/* ---- dialogul schemei de integrare ---- */
#integrareModal .modal-body { overflow: hidden; }
#integrare-frame { display: block; width: 100%; height: 100%; border: 0; background: var(--bs-body-bg); }

/* ---- filter bar ---- */
.filter-bar {
  position: sticky; top: 57px; z-index: 5;
  background: color-mix(in srgb, var(--bs-body-bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--bs-border-color);
  padding: 12px 0;
}
.filter-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 10px;
}
.filter-groups {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 10px 16px;
}
.filter-group { display: flex; align-items: center; gap: 10px; }
.filter-group-label {
  font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--bs-secondary-color); flex: none;
}
.filter-sep { width: 1px; height: 24px; background: var(--bs-border-color); flex: none; }
.filter-search {
  position: relative; max-width: 340px; flex: 1 1 auto;
}
.filter-search i {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--bs-secondary-color); font-size: 15px; pointer-events: none;
}
.filter-search input {
  width: 100%; padding: 9px 14px 9px 38px;
  border-radius: 999px; border: 1.5px solid var(--bs-border-color);
  background: var(--bs-body-bg); color: var(--bs-body-color);
  font-size: 14px; transition: border-color .18s var(--ease);
}
.filter-search input:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500; white-space: nowrap;
  padding: 7px 14px; border-radius: 999px;
  border: 1.5px solid var(--bs-border-color);
  background: var(--bs-body-bg); color: var(--bs-secondary-color);
  cursor: pointer; transition: all .18s var(--ease);
}
.chip:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--bs-border-color)); color: var(--bs-body-color); }
.chip.active {
  background: var(--c, var(--brand)); border-color: var(--c, var(--brand)); color: #fff;
}
.chip .chip-n {
  font-size: 11px; font-weight: 700; opacity: .85;
  background: rgba(255,255,255,.25); border-radius: 999px; padding: 1px 6px;
}
.chip:not(.active) .chip-n { background: var(--bs-tertiary-bg); opacity: 1; }
.filter-count { font-size: 13px; color: var(--bs-secondary-color); white-space: nowrap; flex: none; }

/* ---- cuburi decorative în interiorul catalogului ---- */
.catalog-main { position: relative; }

/* ---- kanban board: coloane pe etapele de roadmap ---- */
.kanban-board {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  align-items: start;
  padding-top: 2rem; scroll-margin-top: 130px;
}
.kanban-col {
  display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--c-soft) 55%, var(--bs-tertiary-bg));
  border: 1px solid color-mix(in srgb, var(--c) 18%, var(--bs-border-color));
  border-radius: var(--radius-lg);
  padding: 14px 14px 16px;
}
.kanban-col[hidden] { display: none; }
.kanban-col-head {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 4px 4px 14px; margin-bottom: 4px;
  border-bottom: 2px solid color-mix(in srgb, var(--c) 30%, transparent);
}
.kanban-num {
  flex: none; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 700;
  background: var(--c); color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--c) 35%, transparent);
}
.kanban-col-info { flex: 1 1 auto; min-width: 0; }
.kanban-col-title {
  font-size: 14.5px; font-weight: 700; line-height: 1.25; margin: 3px 0 0; color: var(--c);
  min-height: 2.5em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.kanban-col-desc {
  margin: 4px 0 0; font-size: 11.5px; line-height: 1.4; color: var(--bs-secondary-color);
  min-height: 2.8em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.kanban-count {
  flex: none; margin-top: 2px;
  font-size: 12px; font-weight: 700; color: var(--c);
  background: var(--bs-body-bg); border: 1px solid color-mix(in srgb, var(--c) 25%, var(--bs-border-color));
  min-width: 26px; text-align: center; padding: 2px 8px; border-radius: 999px;
}
.kanban-cards { display: flex; flex-direction: column; gap: 12px; }

/* indicator de swipe: ascuns pe desktop, afișat pe mobil */
.kanban-nav { display: none; }
.kanban-dots { display: flex; align-items: center; gap: 6px; }
.kanban-dot {
  width: 6px; height: 6px; border-radius: 999px; padding: 0;
  border: none; background: var(--bs-border-color); cursor: pointer;
  transition: width .22s var(--ease), background .22s var(--ease);
}
.kanban-dot.active { width: 20px; background: var(--c, var(--brand)); }
.kanban-hint {
  display: inline-flex; align-items: center; gap: 3px; margin-left: 8px;
  font-size: 11px; color: var(--bs-secondary-color);
}
.kanban-hint i { font-size: 10px; }

/* tabletă: 2 coloane pe ecran, navigare prin slider */
@media (min-width: 576px) and (max-width: 991.98px) {
  .kanban-board {
    grid-template-columns: none; grid-auto-flow: column;
    grid-auto-columns: calc((100% - 16px) / 2); gap: 16px;
    overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; -ms-overflow-style: none;
  }
  .kanban-board::-webkit-scrollbar { display: none; }
  .kanban-col { scroll-snap-align: start; }
  .kanban-nav {
    display: flex; align-items: center; justify-content: center;
    gap: 4px; margin-top: 14px;
  }
}

/* telefon: o coloană cât ecranul, navigare prin slide */
@media (max-width: 575.98px) {
  .kanban-board {
    grid-template-columns: none; grid-auto-flow: column;
    grid-auto-columns: 100%; gap: 0;
    overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory;
    margin: 0 -12px; padding: 0;
    scrollbar-width: none; -ms-overflow-style: none;
  }
  .kanban-board::-webkit-scrollbar { display: none; }
  .kanban-col {
    scroll-snap-align: center; scroll-snap-stop: always;
    border-radius: 0; border-left: none; border-right: none;
    padding-left: 16px; padding-right: 16px;
  }
  .kanban-nav {
    display: flex; align-items: center; justify-content: center;
    gap: 4px; margin-top: 14px;
  }
}

/* ---- module card ---- */
.mod-card {
  position: relative; overflow: hidden;
  background: var(--bs-body-bg);
  border: 1.5px solid var(--bs-border-color);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.3rem 1.1rem;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease), padding .3s var(--ease);
}
.mod-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--c, var(--brand));
  opacity: .45; transition: opacity .25s var(--ease);
}
.mod-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--c) 35%, var(--bs-border-color)); }
.mod-card:hover::before { opacity: 1; }
.mod-card[hidden] { display: none; }

.mod-top { display: flex; align-items: center; gap: 12px; margin-bottom: .6rem; cursor: pointer; }
.mod-top:focus-visible { outline: 2px solid var(--c); outline-offset: 3px; border-radius: 10px; }
.mod-ico {
  flex: none; width: 42px; height: 42px; border-radius: 11px;
  display: grid; place-items: center; font-size: 20px;
  background: var(--c-soft); color: var(--c);
}
.mod-title { font-size: 15px; font-weight: 600; line-height: 1.3; margin: 0; }
.mod-caret {
  flex: none; margin-left: auto; font-size: 14px; color: var(--bs-secondary-color);
  transition: transform .28s var(--ease), color .18s var(--ease);
}
.mod-card:hover .mod-caret { color: var(--c); }

/* zonă pliabilă: descrierea + acțiunile, ascunse până la click pe antet */
.mod-collapse {
  overflow: hidden; max-height: 600px;
  transition: max-height .3s var(--ease);
}
.mod-card.is-collapsed { padding-top: .8rem; padding-bottom: .8rem; }
.mod-card.is-collapsed .mod-top { margin-bottom: 0; }
.mod-card.is-collapsed .mod-caret { transform: rotate(-90deg); }
.mod-card.is-collapsed .mod-collapse { max-height: 0; }
@media (prefers-reduced-motion: reduce) {
  .mod-collapse, .mod-caret { transition: none; }
}
.mod-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: .6rem; }
.cat-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  color: var(--c); background: var(--c-soft);
  border: 1px solid color-mix(in srgb, var(--c) 25%, transparent);
  padding: 2px 9px; border-radius: 999px;
}
.cat-tag i { font-size: 12px; }
.mod-tags .req-badge { margin-left: 0; }
.mod-desc { font-size: 13px; color: var(--bs-secondary-color); line-height: 1.55; margin-bottom: 0; }

.mod-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: .7rem; padding-top: .65rem;
  border-top: 1px dashed var(--bs-border-color);
}
.mod-action-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 10px; border-radius: 999px; border: 1px solid var(--bs-border-color);
  background: transparent; font-size: 12px; font-weight: 600;
  color: var(--bs-secondary-color); cursor: pointer; white-space: nowrap;
  text-decoration: none;
  transition: all .18s var(--ease);
}
.mod-action-btn i { font-size: 13px; }
.mod-action-btn:hover { border-color: var(--c, var(--brand)); color: var(--c, var(--brand)); }
.mod-action-btn.active {
  background: var(--c-soft, var(--brand-soft)); border-color: transparent; color: var(--c, var(--brand));
}
.mod-action-primary {
  background: var(--c-soft, var(--brand-soft)); border-color: transparent; color: var(--c, var(--brand));
}
.mod-action-primary:hover { background: var(--c, var(--brand)); color: #fff; }

.mod-need-text {
  margin: 8px 0 0; font-size: 12.5px; line-height: 1.55;
  color: var(--bs-secondary-color); font-style: italic;
}

/* ---- dialog de detalii complete ---- */
.md-lead {
  font-size: 14.5px; line-height: 1.65; margin-bottom: 1.3rem;
  padding-left: 14px; border-left: 3px solid var(--brand);
  color: var(--bs-body-color);
}
.md-note { font-size: 12px; color: var(--bs-secondary-color); font-style: italic; margin-top: 1rem; }

/* dialogul crește odată cu ecranul, ca să folosească spațiul pe monitoare mari */
.md-modal { max-width: min(1000px, 94vw); }
.md-modal .modal-content { max-height: 88vh; }
@media (min-width: 1400px) { .md-modal { max-width: min(1200px, 90vw); } }
@media (min-width: 1800px) { .md-modal { max-width: 1400px; } }

/* masonry pe coloane CSS (fără librărie) — cardurile curg pe verticală apoi trec în coloana următoare */
.md-masonry { column-count: 2; column-gap: 12px; }
@media (min-width: 1400px) { .md-masonry { column-count: 3; } }
@media (min-width: 1800px) { .md-masonry { column-count: 4; } }
.md-card {
  display: inline-block; width: 100%; break-inside: avoid;
  margin: 0 0 12px; background: var(--bs-body-bg); border: 1px solid var(--bs-border-color);
  border-radius: var(--radius-sm); overflow: hidden;
  animation: md-fade-in .35s var(--ease) backwards;
  transition: box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.md-card:hover { box-shadow: var(--shadow-sm); border-color: color-mix(in srgb, var(--c, var(--brand)) 35%, var(--bs-border-color)); }
.md-card-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .01em;
  padding: 10px 14px; background: var(--c-soft, var(--brand-soft)); color: var(--c, var(--brand));
}
.md-card-head i { font-size: 15px; }
.md-card-body { padding: 12px 14px; }
.md-list { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 6px; }
.md-list li { font-size: 13px; line-height: 1.5; color: var(--bs-body-color); }
.md-card-body p { font-size: 13px; line-height: 1.55; color: var(--bs-body-color); margin: 0 0 .5rem; }
.md-card-body p:last-child { margin-bottom: 0; }

@keyframes md-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .md-card { animation: none; }
}
@media (max-width: 575.98px) {
  .md-masonry { column-count: 1; }
}

/* ---- legend ---- */
.phase-legend { display: flex; flex-wrap: wrap; gap: 18px; }
.phase-legend .item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--bs-secondary-color); }
.phase-legend .num {
  width: 22px; height: 22px; border-radius: 7px; flex: none;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700;
  background: var(--brand-soft); color: var(--brand-strong);
}

/* ---- bottom CTA ---- */
.modules-cta {
  margin: 4rem auto 0; max-width: 780px;
  text-align: center; padding: 2.5rem 2rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--brand-soft), var(--cyan-soft));
  border: 1px solid var(--bs-border-color);
}
.modules-cta h3 { margin-bottom: .5rem; }
.modules-cta p { color: var(--bs-secondary-color); margin-bottom: 1.4rem; }

@media (max-width: 767.98px) {
  .filter-bar { top: 0; }
  .filter-search { max-width: none; }
  .filter-sep { display: none; }
  .filter-group { align-items: flex-start; }
  .filter-group-label { padding-top: 8px; }
}
