/*!
 * Asiimov Cookie Consent — STILURILE (asiimov-cc.css)
 * Brand: Asiimov.ro | https://asiimov.ro
 *
 * Stilizează EXACT clasele generate de asiimov-cc.js (prefix acc-). Fără dependențe,
 * fără @import extern, fără build step. Temă dublă (light implicit + dark prin
 * prefers-color-scheme SAU clasă .acc-theme-dark / .acc-theme-light). Complet responsive.
 *
 * Mecanica de afișare (impusă de motor):
 *   - Bannerul, overlay-ul și modalul stau mereu în DOM; vizibilitatea e comandată
 *     de clasele de pe <html>:  .acc--show-banner  și  .acc--show-modal.
 *   - Butonul de re-deschidere (.acc-reopen) e comutat prin style.display inline,
 *     deci display-ul lui „vizibil" trebuie definit aici (inline-flex).
 *   - Închiderea la clic în afara dialogului se bazează pe overlay: .acc-modal
 *     lasă evenimentele de pointer să treacă (pointer-events:none), doar dialogul
 *     le captează (pointer-events:auto).
 *
 * Unități: containerele principale sunt fixate la font-size:16px, iar interiorul
 * folosește `em` — astfel widgetul se scalează consistent indiferent de tema gazdei.
 * ========================================================================== */

/* ---------------------------------------------------------------------------
 * Variabile temabile (:root). --acc-accent e suprascris din JS (guiOptions.accent).
 * ------------------------------------------------------------------------- */
:root {
  --acc-accent: #2f6fed;            /* culoarea butoanelor primare (din config) */
  --acc-accent-contrast: #ffffff;   /* textul pe butonul primar */
  --acc-bg: #ffffff;                /* fundal banner / dialog */
  --acc-surface-2: #f4f6fa;         /* fundal card de categorie */
  --acc-text: #1b2230;              /* text principal */
  --acc-muted: #5a6472;             /* text secundar / descrieri */
  --acc-border: rgba(18, 26, 40, .12);
  --acc-btn-secondary-bg: #eef1f6;  /* fundal buton secundar */
  --acc-btn-secondary-bg-hover: #e4e9f1;
  --acc-switch-off: #c7ceda;        /* track OFF la comutator */
  --acc-overlay: rgba(16, 22, 34, .5);
  --acc-radius: 14px;
  --acc-shadow:
    0 12px 40px -8px rgba(16, 24, 40, .28),
    0 4px 14px -6px rgba(16, 24, 40, .18);
  --acc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
              Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}

/* Temă întunecată prin clasă (control manual) */
:root.acc-theme-dark {
  --acc-bg: #1e2430;
  --acc-surface-2: #262e3c;
  --acc-text: #e8ecf3;
  --acc-muted: #9aa4b2;
  --acc-border: rgba(255, 255, 255, .12);
  --acc-btn-secondary-bg: #2c3543;
  --acc-btn-secondary-bg-hover: #343e4e;
  --acc-switch-off: #49525f;
  --acc-overlay: rgba(0, 0, 0, .62);
  --acc-shadow:
    0 14px 46px -8px rgba(0, 0, 0, .6),
    0 4px 16px -6px rgba(0, 0, 0, .5);
}

/* Temă întunecată automată (dacă utilizatorul nu a forțat .acc-theme-light) */
@media (prefers-color-scheme: dark) {
  :root:not(.acc-theme-light) {
    --acc-bg: #1e2430;
    --acc-surface-2: #262e3c;
    --acc-text: #e8ecf3;
    --acc-muted: #9aa4b2;
    --acc-border: rgba(255, 255, 255, .12);
    --acc-btn-secondary-bg: #2c3543;
    --acc-btn-secondary-bg-hover: #343e4e;
    --acc-switch-off: #49525f;
    --acc-overlay: rgba(0, 0, 0, .62);
    --acc-shadow:
      0 14px 46px -8px rgba(0, 0, 0, .6),
      0 4px 16px -6px rgba(0, 0, 0, .5);
  }
}

