/* FranzDocente: surface/text pairs shared by public and teacher pages.
   Keep brand banners, answer colours and QR images intact. No blanket inversion.
   Use --theme-surface / --theme-text for new components, not --white as text. */
@media screen {
body.dark {
  color-scheme: dark;
  --theme-bg:#0a152b; --theme-surface:#132442; --theme-raised:#1a3153;
  --theme-field:#0e1e35; --theme-text:#e4ecfb; --theme-muted:#b4c5df;
  --theme-border:#365074; --theme-link:#90caff;
  --theme-purple-bg:#30284c; --theme-purple-text:#d5bdff;
  --theme-cyan-bg:#153942; --theme-cyan-text:#8fe1ed;
  --theme-green-bg:#173b36; --theme-green-text:#8ce0bb;
  --theme-orange-bg:#422e25; --theme-orange-text:#ffd09b;
  --theme-red-bg:#442537; --theme-red-text:#ffb6c5;
}
body.app-teacher.dark {
  --text-dark:var(--theme-text); --text-muted:var(--theme-muted);
  --border:var(--theme-border); --border-light:#2b3b58;
  --iv-ink:var(--theme-text); --iv-muted:var(--theme-muted); --iv-line:var(--theme-border);
  --ai-ink:var(--theme-text); --ai-muted:var(--theme-muted); --ai-line:var(--theme-border); --ai-bg:var(--theme-field);
  --ia-ink:var(--theme-text); --ia-muted:var(--theme-muted); --ia-line:var(--theme-border); --ia-bg:var(--theme-field);
  --rb-ink:var(--theme-text); --rb-muted:var(--theme-muted); --rb-line:var(--theme-border); --rb-surface:var(--theme-field);
  --live-ink:var(--theme-text); --live-muted:var(--theme-muted); --live-line:var(--theme-border); --live-soft:var(--theme-field);
}
/* Neutral surfaces, including dialogs and sections inserted after page load. */
body.app-teacher.dark :is(.course-context,.course-context-box,.course-info-box,.result-section-header,
  .word-ranking-item,.table-number,.session-select,.link-box,.control-status,.dialog-note,.dialog-actions,
  .evaluation-modal-actions,.eval-info,.option-item,.explanation-box,.expected-box,.competence-box,
  .type-choice label,.rubric-table th,.criterion-weight,.quick-topic,.q-tag,.history-status,
  .tool-status.available,.iv-btn,.recent-action:not(.main),.back,.btn.cancel,.add,
  .evaluation-modal-close,.dialog-btn:not(.primary):not(.danger)) {
  background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border);
}
body.app-teacher.dark :is(.ia-card,.panel-card,.form-card,.session-card,.result-section,.board-card,
  .course-context,.course-context-box,.course-info-box,.evaluation-dialog,.system-dialog,
  .profile-modal,.modal-card,.edit-question-modal-card) :is(label,legend,strong,th) {color:var(--theme-text)}
body.app-teacher.dark :is(.qr-info,.session-card-head,.card-heading,.course-box,.course-context-info,
  .result-section-header) :is(p,small) {color:var(--theme-muted)}
