/* CBM System · Etapa 12 — atmosferas de fato distintas e reparos de legibilidade.
   Isolado do backend; desligar Halloween não exige remover nenhum componente. */

/* NÍVEL BAIXO: o System continua com o tema normal ou escuro original. Só a
   Home recebe o cenário, com controles legíveis e sem elementos animados. */
body.theme-retired-halloween-lite .hw-home-hero {
  position:relative;isolation:isolate;display:flex;align-items:center;min-height:clamp(310px,29vw,420px);
  margin:0 0 26px;overflow:hidden;border:1px solid #604a73;border-radius:16px;
  background:#21162c;color:#fff2e5;box-shadow:0 15px 40px #08051130;
}
body.theme-retired-halloween-lite .hw-hero-scene {
  position:absolute;inset:0;z-index:-1;pointer-events:none;
  background:linear-gradient(90deg,#1a1125ed 0%,#1a1125cf 38%,#1a112568 64%,#1a112500 100%),url('/assets/halloween-nightscape.svg') center/cover no-repeat;
  filter:saturate(.84) contrast(1.03);
}
body.theme-retired-halloween-lite .hw-hero-content {position:relative;z-index:2;padding:clamp(25px,5vw,65px);max-width:min(630px,78%)}
body.theme-retired-halloween-lite .hw-hero-kicker {display:block;margin-bottom:12px;color:#ffce9f;font:800 10px/1.5 Inter,system-ui,sans-serif;letter-spacing:.13em}
body.theme-retired-halloween-lite .hw-hero-chapter {color:#f1d3dc;font:600 12px/1.4 Inter,system-ui,sans-serif}
body.theme-retired-halloween-lite .hw-hero-content h1 {margin:10px 0 16px;color:#fff4e7;font:800 clamp(32px,4.4vw,62px)/1.05 Inter,system-ui,sans-serif;letter-spacing:-.04em}
body.theme-retired-halloween-lite .hw-hero-content h1 em {font-style:normal;color:#f5aa7e}
body.theme-retired-halloween-lite .hw-hero-content p {color:#f3e2e6;max-width:52ch;line-height:1.65;font-size:13px}
body.theme-retired-halloween-lite .hw-hero-actions {display:flex;flex-wrap:wrap;gap:12px;margin-top:23px}
body.theme-retired-halloween-lite .hw-hero-actions button {border-radius:9px;padding:12px 19px;min-height:42px;font:750 12px Inter,system-ui,sans-serif;cursor:pointer}
body.theme-retired-halloween-lite .hw-hero-primary {background:#f5a76d;color:#27162a;border:1px solid #ffc39b}
body.theme-retired-halloween-lite .hw-hero-secondary {background:#271831cc;color:#fff1e7;border:1px solid #b08a9e}
body.theme-retired-halloween-lite .hw-hero-actions button:hover {filter:brightness(1.12)}
body.theme-retired-halloween-lite .hw-hero-actions button:focus-visible {outline:3px solid #ffe9b6;outline-offset:3px}
body.theme-retired-halloween-lite .hw-hero-edition,body.theme-retired-halloween-lite .hw-hero-bottom {display:none}
body.theme-retired-halloween-lite .hw-home-hero :is(.hw11-specter,.hw11-spider,.hw11-parallax-foreground,[class^="hw12-"]) {display:none!important}

/* EQUILIBRADO: ambientação consolidada da edição noturna, com um fantasma e
   morcegos sutis. O máximo adiciona um segundo plano artístico e personagens. */
body.theme-retired-halloween[data-theme-intensity="medium"] .hw-home-hero {box-shadow:0 19px 48px #0905175c}
body.theme-retired-halloween[data-theme-intensity="medium"] .hw-home-hero :is(.hw12-moon-halo,.hw12-stage-forest,.hw12-pumpkin-field,.hw12-fireflies,.hw12-bat-cloud,.hw12-ghost-twins,.hw12-cat) {display:none!important}
body.theme-retired-halloween[data-theme-intensity="medium"] .hw11-specter {right:clamp(28px,7vw,100px)}

/* MÁXIMO: sobreposição ilustrada autocontida; nada se projeta sobre formulários,
   tabelas ou painel lateral. Alvos de interação ficam restritos ao hero. */
body.theme-retired-halloween .hw-home-hero :is(.hw12-moon-halo,.hw12-stage-forest,.hw12-pumpkin-field,.hw12-fireflies,.hw12-bat-cloud,.hw12-ghost-twins,.hw12-cat) {display:none}
body.theme-retired-halloween[data-theme-intensity="high"] .hw-home-hero {min-height:clamp(480px,40vw,640px);border-radius:27px;box-shadow:0 26px 75px #07031399,0 0 0 1px #d9a27d28}
body.theme-retired-halloween[data-theme-intensity="high"] .hw-hero-scene {background-position:center,center;filter:saturate(1.13)}
body.theme-retired-halloween[data-theme-intensity="high"] .hw-home-hero:after {background:linear-gradient(0deg,#100a1cdb 0%,transparent 34%),radial-gradient(circle at 78% 30%,#ffc98c1c,transparent 33%)}
body.theme-retired-halloween[data-theme-intensity="high"] .hw-home-hero .hw-hero-content {z-index:7;max-width:min(600px,65%)}
body.theme-retired-halloween[data-theme-intensity="high"] .hw-home-hero :is(.hw12-moon-halo,.hw12-stage-forest,.hw12-pumpkin-field,.hw12-fireflies,.hw12-bat-cloud,.hw12-ghost-twins,.hw12-cat) {display:block}
body.theme-retired-halloween[data-theme-intensity="high"] .hw-hero-edition {z-index:6}
body.theme-retired-halloween[data-theme-intensity="high"] .hw11-specter {right:clamp(136px,15vw,225px);bottom:52px;width:80px;height:113px;z-index:8}
body.theme-retired-halloween[data-theme-intensity="high"] .hw11-spider {right:32%;z-index:6}
body.theme-retired-halloween .hw12-moon-halo {position:absolute;right:10%;top:5%;z-index:2;width:clamp(145px,17vw,250px);aspect-ratio:1;border-radius:50%;background:radial-gradient(circle,#fff5d82b 12%,#ffc78a16 45%,transparent 72%);pointer-events:none;filter:blur(12px)}
body.theme-retired-halloween .hw12-stage-forest {position:absolute;inset:0;z-index:3;pointer-events:none;overflow:hidden}
body.theme-retired-halloween .hw12-tree {position:absolute;bottom:-30px;background:#110d1e;filter:drop-shadow(6px 2px 7px #0a0715);opacity:.92}
body.theme-retired-halloween .hw12-tree.first {right:-45px;width:265px;height:90%;clip-path:polygon(76% 100%,68% 61%,52% 46%,50% 42%,61% 52%,60% 23%,65% 52%,85% 74%,73% 28%,81% 50%,100% 30%,87% 63%,100% 76%,100% 100%)}
body.theme-retired-halloween .hw12-tree.second {right:14%;width:150px;height:49%;opacity:.62;clip-path:polygon(45% 100%,40% 55%,14% 25%,37% 48%,40% 10%,45% 54%,81% 31%,52% 60%,56% 100%)}
body.theme-retired-halloween .hw12-pumpkin-field {position:absolute;z-index:6;right:5%;bottom:5%;height:96px;width:148px;pointer-events:none}
body.theme-retired-halloween .hw12-pumpkin {position:absolute;right:27px;bottom:0;width:93px;height:78px;border-radius:44% 47% 43% 48%;background:repeating-linear-gradient(92deg,#9d4326 0 5px,#e77930 15px,#f6a04c 29px,#aa4828 35px);box-shadow:inset -8px -10px 18px #662c37,0 12px 20px #06041277;transform:rotate(-5deg)}
body.theme-retired-halloween .hw12-pumpkin:before {content:'';position:absolute;top:-12px;left:43px;width:12px;height:23px;border-radius:7px;background:#465132;transform:rotate(17deg)}
body.theme-retired-halloween .hw12-pumpkin i {position:absolute;top:32px;left:19px;width:57px;height:30px;background:#231024;clip-path:polygon(0 22%,21% 0,39% 44%,57% 0,78% 12%,100% 0,86% 85%,62% 100%,49% 65%,30% 98%,6% 72%);filter:drop-shadow(0 0 5px #ffce63)}
body.theme-retired-halloween .hw12-pumpkin.tiny {width:51px;height:47px;bottom:-4px;right:0;transform:scale(.9) rotate(7deg);background:repeating-linear-gradient(92deg,#b65b2f 0 6px,#f18d39 13px,#cb642b 25px)}
body.theme-retired-halloween .hw12-pumpkin.tiny:before {left:20px;width:9px;height:14px;top:-9px}
body.theme-retired-halloween .hw12-pumpkin.tiny i {width:25px;height:16px;top:19px;left:13px}
body.theme-retired-halloween .hw12-fireflies {position:absolute;inset:0;pointer-events:none;z-index:4}
body.theme-retired-halloween .hw12-fireflies i {position:absolute;width:4px;height:4px;border-radius:50%;background:#fff2ab;box-shadow:0 0 8px 3px #ffaf59c4;animation:hw12-luciole 3.7s ease-in-out infinite alternate}
body.theme-retired-halloween .hw12-fireflies i:nth-child(1) {top:21%;right:19%}
body.theme-retired-halloween .hw12-fireflies i:nth-child(2) {top:54%;right:32%;animation-delay:-1.2s}
body.theme-retired-halloween .hw12-fireflies i:nth-child(3) {top:66%;right:11%;animation-delay:-2.4s}
body.theme-retired-halloween .hw12-fireflies i:nth-child(4) {top:34%;right:43%;animation-delay:-.7s}
body.theme-retired-halloween .hw12-fireflies i:nth-child(5) {top:79%;right:27%;animation-delay:-3s}
body.theme-retired-halloween .hw12-bat-cloud {position:absolute;inset:0;pointer-events:none;z-index:5}
body.theme-retired-halloween .hw12-bat-cloud i {position:absolute;width:34px;height:16px;background:#140d24;clip-path:polygon(0 12%,14% 22%,23% 58%,34% 13%,45% 35%,50% 65%,55% 35%,66% 13%,77% 58%,86% 22%,100% 12%,93% 84%,76% 72%,64% 100%,50% 77%,36% 100%,24% 72%,7% 84%);animation:hw12-fly 8s ease-in-out infinite alternate;filter:drop-shadow(0 3px 2px #08050d55)}
body.theme-retired-halloween .hw12-bat-cloud i:nth-child(1) {top:15%;right:26%;transform:scale(.7)}
body.theme-retired-halloween .hw12-bat-cloud i:nth-child(2) {top:22%;right:38%;animation-delay:-2.1s;opacity:.82}
body.theme-retired-halloween .hw12-bat-cloud i:nth-child(3) {top:33%;right:13%;animation-delay:-4.1s;transform:scale(1.4)}
body.theme-retired-halloween .hw12-bat-cloud i:nth-child(4) {top:9%;right:44%;animation-delay:-3s;opacity:.6}
body.theme-retired-halloween .hw12-bat-cloud i:nth-child(5) {top:42%;right:30%;animation-delay:-1.6s;opacity:.65}
body.theme-retired-halloween .hw12-ghost-twins {position:absolute;right:30%;bottom:19%;z-index:6;pointer-events:none;width:120px;height:115px}
body.theme-retired-halloween .hw12-small-ghost {position:absolute;bottom:0;right:0;width:55px;height:70px;border-radius:48% 48% 15% 15%;background:linear-gradient(130deg,#e9dce9,#9c8dbf);clip-path:polygon(0 0,100% 0,100% 87%,81% 100%,60% 87%,39% 98%,20% 88%,0 100%);box-shadow:inset -6px -9px 13px #63476d;animation:hw12-float 5s ease-in-out infinite}
body.theme-retired-halloween .hw12-small-ghost:after {content:'••';position:absolute;top:35%;left:30%;letter-spacing:6px;font:900 23px Inter;color:#342143}
body.theme-retired-halloween .hw12-small-ghost.second {right:61px;bottom:24px;width:39px;height:56px;opacity:.86;animation-delay:-2.5s}
body.theme-retired-halloween .hw12-small-ghost.second:after {font-size:18px;letter-spacing:4px}
body.theme-retired-halloween .hw12-cat {position:absolute;right:16%;bottom:11%;width:85px;height:125px;z-index:8;border:0;background:none!important;cursor:pointer;filter:drop-shadow(0 12px 9px #0b071388)}
body.theme-retired-halloween .hw12-cat-body {position:absolute;left:14px;bottom:14px;width:62px;height:78px;border-radius:44% 46% 30% 30%;background:linear-gradient(100deg,#1f172b,#100a1e);box-shadow:inset -8px 0 12px #443052}
body.theme-retired-halloween .hw12-cat-body:before,body.theme-retired-halloween .hw12-cat-body:after {content:'';position:absolute;top:-23px;width:30px;height:37px;background:#1f172b;clip-path:polygon(0 0,100% 25%,45% 100%)}
body.theme-retired-halloween .hw12-cat-body:before {left:0}
body.theme-retired-halloween .hw12-cat-body:after {right:0;transform:scaleX(-1)}
body.theme-retired-halloween .hw12-cat-eye {position:absolute;top:24px;width:10px;height:14px;border-radius:45%;background:#e9c871;box-shadow:0 0 9px #dba84c8c;animation:hw12-cat-blink 6s ease-in-out infinite}
body.theme-retired-halloween .hw12-cat-eye:first-child {left:12px}
body.theme-retired-halloween .hw12-cat-eye:last-child {right:12px}
body.theme-retired-halloween .hw12-cat-tail {position:absolute;bottom:13px;right:-11px;width:47px;height:76px;border:11px solid #191124;border-left:0;border-bottom:0;border-radius:0 75% 0 0;transform-origin:bottom left;animation:hw12-tail 3s ease-in-out infinite}
body.theme-retired-halloween .hw12-cat-bubble {position:absolute;right:58px;bottom:100px;min-width:80px;padding:8px;border-radius:9px 9px 0 9px;background:#f8deb5;color:#2d192e;font:800 11px Inter,system-ui,sans-serif;opacity:0;transition:opacity .25s}
body.theme-retired-halloween .hw12-cat:is(:hover,:focus-visible,.is-awake) .hw12-cat-bubble {opacity:1}
body.theme-retired-halloween .hw12-cat.is-awake .hw12-cat-eye {background:#ffecab}
body.theme-retired-halloween .hw12-cat:focus-visible {outline:2px solid #ffe1a3;outline-offset:5px;border-radius:10px}

/* High intensity spreads a little of the atmosphere beyond Home, without
   adding equal-weight cards or changing form/table surfaces. */
body.theme-retired-halloween[data-theme-intensity="high"] .widget-rail {position:relative}
body.theme-retired-halloween[data-theme-intensity="high"] .widget-rail:before {content:'';position:absolute;top:-18px;right:13px;width:23px;height:30px;z-index:2;pointer-events:none;background:linear-gradient(#ad7a7e,#ffe1b0);clip-path:polygon(50% 0,69% 33%,100% 35%,75% 58%,87% 100%,49% 79%,10% 100%,25% 58%,0 35%,32% 33%);opacity:.77}
body.theme-retired-halloween[data-theme-intensity="high"] .page-head:not(.home-hub-head):before {content:'✧';float:right;color:#ca9c77;opacity:.55;font-size:22px;pointer-events:none}
body.theme-retired-halloween[data-theme-intensity="high"] .stat-card:first-child {border-top:2px solid #d8876d!important}
body.theme-retired-halloween[data-theme-intensity="high"] .stat-card:last-child {border-top:2px solid #d9aa73!important}
@keyframes hw12-luciole {from{opacity:.18;transform:translate(-5px,7px)}to{opacity:.96;transform:translate(11px,-14px)}}
@keyframes hw12-fly {from{translate:-14px 6px;rotate:-8deg}to{translate:21px -13px;rotate:9deg}}
@keyframes hw12-float {50%{transform:translateY(-17px) rotate(6deg)}}
@keyframes hw12-cat-blink {0%,42%,44%,100%{transform:scaleY(1)}43%{transform:scaleY(.12)}}
@keyframes hw12-tail {50%{transform:rotate(19deg)}}

/* Painel de configuração: a prévia reage visualmente, sem carregar os efeitos do site. */
.hw-intensity-description {padding:13px 15px;border-radius:10px;background:#272032;border:1px solid #6b536e;color:#f1dddb;font-size:12px;line-height:1.6;margin:13px 0}
.hw-demo[data-intensity="low"] {background:#edf0e9!important;border-color:#9ca7a0!important}
.hw-demo[data-intensity="low"] :is(.hw-preview-copy h2,.hw-preview-copy p,.hw-preview-copy small,.hw-preview-overline,.hw-preview-bottom) {color:#283728!important}
.hw-demo[data-intensity="low"]:before {opacity:.28;box-shadow:none}
.hw-demo[data-intensity="medium"] {background:linear-gradient(155deg,#48334b,#171124 75%)}
.hw-demo[data-intensity="high"] {background:radial-gradient(circle at 79% 24%,#ffb17578,transparent 27%),linear-gradient(155deg,#613c62,#120b21 75%);box-shadow:0 0 44px #6b3b8054 inset}
.hw-demo[data-intensity="high"] .hw-preview-bat {animation:hw12-fly 5s ease-in-out infinite alternate}
.hw-demo[data-motion="off"] .hw-preview-bat {animation:none!important}

/* Reparo de contraste: tabelas e matrizes administrativas com hover branco
   legado. As cores dos badges de status não devem ser apagadas. */
body.theme-retired-halloween .app-shell :is(.table,.sup-table,.chief-matrix,.chief-review-table,.ranking-table,.data-table,.classroom-table,.course-table,.deposit-table) tbody tr:hover > :is(td,th),
body.theme-retired-halloween .app-shell :is(.table,.sup-table,.chief-matrix,.chief-review-table,.ranking-table,.data-table,.classroom-table,.course-table,.deposit-table) tbody tr:focus-within > :is(td,th) {
  background-color:#372944!important;color:#fff0e8!important;border-color:#6b5477!important;
}
body.theme-retired-halloween .app-shell :is(.table,.sup-table,.chief-matrix,.chief-review-table,.ranking-table,.data-table,.classroom-table,.course-table,.deposit-table) tbody tr:hover :is(a,b,strong,.sup-person,.sup-person b,.sup-reason,.sup-date,.sup-applier) {color:#fff0e8!important}
body.theme-retired-halloween .app-shell :is(.table,.sup-table,.chief-matrix,.chief-review-table,.ranking-table,.data-table,.classroom-table,.course-table,.deposit-table) tbody tr:hover :is(small,.muted,.hint) {color:#d6c1d6!important}
body.theme-retired-halloween .app-shell :is(.profile-stats-card,.profile-grid,.home-hub,.chief-retro,.sup-dph,.course-application-form) :is(button,select,input,textarea):hover:not(:disabled) {border-color:#9d7b9e}
body.theme-retired-halloween .app-shell :is(.home-hub,.profile-grid,.chief-retro,.sup-dph,.course-application-form) :is(.card-body,.table-scroll,.table-header,.panel-header,.table-filter,.profile-achievement-strip) {color:#f7edf2}
body.theme-retired-halloween .app-shell :is(.home-hub,.profile-grid,.chief-retro,.sup-dph,.course-application-form) :is(input,textarea,select) {color-scheme:dark}
body.theme-retired-halloween .app-shell :is(.sup-tabs,.profile-tabs,.timeline-toolbar,.course-application-form,.ranking-tabs,.chief-retro) button:hover:not(:disabled) {background-color:#493651!important;color:#fff4e9!important}
body.theme-retired-halloween .app-shell :is(.sup-tabs,.profile-tabs,.timeline-toolbar,.course-application-form,.ranking-tabs,.chief-retro) button:focus-visible {outline:2px solid #ffe0a7!important;outline-offset:3px!important}
body.theme-retired-halloween .app-shell :is(.sup-dph,.chief-retro,.profile-grid) a:hover {color:#ffe0aa!important}
/* Mantém altura consistente na linha mesmo com motivos longos. */
.app-page .app-shell .sup-dph .sup-table tbody tr > td {height:auto;vertical-align:middle!important}
.app-page .app-shell .sup-dph .sup-table .sup-actions {display:table-cell!important;white-space:nowrap}

body.theme-retired-halloween[data-theme-effects="off"] .hw-home-hero :is(.hw12-bat-cloud i,.hw12-fireflies i,.hw12-small-ghost,.hw12-cat-eye,.hw12-cat-tail) {animation:none!important;transition:none!important}
@media(prefers-reduced-motion:reduce) {
  body.theme-retired-halloween .hw-home-hero :is(.hw12-bat-cloud i,.hw12-fireflies i,.hw12-small-ghost,.hw12-cat-eye,.hw12-cat-tail) {animation:none!important;transition:none!important}
  .hw-demo .hw-preview-bat {animation:none!important}
}
@media(max-width:1150px) {
  body.theme-retired-halloween[data-theme-intensity="high"] .hw-hero-content {max-width:72%}
  body.theme-retired-halloween[data-theme-intensity="high"] .hw12-ghost-twins {display:none}
}
@media(max-width:800px) {
  body.theme-retired-halloween-lite .hw-hero-content {max-width:100%;padding:30px}
  body.theme-retired-halloween-lite .hw-hero-scene {background-image:linear-gradient(90deg,#1a1125f2 0%,#1a1125cf 78%,#1a112594),url('/assets/halloween-nightscape.svg')}
  body.theme-retired-halloween[data-theme-intensity="high"] .hw-home-hero {min-height:420px}
  body.theme-retired-halloween[data-theme-intensity="high"] .hw-home-hero .hw-hero-content {max-width:100%}
  body.theme-retired-halloween[data-theme-intensity="high"] .hw-home-hero :is(.hw12-ghost-twins,.hw12-pumpkin-field,.hw12-cat,.hw12-stage-forest) {display:none!important}
  body.theme-retired-halloween[data-theme-intensity="high"] .hw11-specter {right:30px;bottom:15px;opacity:.35}
}
@media(max-width:520px) {
  body.theme-retired-halloween-lite .hw-home-hero {min-height:390px}
  body.theme-retired-halloween-lite .hw-hero-content h1 {font-size:clamp(32px,8vw,48px)}
  body.theme-retired-halloween-lite .hw-hero-actions {flex-direction:column;align-items:stretch}
  body.theme-retired-halloween[data-theme-intensity="high"] .hw-home-hero :is(.hw12-moon-halo,.hw12-bat-cloud) {display:none!important}
}
/* Em telas estreitas o carimbo editorial sai da área de ações; o título e os
   botões têm precedência sobre qualquer decoração sazonal. */
@media(max-width:800px) {
  body.theme-retired-halloween[data-theme-intensity="high"] .hw-home-hero .hw-hero-edition {display:none!important}
  body.theme-retired-halloween[data-theme-intensity="high"] .hw-home-hero .hw-hero-content {position:relative;z-index:10}
}