/* ---------------------------------------------------------------------------
 * Reset local (scoped pe elementele widgetului — nu atinge pagina gazdă)
 * ------------------------------------------------------------------------- */
.acc-banner, .acc-banner *,
.acc-overlay,
.acc-modal, .acc-modal *,
.acc-reopen, .acc-reopen * {
  box-sizing: border-box;
}

.acc-banner,
.acc-modal,
.acc-reopen {
  font-family: var(--acc-font);
  font-size: 16px;          /* ancoră pentru `em` — imună la font-size-ul gazdei */
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Blocarea scroll-ului paginii cât timp modalul e deschis */
html.acc--show-modal { overflow: hidden; }

/* ===========================================================================
 * BANNER
 * ======================================================================== */
.acc-banner {
  position: fixed;
  z-index: 2147483645;
  width: 26em;
  max-width: calc(100vw - 2em);
  padding: 1.25em 1.35em 1.35em;
  background: var(--acc-bg);
  color: var(--acc-text);
  border: 1px solid var(--acc-border);
  border-radius: var(--acc-radius);
  box-shadow: var(--acc-shadow);
  /* stare ascunsă implicită (vizibilitate comandată din <html>) */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(1em);
  transition: opacity .3s ease, transform .3s cubic-bezier(.16, 1, .3, 1), visibility .3s;
}
html.acc--show-banner .acc-banner {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.acc-banner__title {
  margin: 0 0 .35em;
  font-size: 1.06em;
  font-weight: 700;
  letter-spacing: -.01em;
}
.acc-banner__desc {
  margin: 0;
  font-size: .9em;
  color: var(--acc-muted);
}
.acc-banner__desc a {
  color: var(--acc-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.acc-banner__desc a:hover { text-decoration: none; }

.acc-banner__btns {
  display: flex;
  flex-wrap: wrap;
  gap: .55em;
  margin-top: 1.15em;
}
/* primar + secundar împart rândul; flat (Preferințe) trece pe linie proprie */
.acc-banner__btns .acc-btn--primary,
.acc-banner__btns .acc-btn--secondary { flex: 1 1 8em; }
.acc-banner__btns .acc-btn--flat { flex: 1 1 100%; }

/* --- Poziții (modificatori --bottom-left etc.). Offset 1.25em de la margini --- */
.acc-banner--bottom-left   { bottom: 1.25em; left: 1.25em; }
.acc-banner--bottom-right  { bottom: 1.25em; right: 1.25em; }
.acc-banner--bottom-center { bottom: 1.25em; left: 50%; transform: translateX(-50%) translateY(1em); }
.acc-banner--top-left      { top: 1.25em; left: 1.25em; transform: translateY(-1em); }
.acc-banner--top-right     { top: 1.25em; right: 1.25em; transform: translateY(-1em); }
.acc-banner--top-center    { top: 1.25em; left: 50%; transform: translateX(-50%) translateY(-1em); }
.acc-banner--middle-center { top: 50%; left: 50%; transform: translate(-50%, -50%) scale(.96); }

/* Starea „arătat" pentru pozițiile care folosesc translateX/translate */
html.acc--show-banner .acc-banner--bottom-center { transform: translateX(-50%); }
html.acc--show-banner .acc-banner--top-center    { transform: translateX(-50%); }
html.acc--show-banner .acc-banner--top-left,
html.acc--show-banner .acc-banner--top-right     { transform: none; }
html.acc--show-banner .acc-banner--middle-center { transform: translate(-50%, -50%); }

/* --- Layout: cloud (card centrat, mai lat, butoane pe rând) --- */
.acc-banner--cloud {
  width: auto;
  max-width: min(40em, calc(100vw - 2.5em));
}
.acc-banner--cloud .acc-banner__btns .acc-btn--flat { flex: 0 1 auto; }

/* --- Layout: bar (bandă pe toată lățimea, muchie sus/jos) --- */
.acc-banner--bar {
  left: 0;
  right: 0;
  width: auto;
  max-width: none;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  padding: 1em clamp(1em, 4vw, 3em);
  transform: translateY(1em);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5em 1.25em;
}
.acc-banner--bar.acc-banner--top-left,
.acc-banner--bar.acc-banner--top-center,
.acc-banner--bar.acc-banner--top-right { top: 0; bottom: auto; transform: translateY(-1em); }
.acc-banner--bar.acc-banner--bottom-left,
.acc-banner--bar.acc-banner--bottom-center,
.acc-banner--bar.acc-banner--bottom-right { bottom: 0; top: auto; }
.acc-banner--bar .acc-banner__title { flex: 0 0 100%; }
.acc-banner--bar .acc-banner__desc { flex: 1 1 20em; }
.acc-banner--bar .acc-banner__btns { flex: 0 1 auto; margin-top: 0; flex-wrap: nowrap; }
.acc-banner--bar .acc-banner__btns .acc-btn--primary,
.acc-banner--bar .acc-banner__btns .acc-btn--secondary,
.acc-banner--bar .acc-banner__btns .acc-btn--flat { flex: 0 0 auto; }
html.acc--show-banner .acc-banner--bar { transform: translateY(0); }

/* ===========================================================================
 * BUTOANE (.acc-btn --primary / --secondary / --flat)
 * ======================================================================== */
.acc-btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: .7em 1.15em;
  font: inherit;
  font-size: .9em;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  border: 1px solid transparent;
  border-radius: calc(var(--acc-radius) - 5px);
  cursor: pointer;
  user-select: none;
  transition: background-color .15s ease, color .15s ease,
              border-color .15s ease, filter .15s ease, box-shadow .15s ease;
}

/* !important — ca stilul butoanelor să învingă temele care stilizează global <button>
   (ex. Woodmart). Necesar pentru un modul care trebuie să arate corect pe ORICE temă. */
.acc-btn--primary {
  background: var(--acc-accent) !important;
  color: var(--acc-accent-contrast) !important;
  border-color: transparent !important;
}
.acc-btn--primary:hover { filter: brightness(.93); }
.acc-btn--primary:active { filter: brightness(.86); }

/* „Doar necesare" (refuz): proeminență EGALĂ cu „Accept toate" (CNIL/EDPB) —
   aceeași mărime/greutate/culoare accent, doar outlined vs filled. */
.acc-btn--secondary {
  background: transparent !important;
  color: var(--acc-accent) !important;
  border-color: var(--acc-accent) !important;
}
.acc-btn--secondary:hover { background: var(--acc-btn-secondary-bg) !important; }

.acc-btn--flat {
  background: transparent !important;
  color: var(--acc-accent) !important;
  padding-left: .6em;
  padding-right: .6em;
}
.acc-btn--flat:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Focus vizibil, universal (inel accent cu „gol" în culoarea fundalului) */
.acc-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--acc-bg), 0 0 0 4px var(--acc-accent);
}

/* ===========================================================================
 * OVERLAY + MODAL DE PREFERINȚE
 * ======================================================================== */
.acc-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  background: var(--acc-overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s;
}
@supports ((-webkit-backdrop-filter: blur(2px)) or (backdrop-filter: blur(2px))) {
  .acc-overlay { -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
}
html.acc--show-modal .acc-overlay { opacity: 1; visibility: visible; }

.acc-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5em;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;   /* lasă clicurile din afara dialogului spre overlay */
  transition: opacity .3s ease, visibility .3s;
}
html.acc--show-modal .acc-modal { opacity: 1; visibility: visible; }

.acc-modal__dialog {
  pointer-events: auto;   /* dialogul captează clicurile (nu se închide la clic pe el) */
  display: flex;
  flex-direction: column;
  width: min(40em, 100%);
  max-height: calc(100vh - 3em);
  max-height: calc(100dvh - 3em);
  background: var(--acc-bg);
  color: var(--acc-text);
  border-radius: calc(var(--acc-radius) + 4px);
  box-shadow: var(--acc-shadow);
  overflow: hidden;
  transform: translateY(1.25em) scale(.98);
  transition: transform .32s cubic-bezier(.16, 1, .3, 1);
}
html.acc--show-modal .acc-modal__dialog { transform: none; }

.acc-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  padding: 1.25em 1.4em;
  border-bottom: 1px solid var(--acc-border);
}
.acc-modal__title {
  margin: 0;
  font-size: 1.15em;
  font-weight: 700;
  letter-spacing: -.01em;
}
.acc-modal__close {
  -webkit-appearance: none;
  appearance: none;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2em;
  height: 2em;
  padding: 0;
  font-size: 1em;
  line-height: 1;
  color: var(--acc-muted);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.acc-modal__close:hover {
  background: var(--acc-surface-2);
  color: var(--acc-text);
}
.acc-modal__close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--acc-bg), 0 0 0 4px var(--acc-accent);
}

