/* =====================================================================
 *  Consimțământ pentru cookie-uri
 *  · bannerul de jos
 *  · caseta care ține locul conținutului extern neîncărcat
 * ===================================================================*/

/* ---------------------------------------------------------------- Banner */

.consent {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 1200;
  padding: 0 1rem 1rem;
  display: flex;
  justify-content: center;
  pointer-events: none;                /* doar caseta prinde clicurile */
}

.consent[hidden] { display: none !important; }

.consent__box {
  pointer-events: auto;
  width: min(var(--container, 1180px), 100%);
  background: #fff;
  color: var(--text, #333);
  border: 1px solid var(--border, #e2e5ec);
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-xl, 0 18px 50px rgba(16, 30, 60, .22));
  padding: 1.15rem 1.3rem;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;

  animation: consent-in .32s var(--ease-out, cubic-bezier(.22, 1, .36, 1)) both;
}

@keyframes consent-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.consent__text { flex: 1 1 340px; min-width: 0; }

.consent__title {
  margin: 0 0 .35rem;
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--heading, #14213d);
}

.consent__text p {
  margin: 0 0 .4rem;
  font-size: .89rem;
  line-height: 1.55;
}

.consent__text p:last-child { margin-bottom: 0; }

.consent__small { color: var(--muted, #667085); font-size: .83rem !important; }

.consent__small a { color: var(--navy, #1d4ed8); text-decoration: underline; }

.consent__actions {
  flex: 0 0 auto;
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}

/* Refuzul trebuie să fie la fel de vizibil și de ușor ca acceptul —
   nu îl facem un link șters într-un colț. Aceeași mărime, același contur. */
.consent__btn {
  font: inherit;
  font-weight: 600;
  font-size: .9rem;
  padding: .68rem 1.5rem;
  min-width: 128px;
  border-radius: var(--radius, 10px);
  border: 2px solid var(--navy, #14213d);
  cursor: pointer;
  transition: background .18s var(--ease, ease), color .18s var(--ease, ease),
              transform .18s var(--ease, ease);
}

.consent__btn--no  { background: #fff;                   color: var(--navy, #14213d); }
.consent__btn--yes { background: var(--navy, #14213d);   color: #fff; }

.consent__btn--no:hover  { background: var(--navy-050, #eef2fb); }
.consent__btn--yes:hover { background: var(--navy-dark, #0d1730); }

.consent__btn:hover  { transform: translateY(-1px); }
.consent__btn:active { transform: none; }

.consent__btn:focus-visible {
  outline: 3px solid var(--coral, #e8604c);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .consent { padding: 0 .6rem .6rem; }
  .consent__box { padding: .95rem 1rem; gap: .8rem; }
  .consent__title { font-size: .97rem; }
  .consent__text p { font-size: .84rem; line-height: 1.5; }
  .consent__small { font-size: .79rem !important; }

  /* Pe un ecran mic bannerul nu are voie să ia toată pagina. Dacă textul
     nu încape, se derulează el, nu împinge butoanele afară. */
  .consent__text { max-height: 42vh; overflow-y: auto; }

  .consent__actions { width: 100%; }
  .consent__btn { flex: 1 1 0; min-width: 0; padding: .72rem .6rem; }
}

/* ------------------------------------------- Locul conținutului extern */

.consent-block {
  border: 1px dashed var(--border, #d7dbe4);
  border-radius: var(--radius-lg, 16px);
  background: var(--bg-soft, #f6f8fc);
  display: grid;
  place-items: center;
  padding: 1.6rem 1.2rem;
  margin: 1.6rem 0;
  min-height: 190px;
}

.consent-block__in {
  text-align: center;
  max-width: 460px;
}

.consent-block__icon {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--border, #e2e5ec);
  color: var(--navy, #14213d);
  margin-bottom: .75rem;
}

.consent-block__title {
  margin: 0 0 .35rem;
  font-weight: 600;
  color: var(--heading, #14213d);
}

.consent-block__text {
  margin: 0 0 1rem;
  font-size: .87rem;
  line-height: 1.55;
  color: var(--muted, #667085);
}

.consent-block__actions {
  display: flex;
  gap: .5rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Odată încărcat, învelișul nu mai trebuie să se vadă. */
.consent-block.is-loaded {
  border: 0;
  background: none;
  padding: 0;
  min-height: 0;
  display: block;
}

/* ------------------------------------------------------- Buton în subsol */

.footer__link-btn {
  font: inherit;
  font-size: inherit;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer__link-btn:hover { color: #fff; }

/* ------------------------------------------------------------ Respect */

@media (prefers-reduced-motion: reduce) {
  .consent__box { animation: none; }
  .consent__btn:hover { transform: none; }
}

@media print {
  .consent { display: none !important; }
  .consent-block { border-style: solid; }
}

/* ------------------------------------- Nu acoperim butoanele plutitoare */

/* Cât timp bannerul e pe ecran, butonul de accesibilitate, panoul lui și
   săgeata „înapoi sus” urcă deasupra lui. Altfel bannerul ar sta exact
   peste butonul de care are nevoie cineva ca să mărească textul — adică
   peste butonul de care are nevoie ca să poată citi bannerul.
   Înălțimea reală o pune scriptul în --consent-h. */

.consent-open .a11y-toggle { bottom: calc(22px + var(--consent-h, 170px)); }
.consent-open .a11y-panel  { bottom: calc(86px + var(--consent-h, 170px)); }
.consent-open .to-top      { bottom: calc(22px + var(--consent-h, 170px)); }

/* Doar butonul de accesibilitate și panoul lui alunecă. Săgeata „înapoi
   sus” stă cu visibility:hidden cât timp pagina e nederulată, iar o
   tranziție pornită pe un element ascuns rămâne înțepenită la valoarea
   de plecare — deci pe ea o mutăm dintr-o dată. */
.a11y-toggle, .a11y-panel { transition: bottom .25s var(--ease, ease); }

@media (prefers-reduced-motion: reduce) {
  .a11y-toggle, .a11y-panel { transition: none; }
}