body.app-teacher.dark :is(.page-breadcrumb,.crumb) {color:var(--theme-muted)}
body.app-teacher.dark :is(.page-breadcrumb,.crumb) :is(a,.current),
body.app-teacher.dark :is(.section-kicker,.btn-profile-view) {color:var(--theme-link)}
body.app-teacher.dark :is(.mc-kicker,.cx-kicker,.mi-kicker) {color:var(--theme-purple-text)}
body.app-teacher.dark .required {color:var(--theme-red-text)}
body.app-teacher.dark :is(input,textarea,select):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]) {
  background-color:var(--theme-field); color:var(--theme-text); border-color:var(--theme-border);
  caret-color:var(--theme-link);
}
body.app-teacher.dark :is(input,textarea)::placeholder {color:#9bacc7;opacity:1}
body.app-teacher.dark :is(input,textarea,select):focus-visible {outline-color:var(--theme-link)}
body.app-teacher.dark select option {color:var(--theme-text);background:var(--theme-field)}
body.app-teacher.dark :is(.generated-field,.option-input,.explanation-field,.result-title-input,
  .result-description,.criterion-name,.criterion-description,.descriptor-input,.level-name,.competence-input):focus {
  color:var(--theme-text);background:var(--theme-field);
}
body.app-teacher.dark :is(.table-number,.word-ranking-item,.result-section-header) :is(span,strong,td,th) {color:inherit}
body.app-teacher.dark :is(table td,table th) {border-color:var(--theme-border)}
body.app-teacher.dark tbody tr:hover {background-color:var(--theme-raised)}
/* --white was also used as foreground by these legacy buttons/avatars. */
body.app-teacher.dark :is(.student-avatar,.btn-register,.btn-primary,.btn-submit,.btn-save) {color:#fff}
body.app-teacher.dark .btn-register {background-color:#146b4b}
body.app-teacher.dark :is(.btn-register,.btn-primary,.btn-submit,.btn-save) :is(span,strong) {color:inherit}
/* Semantic pairs retain meaning without pastel backgrounds and pale text. */
body.app-teacher.dark :is(.type-banner,.type-banner.ideas,.btn-action.btn-edit) {
  background:var(--theme-purple-bg);color:var(--theme-purple-text);border-color:#61517b;
}
body.app-teacher.dark .type-banner.cloud {background:var(--theme-cyan-bg);color:var(--theme-cyan-text)}
body.app-teacher.dark .type-banner.poll {background:#20395d;color:#b5d6ff}
body.app-teacher.dark :is(.type-banner.traffic,.btn-action.btn-download) {background:var(--theme-green-bg);color:var(--theme-green-text)}
body.app-teacher.dark .type-banner :is(strong,span) {color:inherit;opacity:1}
body.app-teacher.dark :is(.mi-page button.archive,.btn-page-action.live) {background:var(--theme-orange-bg);color:var(--theme-orange-text);border-color:#765538}
body.app-teacher.dark .recent-action.main {background:#076779;color:#fff;border-color:#228ea0}
body.app-teacher.dark .qr-wrap {background:#fff;color:#172444;color-scheme:light}
/* Legacy gradients are backgrounds too: changing only background-color leaves them white. */
body.app-teacher.dark :is(.ai-stat,.iv-stat,.ai-tool,.type-card,.recent-card,.history-card,
  .library-card,.empty-history,.iv-empty,.setting-item,.session-stat) {
  background:linear-gradient(135deg,var(--theme-surface),#172d4b);
  color:var(--theme-text);border-color:var(--theme-border);
}
body.app-teacher.dark :is(.tool-footer,.type-go,.recent-type,.history-type,.results-kicker,
  .participant-avatar,.word-cloud-item,.tool-status,.type-tag) {color:var(--theme-link)}
body.app-teacher.dark :is(.link-text,.setting-info span) {color:var(--theme-muted)}
body.app-teacher.dark .type-card p {color:var(--theme-muted)}
body.app-teacher.dark :is(.tool-status,.type-tag) {background:var(--theme-raised);border-color:var(--theme-border)}
body.app-teacher.dark .ai-philosophy {background:var(--theme-green-bg);border-color:#365b50}
body.app-teacher.dark .ai-philosophy :is(strong,p) {color:var(--theme-green-text)}
/* These two avatar colours are supplied inline by the existing profile renderer. */
body.app-teacher.dark .student-avatar[style*="#0dcaf0"],
body.app-teacher.dark .student-avatar[style*="#fd7e14"] {color:#071a4d}
body.app-teacher.dark :is(.security-note,.current-course-box,.csv-box,.fv-answer label,
  .edit-modal-footer,.delete-question-actions,.profile-modal-footer) {
  background:var(--theme-raised);color:var(--theme-text);border-color:var(--theme-border);
}
body.app-teacher.dark :is(.btn-elegir,.form-section-number,.question-number-circle,
  .context-badge,.question-number,.type-option-text strong) {color:var(--theme-link)}
body.app-teacher.dark .avatar-inicial {color:#fff}
body.app-teacher.dark .avatar-inicial[style*="#0dcaf0"],
body.app-teacher.dark .avatar-inicial[style*="#fd7e14"] {color:#071a4d}
body.app-teacher.dark :is(.live-indicator,.btn-question-action.btn-edit) {background:var(--theme-orange-bg);color:var(--theme-orange-text)}
body.app-teacher.dark .btn-page-action.interactions {background:var(--theme-cyan-bg);color:var(--theme-cyan-text)}
body.app-teacher.dark :is(.score-status.ok,.question-type.fv) {background:var(--theme-green-bg);color:var(--theme-green-text)}
body.app-teacher.dark .btn-question-action.btn-delete {background:var(--theme-red-bg);color:var(--theme-red-text)}
body.app-teacher.dark .fv-answer.true input:checked+label {background:var(--theme-green-bg);color:var(--theme-green-text);border-color:#69c7a3}
body.app-teacher.dark .fv-answer.false input:checked+label {background:var(--theme-red-bg);color:var(--theme-red-text);border-color:#e897aa}

/* Public homepage: light cards previously inherited a near-white --ink. */
body.app-public.dark {--ink:var(--theme-text);--text:var(--theme-muted);--muted:#afbed5;--line:var(--theme-border)}
body.app-public.dark :is(.interaction-card,.auth-card,.feature-card,.eval-feature,.ai-tool) {
  background:var(--theme-surface);color:var(--theme-text);border-color:var(--theme-border);
}
body.app-public.dark :is(.interaction-card,.auth-card,.feature-card,.eval-feature,.ai-tool) :is(h2,h3,h4,label,strong) {color:var(--theme-text)}
body.app-public.dark :is(.interaction-card,.auth-card,.feature-card,.eval-feature,.ai-tool) p {color:var(--theme-muted)}
body.app-public.dark .interaction-card :is(a,small) {color:var(--theme-link)}
body.app-public.dark :is(.auth-tabs,.auth-tabs button,.google-btn,.btn-google) {background:var(--theme-raised);color:var(--theme-text);border-color:var(--theme-border)}
body.app-public.dark .auth-tabs button.active {background:#0969b5;color:#fff}
body.app-public.dark .form-group :is(input,select) {background:var(--theme-field);color:var(--theme-text);border-color:var(--theme-border)}
body.app-public.dark .form-group input::placeholder {color:#a6b8d3;opacity:1}
body.app-public.dark :is(.auth-footer,.auth-divider,.auth-divider span) {color:var(--theme-muted);background-color:var(--theme-surface)}
body.app-public.dark .auth-footer a {color:var(--theme-link)}
body.app-public.dark :is(.feature-card .mini-link,.ai-tool>span,.question-types span.active,
  .section-heading .eyebrow,.eval-copy .eyebrow,.ai-copy .eyebrow) {color:var(--theme-link)}
body.app-public.dark :is(.feature-badge,.status-live,.demo-pill) {background:var(--theme-raised);color:var(--theme-link)}
body.app-public.dark .roulette-btn {background:#a74c0b;color:#fff}
body.app-public.dark .student-row:nth-child(2) .student-avatar {background:#146b4b}
body.app-public.dark .student-row:nth-child(3) .student-avatar {color:#071a4d}
body.app-public.dark :is(.console-top,.demo-card,.demo-user) {background:var(--theme-surface);border-color:var(--theme-border);color:var(--theme-text)}
body.app-public.dark :is(.console-label,.demo-card p,.demo-user-text small,.demo-stat span,.eval-stat small) {color:var(--theme-muted)}
body.app-public.dark .question-bank strong {color:var(--theme-text)}
body.app-public.dark .demo-stat {background:var(--theme-surface);border-color:var(--theme-border)}
body.app-public.dark :is(.demo-user-text strong,.demo-card h4) {color:var(--theme-text)}
body.app-public.dark :is(.eval-top span,.live-board-head small) {color:var(--theme-muted)}
/* Colour is inline in the homepage demonstration data. */
body.app-public.dark :is(.ai-copy .eyebrow,.ai-tool>span,.demo-pill) {color:var(--theme-link)!important}
body.app-public.dark .demo-stat strong {color:var(--theme-text)}
body.app-public.dark .eval-course small {color:var(--theme-muted)}
}