.acc-modal__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1.1em 1.4em;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--acc-border) transparent;
}
.acc-modal__body::-webkit-scrollbar { width: 10px; }
.acc-modal__body::-webkit-scrollbar-thumb {
  background: var(--acc-border);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}

.acc-modal__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6em;
  padding: 1.1em 1.4em;
  border-top: 1px solid var(--acc-border);
}
.acc-modal__foot .acc-btn { flex: 1 1 auto; }

/* ===========================================================================
 * SECȚIUNE CATEGORIE (.acc-cat)
 * ======================================================================== */
.acc-cat {
  padding: 1em 1.1em;
  background: var(--acc-surface-2);
  border: 1px solid var(--acc-border);
  border-radius: calc(var(--acc-radius) - 2px);
}
.acc-cat + .acc-cat { margin-top: .75em; }

.acc-cat__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
}
.acc-cat__title {
  font-size: .98em;
  font-weight: 600;
}
.acc-cat__desc {
  margin-top: .55em;
  font-size: .85em;
  color: var(--acc-muted);
}
.acc-cat__desc:empty { display: none; }
.acc-cat__desc a {
  color: var(--acc-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.acc-cat__desc a:hover { text-decoration: none; }

/* ===========================================================================
 * COMUTATOR (SWITCH) — label > input[type=checkbox] + .acc-switch__slider
 * ======================================================================== */
.acc-switch {
  position: relative;
  flex: 0 0 auto;
  display: inline-block;
  width: 2.75em;
  height: 1.6em;
  cursor: pointer;
}
.acc-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.acc-switch__slider {
  position: absolute;
  inset: 0;
  background: var(--acc-switch-off);
  border-radius: 999px;
  transition: background-color .2s ease, box-shadow .2s ease;
}
.acc-switch__slider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: .2em;
  width: 1.2em;
  height: 1.2em;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
  transform: translateY(-50%);
  transition: transform .2s cubic-bezier(.4, 0, .2, 1);
}
/* ON */
.acc-switch input:checked + .acc-switch__slider { background: var(--acc-accent); }
.acc-switch input:checked + .acc-switch__slider::before { transform: translate(1.15em, -50%); }
/* readOnly (necesare): comutator blocat, aspect atenuat */
.acc-switch input:disabled { cursor: not-allowed; }
.acc-switch input:disabled + .acc-switch__slider { opacity: .55; }
.acc-switch input:disabled ~ .acc-switch__slider,
.acc-switch:has(input:disabled) { cursor: not-allowed; }
/* Focus la tastatură */
.acc-switch input:focus-visible + .acc-switch__slider {
  box-shadow: 0 0 0 2px var(--acc-bg), 0 0 0 4px var(--acc-accent);
}

/* ===========================================================================
 * CREDIT (subsol modal): „Cookie consent by Asiimov.ro"
 * ======================================================================== */
.acc-credit {
  flex: 1 1 100%;
  margin-top: .3em;
  font-size: .72em;
  text-align: center;
  color: var(--acc-muted);
}
.acc-credit a {
  color: var(--acc-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.acc-credit a:hover { color: var(--acc-accent); }

/* ===========================================================================
 * BUTON DE RE-DESCHIDERE (.acc-reopen) — flotant „Setări cookies"
 * display „vizibil" = inline-flex (motorul comută prin style.display inline)
 * ======================================================================== */
.acc-reopen {
  position: fixed;
  bottom: 1.25em;
  left: 1.25em;
  z-index: 2147483640;
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: .65em .95em;
  font-size: .85em;
  font-weight: 600;
  color: var(--acc-text);
  background: var(--acc-bg);
  border: 1px solid var(--acc-border);
  border-radius: 999px;
  box-shadow: var(--acc-shadow);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.acc-reopen:hover {
  transform: translateY(-2px);
  background: var(--acc-surface-2);
}
.acc-reopen:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--acc-bg), 0 0 0 4px var(--acc-accent);
}
.acc-reopen__icon {
  flex: 0 0 auto;
  color: var(--acc-accent);   /* iconița moștenește prin currentColor */
  display: block;
}
.acc-reopen__text { white-space: nowrap; }

/* ===========================================================================
 * RESPONSIVE — mobil: banner full-width jos, modal ca „bottom sheet",
 * reopen redus la un buton rotund.
 * ======================================================================== */
@media (max-width: 36em) {
  /* Bannerul (mai puțin bara) devine o fișă lată jos, indiferent de poziție */
  .acc-banner:not(.acc-banner--bar) {
    left: .75em;
    right: .75em;
    bottom: .75em;
    top: auto;
    width: auto;
    max-width: none;
    transform: translateY(1em);
  }
  html.acc--show-banner .acc-banner:not(.acc-banner--bar) { transform: translateY(0); }

  .acc-banner__btns .acc-btn--primary,
  .acc-banner__btns .acc-btn--secondary { flex: 1 1 100%; }

  /* Modalul lipit de jos, aproape full-screen */
  .acc-modal { padding: 0; align-items: flex-end; }
  .acc-modal__dialog {
    width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: calc(var(--acc-radius) + 6px) calc(var(--acc-radius) + 6px) 0 0;
    transform: translateY(100%);
  }
  html.acc--show-modal .acc-modal__dialog { transform: none; }

  .acc-modal__foot .acc-btn { flex: 1 1 100%; }

  /* Reopen: doar iconiță (text ascuns accesibil) */
  .acc-reopen { padding: .8em; }
  .acc-reopen__text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
}

/* ===========================================================================
 * PREFERINȚĂ: mișcare redusă — oprește tranzițiile/transformările
 * ======================================================================== */
@media (prefers-reduced-motion: reduce) {
  .acc-banner,
  .acc-overlay,
  .acc-modal,
  .acc-modal__dialog,
  .acc-switch__slider,
  .acc-switch__slider::before,
  .acc-reopen,
  .acc-btn {
    transition-duration: .001ms !important;
  }
  .acc-banner,
  .acc-modal__dialog { transform: none !important; }
  .acc-banner--bottom-center,
  .acc-banner--top-center { transform: translateX(-50%) !important; }
  .acc-banner--middle-center { transform: translate(-50%, -50%) !important; }
}

/* ===========================================================================
 * PRINT — nu tipări niciun element de consimțământ
 * ======================================================================== */
@media print {
  .acc-banner,
  .acc-overlay,
  .acc-modal,
  .acc-reopen { display: none !important; }
}
