/* ==========================================================================
   TOP CITY — pagini legale (confidențialitate, cookies, termeni) + 404
   Reutilizează .page-hero--light, .doc / .toc / .prose, .section.dark, .next__card.
   ========================================================================== */

/* ---------- Hero luminos: ajustări comune ---------- */
.lg-hero .page-hero__body, .nf-hero .page-hero__body { padding-top: clamp(128px, 12vw, 164px); }
.lg-hero .page-hero__title { max-width: 14ch; }
.page-hero--light .page-hero__facts {
  background: var(--paper); border-color: transparent;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.page-hero--light .page-hero__facts > div + div { border-left-color: var(--line); }
.page-hero--light .page-hero__facts dt { color: var(--muted); }

/* comutator între cele trei documente */
.lg-switch {
  display: inline-flex; gap: 4px; max-width: 100%;
  margin-top: 30px; padding: 5px; border-radius: 999px;
  background: var(--paper);
  overflow-x: auto; scrollbar-width: none;
  animation: fadeUp 1s var(--ease) .4s both;
}
.lg-switch::-webkit-scrollbar { display: none; }
.lg-switch a {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  height: 44px; padding: 0 18px 0 14px; border-radius: 999px;
  font: 600 .95rem/1 var(--f-display); color: var(--muted);
  transition: background .3s, color .3s;
}
.lg-switch a:hover { color: var(--ink); background: var(--white); }
.lg-switch a[aria-current="page"] { background: var(--ink); color: #fff; }
.lg-switch .ic { width: 17px; height: 17px; }
.lg-switch a[aria-current="page"] .ic { color: var(--yellow); }

/* ---------- Document ---------- */
.lg-doc { padding-block: clamp(36px, 4.5vw, 64px) clamp(72px, 9vw, 120px); }
.lg-doc .doc { grid-template-columns: 272px minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); }

.lg-sheet {
  max-width: none;
  padding: clamp(28px, 5vw, 76px) clamp(22px, 5.6vw, 88px);
  border-radius: var(--r-lg);
  background: var(--white);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .03), 0 24px 60px -36px rgba(0, 0, 0, .25);
  overflow-wrap: break-word;
}
.lg-sheet > * { max-width: 46rem; }
.lg-sheet a { overflow-wrap: anywhere; }
.lg-sheet em { font-style: italic; }
.lg-intro { font: 500 clamp(1.1rem, 1.3vw, 1.24rem)/1.55 var(--f-display); letter-spacing: -.01em; color: var(--ink); }

/* secțiuni numerotate, despărțite de o linie fină */
.lg-sheet > .lg-sec { margin-top: clamp(40px, 5vw, 60px); padding-top: clamp(36px, 4.4vw, 52px); border-top: 1px solid var(--line); }
.lg-sheet > .lg-sec:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.lg-sec > * + * { margin-top: 1.05em; }
/* html are deja scroll-padding-top: 96px (style.css); marginea de aici se adaugă peste el,
   deci titlul ajunge la 96 + 16 = 112px, aliniat cu cuprinsul lipicios */
.lg-sheet h2 {
  display: flex; align-items: baseline; gap: 16px;
  margin-top: 0;
  font-size: clamp(1.45rem, 2.05vw, 1.95rem); line-height: 1.14;
  scroll-margin-top: 16px;
}
.lg-sheet h2 + * { margin-top: 1.15em; }
.lg-sheet h2.lg-h--long { font-size: clamp(1.22rem, 1.55vw, 1.45rem); line-height: 1.3; letter-spacing: -.018em; }
/* număr de secțiune: cifre drepte (în italic „11” se citea „ll”), coloană de lățime fixă
   ca toate titlurile (și cele lungi, cu literă mai mică) să pornească de la același x */
.lg-n {
  flex: none; display: inline-block; min-width: 1.34em; text-align: center;
  font: 400 clamp(1.62rem, 2.3vw, 2.18rem)/1 var(--f-serif); font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: 0; color: var(--ink);
  background: linear-gradient(transparent 62%, var(--yellow) 62%, var(--yellow) 88%, transparent 88%);
}

/* listă scurtă afișată ca plăci */
.lg-sheet .lg-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lg-sheet .lg-tiles li { padding: 14px 16px 14px 38px; border-radius: 14px; background: var(--paper); font-size: .97rem; line-height: 1.4; }
.lg-sheet .lg-tiles li::before { left: 17px; top: 1.18em; }

