/* =====================================================================================
   Tema Halloween pe tot panelul (21.10.2026, pana pe 01.11.2026 07:15 = finalul noptii de 31).
   Fisa: predari/HALLOWEEN_WEB_2026-10-20/panel/TEMA_HALLOWEEN_ART.md (paleta paginii /halloween).
   Doar peste „liquid glass” (html.bh-glass) si doar cu html.bh-hw (pus in <head>, oprit cu localStorage bhHw=off).
   Schimba tokenii de fundal / accent si adauga un strat de decor FIX, IN SPATELE continutului (z-index -1).
   Cardurile, tabelele si butoanele raman cum sunt. Animatii doar pe transform / opacity.
   ===================================================================================== */

/* ---------- tokeni: noapte (dark) ---------- */
html.bh-glass.bh-hw {
    --g-bg: #07050a;
    --g-bg-2: #120a18;
    --g-glow-1: rgba(155, 227, 58, .10);   /* cerul verde otravit, sus-stanga */
    --g-glow-2: rgba(107, 63, 160, .22);   /* ceata mov, dreapta */
    --g-glow-3: rgba(208, 20, 31, .13);    /* sange, jos */
    --g-text: #ebe5ef;
    --g-muted: #a99bb8;
    --g-link: #b6ec6a;
    --g-link-hover: #d6f7a6;
    --g-pane-a: rgba(196, 168, 236, .07);
    --g-pane-b: rgba(196, 168, 236, .026);
    --g-edge: rgba(214, 186, 255, .10);
    --g-chrome: rgba(13, 8, 19, .62);
    --g-chrome-solid: #120c18;
    --g-float: rgba(20, 13, 28, .84);
    --g-float-solid: #150e1d;
    --g-card-solid: #170f1f;
    --g-option-bg: #140d1b;
    --g-scroll: rgba(196, 168, 236, .2);
}
/* ---------- tokeni: amurg (light) ---------- */
html.bh-glass.bh-hw[data-bh-theme="light"] {
    --g-bg: #ece7f1;
    --g-bg-2: #f7f4fa;
    --g-glow-1: rgba(107, 63, 160, .16);
    --g-glow-2: rgba(255, 122, 26, .12);
    --g-glow-3: rgba(95, 191, 36, .10);
    --g-text: #1d1624;
    --g-muted: #6d6178;
    --g-link: #3f8a0e;
    --g-link-hover: #2c6a06;
    --g-pane-a: rgba(255, 255, 255, .78);
    --g-pane-b: rgba(255, 255, 255, .58);
    --g-edge: rgba(42, 16, 54, .10);
    --g-chrome: rgba(250, 247, 252, .66);
    --g-chrome-solid: #faf7fc;
    --g-float: rgba(255, 255, 255, .88);
    --g-float-solid: #ffffff;
    --g-card-solid: #ffffff;
    --g-option-bg: #ffffff;
    --g-scroll: rgba(42, 16, 54, .22);
}

/* ---------- stratul de decor ---------- */
.bh-hw-bg { display: none; }
html.bh-glass.bh-hw .bh-hw-bg {
    display: block;
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    user-select: none;
}
.bh-hw-bg img { position: absolute; display: block; max-width: none; }

/* luna de sange, sus-dreapta, cu halo */
.bh-hw-moon {
    top: 104px;
    right: 5vw;
    width: clamp(110px, 12vw, 220px);
    height: auto;
    opacity: .6;
    filter: drop-shadow(0 0 46px rgba(208, 20, 31, .5));
}
/* panza in coltul de sus si paianjenul atarnat de ea */
.bh-hw-web {
    top: 70px;
    right: -14px;
    width: clamp(150px, 15vw, 260px);
    height: auto;
    opacity: .3;
}
.bh-hw-spider-wrap {
    position: absolute;
    top: 70px;
    right: clamp(52px, 6vw, 104px);
    width: 38px;
    transform-origin: 50% 0;
    animation: bhHwSway 6.5s ease-in-out infinite alternate;
}
.bh-hw-spider-wrap::before {   /* firul */
    content: "";
    display: block;
    width: 1px;
    height: clamp(60px, 9vh, 110px);
    margin: 0 auto;
    background: linear-gradient(rgba(236, 227, 207, 0), rgba(236, 227, 207, .45));
}
.bh-hw-spider-wrap img { position: static; width: 38px; height: auto; opacity: .9; filter: drop-shadow(0 0 1px rgba(236, 227, 207, .55)) drop-shadow(0 0 8px rgba(208, 20, 31, .35)); }
@keyframes bhHwSway { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }

/* ceata mov de jos */
.bh-hw-fog {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 46vh;
    background:
        radial-gradient(80% 60% at 50% 100%, rgba(107, 63, 160, .30), transparent 70%),
        linear-gradient(to top, rgba(42, 16, 54, .55), rgba(42, 16, 54, 0));
}
/* cimitirul pe linia de jos */
.bh-hw-grave { bottom: -2px; height: auto; opacity: .55; }
.bh-hw-grave.is-l { left: 0; width: min(48vw, 780px); }
.bh-hw-grave.is-r { right: 0; width: min(40vw, 640px); }
/* luna din fundal se ascunde unde pagina are deja luna ei (bannerul de pe dashboard, /halloween) */
html.bh-glass.bh-hw body:has(.bh-hw-banner__moon, .bh-hw-hero__moon) .bh-hw-moon { display: none; }

