/* Portal CECO — tema escuro (v1.88).
   Carregado por último. Troca as variáveis do tema claro e corrige os componentes que tinham cor fixa.
   Regra: texto principal >= 7:1, texto secundário >= 4.5:1, nada "apagado". */
html[data-theme=dark]{
  --dk-bg:#0d1225;       /* fundo da página */
  --dk-surface:#171f3d;  /* cartões */
  --dk-raised:#212b52;   /* botões, blocos internos */
  --dk-brand:#3446b8;    /* azul CECO clareado para fundo de botão/ativo */
  --navy:#e7ebff;        /* no escuro, "navy" é a cor de título/destaque */
  --ink:#eef1fb;
  --muted:#b6bfdb;
  --line:#35416b;
  --paper:var(--dk-bg);
  --white:var(--dk-surface);
  --card:var(--dk-surface);
  --soft:var(--dk-raised);
  --yellow:#ffd24a;
  --green:#5ad7a2;
  --red:#ff938a;
  --red-bg:#3d1f27;
  --blue-bg:#1b2c57;
  color-scheme:dark;
}
html[data-theme=dark] body{background:var(--dk-bg);color:var(--ink)}
html[data-theme=dark] :where(h1,h2,h3,h4,strong,dt,label,legend){color:inherit}
html[data-theme=dark] h1,html[data-theme=dark] h2,html[data-theme=dark] h3{color:#fff}
html[data-theme=dark] .muted,html[data-theme=dark] small,html[data-theme=dark] dt{color:var(--muted)}
html[data-theme=dark] a{color:#ffd66b}
html[data-theme=dark] .skip-link{color:#15164b}

/* superfícies */
html[data-theme=dark] .workspace>header,html[data-theme=dark] .panel,html[data-theme=dark] .subject,html[data-theme=dark] .workspace,
html[data-theme=dark] .loginbox,html[data-theme=dark] .validation-result,html[data-theme=dark] .student-document-body,
html[data-theme=dark] .exam-bar,html[data-theme=dark] .reader-bar{background:var(--dk-surface);color:var(--ink);border-color:var(--line)}
html[data-theme=dark] .student-shell.is-student .bottom-nav,html[data-theme=dark] .bottom-nav{background:#121a35;border-color:var(--line)}
html[data-theme=dark] .student-shell.is-student .bottom-nav a,html[data-theme=dark] .bottom-nav a{color:#c9d1ec}
html[data-theme=dark] .student-shell.is-student .bottom-nav a.active,html[data-theme=dark] .bottom-nav a.active{color:#ffd66b}
html[data-theme=dark] .student-shell.is-student .bottom-nav a.active i,html[data-theme=dark] .bottom-nav a.active i{background:#3a3316}
html[data-theme=dark] aside{background:#0a0f20}
html[data-theme=dark] .menu-toggle,html[data-theme=dark] .password-field button{background:var(--dk-raised);color:var(--ink);border-color:var(--line)}

/* botões */
html[data-theme=dark] .btn,html[data-theme=dark] a.btn,html[data-theme=dark] .numbers button,html[data-theme=dark] .tabs a,html[data-theme=dark] .pill-links a{background:var(--dk-raised);color:var(--ink);border-color:#46538a}
html[data-theme=dark] .btn:hover,html[data-theme=dark] a.btn:hover{background:#2b3766}
html[data-theme=dark] .btn.primary,html[data-theme=dark] a.btn.primary,html[data-theme=dark] .tabs a.active,html[data-theme=dark] .pill-links a.active,
html[data-theme=dark] .question-count-options input:checked + span,html[data-theme=dark] .tag.navy{background:var(--dk-brand);color:#fff;border-color:var(--dk-brand)}
html[data-theme=dark] .btn.primary:hover{background:#4054cc}
html[data-theme=dark] .btn.yellow,html[data-theme=dark] a.btn.yellow,html[data-theme=dark] .a11y-tools button[aria-pressed=true]{background:var(--yellow);border-color:var(--yellow);color:#15164b}
html[data-theme=dark] .btn.danger{color:var(--red);border-color:#7a3a42}
html[data-theme=dark] .link-button{color:#ffd66b}

/* texto sobre fundo amarelo continua escuro */
html[data-theme=dark] .badge.earned i,html[data-theme=dark] .timeline li.current .dot,html[data-theme=dark] .video-embed button b,
html[data-theme=dark] .video-mark:not(.video-list .video-mark),html[data-theme=dark] .journey-step.done .journey-number{color:#15164b}
html[data-theme=dark] .video-list .video-mark{background:var(--dk-brand);color:#fff}
html[data-theme=dark] .video-list li.seen .video-mark{background:#16704a}

/* formulários */
html[data-theme=dark] input,html[data-theme=dark] select,html[data-theme=dark] textarea{background:#0f1630;color:var(--ink);border-color:#56638f}
html[data-theme=dark] input::placeholder,html[data-theme=dark] textarea::placeholder{color:#8f9ac0}
html[data-theme=dark] .check,html[data-theme=dark] .profile-photo-form,html[data-theme=dark] .subject-search,html[data-theme=dark] .calendar-grid>div,
html[data-theme=dark] .document-status-list li,html[data-theme=dark] .file-list li{background:var(--dk-raised);border-color:var(--line);color:var(--ink)}

/* alternativas (prova e treino) */
html[data-theme=dark] .option,html[data-theme=dark] button.option{background:var(--dk-raised);color:var(--ink);border-color:#46538a}
html[data-theme=dark] .option b{color:#ffd66b}
html[data-theme=dark] .option:has(input:checked){background:#26336a;border-color:#8ea2ff}
html[data-theme=dark] .practice-card .option.right{background:#123d2c;border-color:var(--green)}
html[data-theme=dark] .practice-card .option.wrong{background:var(--red-bg);border-color:var(--red)}

/* avisos e etiquetas */
html[data-theme=dark] .feedback{background:#1b2c57;color:var(--ink);border-left-color:#8ea2ff}
html[data-theme=dark] .feedback strong{color:#fff}
html[data-theme=dark] .tag{background:#2a3561;color:#dfe5ff}
html[data-theme=dark] .tag.green,html[data-theme=dark] .result-status.approved,html[data-theme=dark] .document-counter.complete,html[data-theme=dark] .validation-status.valid{background:#123d2c;color:#7ce8b8}
html[data-theme=dark] .tag.red,html[data-theme=dark] .result-status.failed{background:var(--red-bg);color:#ffb0a8}
html[data-theme=dark] .tag.blue{background:var(--blue-bg);color:#b4c9ff}
html[data-theme=dark] .tag.yellow{background:#3a3316;color:#ffe08a}
html[data-theme=dark] .qa .answer,html[data-theme=dark] .topic-check.done{background:#123d2c;border-color:#1f6b4b;color:var(--ink)}
html[data-theme=dark] .danger-zone{background:#2a1c24}

/* progresso e gamificação */
html[data-theme=dark] .ring{background:conic-gradient(var(--green) calc(var(--p)*1%),#2c3760 0)}
html[data-theme=dark] .ring::before{background:var(--dk-surface)}
html[data-theme=dark] .journey-bar,html[data-theme=dark] .week-dots span,html[data-theme=dark] .state-steps span,html[data-theme=dark] .mini-bar{background:#2c3760}
html[data-theme=dark] .week-dots span.on{background:var(--yellow)}
html[data-theme=dark] .timeline .dot,html[data-theme=dark] .badge i,html[data-theme=dark] .locked-year .lock,html[data-theme=dark] .feature-list li i,
html[data-theme=dark] .subject-image,html[data-theme=dark] .subject-row img,html[data-theme=dark] .subject-row .thumb,html[data-theme=dark] .account-avatar{background:#2a3561;color:#c9d1ec}
html[data-theme=dark] .timeline li.done .dot{background:#1f8a5c;color:#fff}
html[data-theme=dark] .badge{background:var(--dk-surface);border-color:var(--line)}
html[data-theme=dark] .badge.earned{background:linear-gradient(180deg,#3a3316,var(--dk-surface));border-color:#8b7422}
html[data-theme=dark] .streak .flame{background:#3a3316;color:#ffb54a}
html[data-theme=dark] .goal-options label:has(input:checked){background:#3a3316;border-color:var(--yellow)}
html[data-theme=dark] .celebrate{background:linear-gradient(135deg,#3a3316,#123d2c);border-color:#8b7422}
html[data-theme=dark] .plan div{background:var(--dk-raised)}
html[data-theme=dark] .plan strong,html[data-theme=dark] .kpi strong,html[data-theme=dark] .streak strong,html[data-theme=dark] .ring b{color:#fff}

/* documentos em papel (declaração, certificado, histórico) e apostila continuam claros */
html[data-theme=dark] .declaration-page,html[data-theme=dark] .certificate-model,html[data-theme=dark] .reader-canvas,html[data-theme=dark] .qr-box{
  --navy:#15164b;--ink:#222842;--muted:#626a7d;--line:#dce1eb;background:#fff;color:#111}
html[data-theme=dark] :is(.declaration-page,.certificate-model) :is(h1,h2,h3,h4,strong,a){color:#15164b}
html[data-theme=dark] :is(.declaration-page,.certificate-model) :is(p,span,dd,li){color:#111}
html[data-theme=dark] .declaration-page .muted,html[data-theme=dark] .declaration-page small{color:#4a5270}
html[data-theme=dark] .timeline li.current .dot,html[data-theme=dark] .badge.earned i{background:var(--yellow);color:#15164b}
html[data-theme=dark] .timeline li.done .dot{background:#16704a}

/* v1.89: blocos que usavam o azul CECO como fundo (no escuro, "navy" virou cor de texto) */
html[data-theme=dark] .loginbrand,html[data-theme=dark] .welcome,html[data-theme=dark] .video-resource,html[data-theme=dark] #notice:not(:empty){background:#1f2a66;color:#fff}
html[data-theme=dark] .loginbrand h1,html[data-theme=dark] .loginbrand p,html[data-theme=dark] .loginbrand span{color:#fff}
html[data-theme=dark] .onboarding .dots span.on{background:var(--yellow)}
html[data-theme=dark] .video-mark:not(.video-list .video-mark){background:var(--yellow);color:#15164b}
html[data-theme=dark] .pace-tile.ok{background:#123d2c}html[data-theme=dark] .pace-tile.ok span{color:#7ce8b8}
html[data-theme=dark] .pace-tile strong{color:#fff}
html[data-theme=dark] .theme-toggle.in-header{background:var(--dk-raised);border-color:var(--line)}html[data-theme=dark] .agenda-list a{color:var(--ink)}
/* v1.90 área da equipe */
html[data-theme=dark] .student-document-card{background:var(--dk-surface);border-color:var(--line)}
html[data-theme=dark] .student-document-card summary strong{color:#fff}
html[data-theme=dark] .document-counter.attention{background:#3a3316;color:#ffe08a}
html[data-theme=dark] table.cards tr{background:var(--dk-surface)}