/* adresă poștală */
.lg-addr {
  display: flex; align-items: center; gap: 16px; max-width: 460px;
  padding: 18px 22px; border-radius: 18px;
  background: var(--paper); font-style: normal;
}
.lg-addr .brand__mark { width: 40px; height: 39px; color: var(--ink); }
.lg-addr b { display: block; font: 600 1.06rem/1.25 var(--f-display); color: var(--ink); }
.lg-addr b + span { display: block; font-size: .95rem; line-height: 1.4; color: var(--muted); }

/* preferințe cookie (doar cu JS) */
.lg-pref {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px 24px;
  padding: 20px 20px 20px 22px; border-radius: 22px;
  background: var(--ink); color: #fff;
}
html:not(.js) .lg-pref { display: none; }
.lg-pref__body { display: flex; align-items: center; gap: 16px; min-width: 0; }
.lg-pref__ic { display: grid; place-items: center; flex: none; width: 50px; height: 50px; border-radius: 15px; background: var(--ink-3); color: var(--yellow); }
.lg-pref__ic .ic { width: 25px; height: 25px; }
.lg-sheet .lg-pref .lg-pref__t { margin: 0; font: 600 1.1rem/1.2 var(--f-display); letter-spacing: -.01em; color: #fff; }
.lg-pref p { margin: 5px 0 0; font-size: .9rem; line-height: 1.4; color: var(--muted-d); }
.lg-pref p b { color: #fff; font-weight: 600; }
.lg-pref__btns { display: flex; flex-wrap: wrap; gap: 8px; }
.lg-pref__btns .btn { border: 1px solid var(--line-d); color: #fff; background: transparent; }
.lg-pref__btns .btn:hover { border-color: rgba(255, 255, 255, .45); }
.lg-pref__btns .btn .ic { display: none; width: 16px; height: 16px; stroke-width: 2.4; }
.lg-pref__btns .btn[aria-pressed="true"] { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.lg-pref__btns .btn[aria-pressed="true"] .ic { display: block; animation: pop .45s var(--ease); }
.lg-pref .lg-pref__ok { grid-column: 1 / -1; margin: 0; font-size: .84rem; color: var(--yellow); }
.lg-pref__ok:empty { display: none; }

/* ---------- Cuprins (desktop): lipicios, cu marcaj care alunecă ---------- */
.lg-toc {
  display: block; top: 112px;
  max-height: calc(100vh - 136px); overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: rgba(15, 15, 14, .16) transparent;
  padding-right: 6px;
}
.lg-toc > .lg-toc__toggle { display: none; }
.lg-toc__panel > b { display: block; padding-left: 12px; }
.lg-toc__track { position: relative; }
.lg-toc__list { display: grid; gap: 2px; }
.lg-toc__list a {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: baseline;
  padding: 9px 12px; border-left: 0; border-radius: 12px;
  font-size: .9rem; line-height: 1.32; color: var(--muted);
}
.lg-toc__list a small { font: 600 .72rem/1 var(--f-display); letter-spacing: .04em; opacity: .75; }
.lg-toc__list a:hover { background: rgba(255, 255, 255, .55); color: var(--ink); }
.lg-toc__list a.is-active { background: transparent; color: var(--ink); }
.lg-toc__list a.is-active small { opacity: 1; }
.lg-toc--long .lg-toc__list a { padding-block: 7px; }
.lg-toc__ink {
  position: absolute; left: 0; right: 0; top: 0;
  height: var(--h, 0px); transform: translateY(var(--y, 0px));
  border-radius: 12px; background: var(--white);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 12px 26px -18px rgba(0, 0, 0, .35);
  opacity: 0; pointer-events: none;
  transition: transform .55s var(--ease), height .55s var(--ease), opacity .3s;
}
.lg-toc__ink.is-on { opacity: 1; }
.lg-toc__ink::before { content: ""; position: absolute; left: 0; top: 50%; width: 3px; height: 18px; margin-top: -9px; border-radius: 0 3px 3px 0; background: var(--yellow); }
.lg-toc__foot { margin-top: 18px; padding: 18px 12px 4px; border-top: 1px solid var(--line); }
.lg-print { display: inline-flex; align-items: center; gap: 9px; padding-bottom: 6px; border-bottom: 2px solid var(--yellow); font: 600 .92rem/1 var(--f-display); color: var(--ink); }
.lg-print .ic { width: 17px; height: 17px; transition: transform .3s var(--ease); }
.lg-print:hover .ic { transform: translateY(-2px); }

/* ---------- Documente legale (card închis de final) ---------- */
.lg-more .sec-head__aside a { color: #fff; border-bottom: 1px solid var(--yellow); transition: color .2s; }
.lg-more .sec-head__aside a:hover { color: var(--yellow); }
.lg-docs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.lg-dcard {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 320px; padding: 28px;
  border-radius: var(--r-lg); border: 1px solid var(--line-d);
  background: var(--ink-2); color: #fff;
  transition: border-color .4s, transform .5s var(--ease);
}
.lg-dcard:hover { transform: translateY(-4px); }
.lg-dcard__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 22px; }
.lg-dcard .ic-wrap { margin: 0; }
.lg-dcard__k { font: 600 .74rem/1 var(--f-display); letter-spacing: .16em; text-transform: uppercase; color: var(--muted-d); }
.lg-dcard b { font: 600 clamp(1.45rem, 2vw, 1.75rem)/1.08 var(--f-display); letter-spacing: -.03em; }
.lg-dcard__p { color: var(--muted-d); font-size: .95rem; line-height: 1.5; max-width: 34ch; }
.lg-dcard__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line-d);
  font-size: .85rem; color: var(--muted-d);
}
.lg-dcard__go { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .1); transition: background .3s, color .3s, transform .4s var(--ease); }
.lg-dcard__go .ic { width: 18px; height: 18px; }
.lg-dcard:hover .lg-dcard__go { background: var(--yellow); color: var(--ink); transform: rotate(-45deg); }
.lg-dcard[aria-current="page"] { border-color: rgba(250, 196, 29, .4); }
.lg-dcard[aria-current="page"] .lg-dcard__go,
.lg-dcard[aria-current="page"]:hover .lg-dcard__go { transform: rotate(-90deg); }
.lg-dcard[aria-current="page"] .lg-dcard__foot span:first-child { color: #fff; }

/* ==========================================================================
   404
   ========================================================================== */
.nf-hero .page-hero__row { align-items: center; }
.nf-hero .page-hero__title { max-width: 12ch; }
.nf-code {
  display: flex; align-items: flex-end;
  font: 600 clamp(6.5rem, 15vw, 14rem)/.74 var(--f-display); letter-spacing: -.06em;
  color: var(--ink); user-select: none;
}
.nf-mark { width: .99em; height: .95em; margin: 0 .03em .005em; overflow: visible; color: var(--ink); }
.nf-mark .tw { animation: grow 1.2s var(--ease) both; }
.nf-mark .tw-1 { animation-delay: .35s; }
.nf-mark .tw-2 { animation-delay: .5s; }
.nf-mark .tw-3 { animation-delay: .65s; }
.nf-code:hover .tw { animation: bounce .7s var(--ease); }
.nf-code:hover .tw-2 { animation-delay: .06s; }
.nf-code:hover .tw-3 { animation-delay: .12s; }
.nf-code > span { animation: fadeUp 1s var(--ease) .2s both; }
.nf-code > span:last-child { animation-delay: .3s; }

.nf-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.nf-grid .next__card { min-height: 360px; }

.nf-help { padding-block: clamp(60px, 7.5vw, 104px); }
.nf-help__grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 32px clamp(40px, 6vw, 96px); align-items: center; }
.nf-help .h2 { margin-bottom: 22px; }
.nf-help .clist { margin-top: 0; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  /* cuprinsul devine o bară lipicioasă care se deschide ca listă */
  .lg-doc .doc { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .lg-toc {
    position: sticky; top: calc(var(--inset) * 2 + 76px); z-index: 30;
    display: block; max-height: none; overflow: visible; padding: 0;
  }
  .js .lg-toc > .lg-toc__toggle { display: flex; }
  .lg-toc__toggle {
    width: 100%; height: 62px; align-items: center; gap: 12px;
    padding: 0 18px 0 9px; border-radius: 20px; text-align: left;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 16px 34px -22px rgba(0, 0, 0, .4);
  }
  .lg-toc__ic { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 14px; background: var(--yellow); color: var(--ink); }
  .lg-toc__now { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
  .lg-toc__now small { font: 600 .68rem/1 var(--f-display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
  .lg-toc__t { font: 600 .98rem/1.2 var(--f-display); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lg-toc__chev { color: var(--muted); transform: rotate(90deg); transition: transform .4s var(--ease); }
  .lg-toc.is-open .lg-toc__chev { transform: rotate(-90deg); }

  .lg-toc__panel { padding: 16px 10px 10px; border-radius: 20px; background: var(--white); }
  .js .lg-toc__panel {
    position: absolute; left: 0; right: 0; top: calc(100% + 8px);
    max-height: min(64vh, 560px); overflow-y: auto; overscroll-behavior: contain;
    padding-top: 10px;
    box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .45);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .3s var(--ease), transform .4s var(--ease), visibility 0s linear .4s;
  }
  .js .lg-toc.is-open .lg-toc__panel { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .js .lg-toc__panel > b { display: none; }
  .lg-toc__ink { display: none; }
  .lg-toc__list a { padding: 11px 12px; font-size: .95rem; background: none; }
  .lg-toc__list a.is-active { background: var(--yellow-soft); }
  .lg-toc__foot { margin-top: 8px; padding: 14px 12px 6px; }

  /* bara de cuprins se termină la 2×inset + 76 + 62 = 162px; titlul ajunge la 96 + 84 = 180px */
  .lg-sheet h2 { scroll-margin-top: calc(var(--inset) * 2 + 60px); }

  .lg-docs { grid-template-columns: minmax(0, 1fr); }
  .lg-dcard { min-height: 0; }
  .lg-dcard__top { margin-bottom: 10px; }

  .nf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nf-help__grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .lg-hero .page-hero__body, .nf-hero .page-hero__body { padding-top: 104px; }
  .lg-switch { display: flex; margin-top: 24px; }
  .lg-switch a { flex: 1 0 auto; justify-content: center; height: 42px; padding: 0 13px; font-size: .9rem; }
  .lg-switch .ic { display: none; }
  .page-hero--light .page-hero__facts { width: 100%; }

  .lg-toc { top: calc(var(--inset) + 68px); }
  /* bara se termină la inset + 68 + 62 = 138px; titlul ajunge la 96 + 60 = 156px */
  .lg-sheet h2 { scroll-margin-top: calc(var(--inset) + 52px); }
  .lg-sheet { border-radius: 22px; }
  .lg-sheet h2 { gap: 12px; }
  .lg-sheet .lg-tiles { grid-template-columns: minmax(0, 1fr); }
  .lg-pref { grid-template-columns: minmax(0, 1fr); padding: 18px; }
  .lg-pref__btns .btn { flex: 1 1 auto; padding: 0 14px; }
  .lg-addr { padding: 16px 18px; }

  .lg-dcard { padding: 22px; }

  .nf-hero .page-hero__row { gap: 18px; }
  .nf-code { order: -1; font-size: clamp(6rem, 33vw, 8.4rem); }
  .nf-grid { grid-template-columns: minmax(0, 1fr); }
  .nf-grid .next__card { min-height: 190px; }
  .nf-help .clist a { font-size: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .lg-toc__ink { transition: none; }
}

/* ---------- Tipărire ---------- */
@media print {
  .promo, .nav, .menu, .lg-toc, .lg-switch, .lg-more, .foot, .mbar, .cookie, .progress, .lb, .skip, .lg-pref { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .page-hero-shell { padding: 0; }
  .page-hero--light { min-height: 0; border-radius: 0; }
  .page-hero__body { padding-top: 0 !important; padding-bottom: 12pt !important; }
  .lg-pref + .lg-sec { margin-top: 0; padding-top: 0; border-top: 0; }
  .page-hero__row { display: block; }
  .page-hero__title { font-size: 26pt; max-width: none; animation: none; }
  .page-hero__lead, .crumbs, .page-hero__aside { animation: none; }
  /* data ultimei actualizări rămâne pe hârtie, ca rând simplu sub titlu */
  .page-hero--light .page-hero__facts { display: block; width: auto; margin-top: 8pt; padding: 0; border: 0; border-radius: 0; background: none; }
  .page-hero__facts > div:first-child { display: flex; flex-direction: row; gap: 5pt; padding: 0; }
  .page-hero__facts > div + div { display: none; }
  .page-hero__facts dt { margin: 0; font-size: 10pt; color: #555; }
  .page-hero__facts dt::first-letter { text-transform: uppercase; }
  .page-hero__facts dt::after { content: ":"; }
  .page-hero__facts dd { font: 600 10pt/1.4 var(--f-display); letter-spacing: 0; }
  .lg-doc { padding: 0; }
  .lg-doc .doc { display: block; }
  .lg-sheet { padding: 0; box-shadow: none; border-radius: 0; }
  .lg-sheet > * { max-width: none; }
  .lg-sheet h2 { break-after: avoid; font-size: 15pt; }
  .lg-n { font-size: 1.12em; }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
}