/* dovlecii cu lumanarea pe „raftul” gol din header (.header-left), cu o palpaire calda dedesubt; nu stau peste carduri */
.bh-hw-pk { display: none; }
html.bh-glass.bh-hw .header-left .bh-hw-pk {
    display: block;
    position: relative;
    width: 118px;
    height: 44px;
    margin-left: 6px;
    pointer-events: none;
    user-select: none;
}
.bh-hw-pk img { position: absolute; bottom: 0; height: auto; max-width: none; }
.bh-hw-pk .p1 { left: 0; width: 44px; }
.bh-hw-pk .p3 { left: 38px; width: 36px; }
.bh-hw-pk .cd { left: 77px; width: 12px; bottom: 3px; }
.bh-hw-pk .p2 { left: 89px; width: 29px; }
.bh-hw-pk::before {
    content: "";
    position: absolute;
    left: -26px; right: -26px; bottom: -18px; height: 70px;
    background: radial-gradient(closest-side, rgba(255, 122, 26, .34), rgba(255, 122, 26, 0));
    animation: bhHwFlicker 2.8s ease-in-out infinite alternate;
}
html.bh-glass.bh-hw[data-bh-theme="light"] .bh-hw-pk::before { background: radial-gradient(closest-side, rgba(255, 122, 26, .22), rgba(255, 122, 26, 0)); }
@media (max-width: 991.98px) { html.bh-glass.bh-hw .header-left .bh-hw-pk { display: none; } }
@keyframes bhHwFlicker { 0% { opacity: .65; } 40% { opacity: 1; } 55% { opacity: .78; } 100% { opacity: .95; } }

/* granulatie fina de film, doar pe fundal */
html.bh-glass.bh-hw .bh-hw-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url("../images/halloween/grain.png") repeat;
    opacity: .06;
}

/* liliacul (bh-hw-theme.js): traverseaza cerul, rar */
.bh-hw-bat { position: absolute; left: 0; width: 56px; will-change: transform; animation: bhHwFly var(--d, 14s) linear forwards; }
.bh-hw-bat img { position: static; width: 100%; height: auto; opacity: .8; animation: bhHwFlap .22s ease-in-out infinite alternate; transform-origin: 50% 40%; }
.bh-hw-bat.is-rtl { animation-name: bhHwFlyR; }
.bh-hw-bat.is-rtl img { scale: -1 1; }
@keyframes bhHwFly { from { transform: translate(-90px, 0); } 50% { transform: translate(50vw, -5vh); } to { transform: translate(calc(100vw + 90px), 2vh); } }
@keyframes bhHwFlyR { from { transform: translate(calc(100vw + 90px), 0); } 50% { transform: translate(50vw, -6vh); } to { transform: translate(-90px, 3vh); } }
@keyframes bhHwFlap { from { transform: scaleY(1); } to { transform: scaleY(.62); } }

/* ---------- light: decorul mai discret ---------- */
html.bh-glass.bh-hw[data-bh-theme="light"] .bh-hw-moon { opacity: .4; filter: drop-shadow(0 0 30px rgba(208, 20, 31, .28)); }
html.bh-glass.bh-hw[data-bh-theme="light"] .bh-hw-web { opacity: .5; filter: brightness(.22); }
html.bh-glass.bh-hw[data-bh-theme="light"] .bh-hw-spider-wrap::before { background: linear-gradient(rgba(42, 16, 54, 0), rgba(42, 16, 54, .4)); }
html.bh-glass.bh-hw[data-bh-theme="light"] .bh-hw-fog { background: linear-gradient(to top, rgba(107, 63, 160, .16), rgba(107, 63, 160, 0)); }
html.bh-glass.bh-hw[data-bh-theme="light"] .bh-hw-grave { opacity: .22; }
html.bh-glass.bh-hw[data-bh-theme="light"] .bh-hw-bg::after { opacity: .035; }
html.bh-glass.bh-hw[data-bh-theme="light"] .bh-hw-bat img { opacity: .55; }

/* ---------- butonul din header (pornit / oprit pe dispozitiv) ---------- */
.bh-hw-toggle { display: none; }
html.bh-glass .bh-hw-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-right: 4px;
    border-radius: 14px;
    border: 1px solid var(--g-edge);
    background: var(--g-tint);
    color: var(--g-muted);
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease, transform .12s ease;
}
html.bh-glass .bh-hw-toggle:hover { background: var(--g-tint-2); color: var(--g-strong); }
html.bh-glass .bh-hw-toggle:active { transform: scale(.95); }
html.bh-glass .bh-hw-toggle i { font-size: 1.3rem; line-height: 1; }
html.bh-glass.bh-hw .bh-hw-toggle {
    color: #9be33a;
    border-color: rgba(155, 227, 58, .38);
    background: linear-gradient(135deg, rgba(208, 20, 31, .18), rgba(42, 16, 54, .35));
}
html.bh-glass.bh-hw[data-bh-theme="light"] .bh-hw-toggle { color: #3f8a0e; background: linear-gradient(135deg, rgba(208, 20, 31, .08), rgba(107, 63, 160, .1)); }

/* ---------- telefon ---------- */
@media (max-width: 767.98px) {
    .bh-hw-moon { top: 84px; right: 4vw; width: 96px; opacity: .5; }
    .bh-hw-web { top: 60px; width: 130px; }
    .bh-hw-spider-wrap { top: 60px; right: 40px; }
    .bh-hw-grave.is-l { width: 70vw; }
    .bh-hw-grave.is-r { width: 58vw; }
    html.bh-glass .bh-hw-toggle { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
    .bh-hw-spider-wrap, .bh-hw-pk::before, .bh-hw-bat, .bh-hw-bat img { animation: none !important; }
    .bh-hw-bat { display: none !important; }
}
