/**
 * Student Dark Mode — camada exclusiva da experiência do aluno.
 * Não alterar tokens.css / themes.css. Admin não carrega este arquivo.
 * html[data-theme="light"] não muda o visual atual.
 */

html[data-theme="light"] {
  color-scheme: light;
}

.awm-student-theme-toggle,
.awm-profile-chip {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background-color: rgba(255, 255, 255, 0.12);
  color: #fff;
  -webkit-text-fill-color: #fff;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.awm-student-theme-toggle:hover,
.awm-profile-chip:hover {
  background-color: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.55);
}

.awm-student-theme-toggle:focus-visible,
.awm-profile-chip:focus-visible {
  outline: 2px solid rgba(46, 196, 214, 0.85);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .aluno-top .awm-student-theme-toggle {
    flex: 0 0 auto;
  }
}

/* ——— Dark tokens (quiz DS) ——— */
html[data-theme="dark"] {
  color-scheme: dark;
  --awm-color-surface: #2a3544;
  --awm-color-surface-2: #323e4e;
  --awm-color-bg: #1b232d;
  --awm-color-bg-mid: #222c38;
  --awm-color-text: #e6edf2;
  --awm-color-text-muted: #9aa8b4;
  --awm-color-border: rgba(230, 237, 242, 0.1);
  --awm-color-border-strong: rgba(230, 237, 242, 0.18);
  --awm-color-success-soft: rgba(45, 180, 165, 0.2);
  --awm-color-danger-soft: rgba(196, 91, 106, 0.22);
  --awm-atmosphere-grid: rgba(230, 237, 242, 0.045);
  --awm-atmosphere-line: rgba(46, 196, 214, 0.08);
  --awm-atmosphere-coord: rgba(230, 237, 242, 0.14);
  --awm-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.28);
  --awm-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.32);
  --awm-shadow-md: 0 8px 28px rgba(0, 0, 0, 0.38);
  --awm-shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.42);
  --awm-color-disabled: #6b7c88;
  --primary: var(--awm-color-navy);
  --primary-soft: var(--awm-color-navy-soft);
  --accent: var(--awm-color-cyan);
  --surface: var(--awm-color-surface);
  --surface-2: var(--awm-color-surface-2);
  --text: var(--awm-color-text);
  --text-muted: var(--awm-color-text-muted);
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6 {
  color: var(--awm-color-text);
}

/* Navy-as-text no DS (não remapear --awm-color-navy: o chrome usa como fundo) */
html[data-theme="dark"] .awm-btn--ghost,
html[data-theme="dark"] .quiz-button--ghost,
html[data-theme="dark"] .awm-question__text,
html[data-theme="dark"] #question-text,
html[data-theme="dark"] .awm-options li,
html[data-theme="dark"] #options-list li,
html[data-theme="dark"] .awm-options li.selected,
html[data-theme="dark"] .awm-options li.correct,
html[data-theme="dark"] .awm-options li.incorrect,
html[data-theme="dark"] #options-list li.selected,
html[data-theme="dark"] #options-list li.correct,
html[data-theme="dark"] #options-list li.incorrect,
html[data-theme="dark"] .awm-panel__title,
html[data-theme="dark"] .awm-screen__heading,
html[data-theme="dark"] #start-screen .awm-screen__heading,
html[data-theme="dark"] #end-screen .awm-screen__heading,
html[data-theme="dark"] #start-screen h2,
html[data-theme="dark"] #end-screen h2,
html[data-theme="dark"] #score-text,
html[data-theme="dark"] .awm-mission__label,
html[data-theme="dark"] .awm-mission__station,
html[data-theme="dark"] .awm-mission__stats strong,
html[data-theme="dark"] .awm-briefing__title,
html[data-theme="dark"] .awm-briefing__personal strong,
html[data-theme="dark"] .awm-evolution__value,
html[data-theme="dark"] .awm-evolution__title,
html[data-theme="dark"] .awm-suggest__link,
html[data-theme="dark"] .awm-score__value,
html[data-theme="dark"] .awm-instrument__value,
html[data-theme="dark"] .awm-alert--info,
html[data-theme="dark"] .awm-card__num,
html[data-theme="dark"] .awm-score__compare,
html[data-theme="dark"] .awm-stat__value,
html[data-theme="dark"] .awm-footer__social-label,
html[data-theme="dark"] .site-footer__qr-label,
html[data-theme="dark"] .awm-collapse__summary,
html[data-theme="dark"] .awm-input {
  color: var(--awm-color-text);
}

html[data-theme="dark"] .awm-options li.selected,
html[data-theme="dark"] #options-list li.selected {
  background: rgba(46, 196, 214, 0.14);
  border-color: var(--awm-color-cyan);
}

html[data-theme="dark"] .awm-options li,
html[data-theme="dark"] #options-list li {
  border-color: rgba(230, 237, 242, 0.2);
}

html[data-theme="dark"] .awm-option__mark {
  color: #e6edf2;
  background: #3a4656;
  border-color: rgba(230, 237, 242, 0.22);
}

html[data-theme="dark"] .awm-badge {
  color: #d5dee6;
  background: #3a4656;
  border-color: rgba(230, 237, 242, 0.18);
}

html[data-theme="dark"] .awm-badge--cyan,
html[data-theme="dark"] .awm-badge--exam {
  color: #0b3a52;
  background: #7ee0d8;
  border-color: transparent;
}

html[data-theme="dark"] .awm-badge--status-new,
html[data-theme="dark"] .awm-badge--status-progress {
  color: #9ee8ef;
}

html[data-theme="dark"] .awm-briefing__list li,
html[data-theme="dark"] .awm-briefing__personal,
html[data-theme="dark"] .awm-briefing__eyebrow,
html[data-theme="dark"] .awm-mission__blurb,
html[data-theme="dark"] .awm-mission__stats,
html[data-theme="dark"] .awm-track__meta {
  color: #c5dce8;
}

html[data-theme="dark"] .awm-briefing--exam .awm-briefing__eyebrow {
  color: #7ee0d8;
}

html[data-theme="dark"] .awm-screen__lead,
html[data-theme="dark"] #end-screen .awm-screen__lead {
  color: #d5dee6;
}

html[data-theme="dark"] .awm-score--fail .awm-score__value,
html[data-theme="dark"] .awm-score--pass .awm-score__value {
  color: #e6edf2;
}

html[data-theme="dark"] .awm-score__meta,
html[data-theme="dark"] .awm-score--fail .awm-score__meta {
  color: #d5dee6;
}

html[data-theme="dark"] .awm-score__label.is-mid,
html[data-theme="dark"] .awm-score__label.is-low {
  color: #8ed4e0;
}

html[data-theme="dark"] .awm-score__label.is-fail {
  color: #f0b4bc;
}

html[data-theme="dark"] .awm-instruments--fail .awm-instrument__label,
html[data-theme="dark"] .awm-instrument__label {
  color: #d5dee6;
}

html[data-theme="dark"] .awm-instruments--fail .awm-instrument__value {
  color: #e6edf2;
}

html[data-theme="dark"] .awm-score__compare {
  color: #e6edf2;
  background: rgba(26, 155, 142, 0.22);
  border-color: rgba(126, 224, 216, 0.35);
}

html[data-theme="dark"] #question-text img,
html[data-theme="dark"] .awm-question__text img {
  max-width: 100%;
  height: auto;
}

/* Gabarito / summary — hex no DS */
html[data-theme="dark"] .awm-gabarito-resumo__panel {
  background: linear-gradient(180deg, #2a3544 0%, #243040 100%);
  border-color: var(--awm-color-border);
  box-shadow: var(--awm-shadow-md);
}

html[data-theme="dark"] .awm-summary-item,
html[data-theme="dark"] .summary-question {
  background: #323e4e;
  border-color: var(--awm-color-border);
}

html[data-theme="dark"] .awm-summary-item--correct,
html[data-theme="dark"] .summary-question.correct {
  background: linear-gradient(90deg, rgba(26, 155, 142, 0.22), #323e4e 42%);
}

html[data-theme="dark"] .awm-summary-item--incorrect,
html[data-theme="dark"] .summary-question.incorrect {
  background: linear-gradient(90deg, rgba(196, 91, 106, 0.22), #323e4e 42%);
}

html[data-theme="dark"] .awm-summary-item__q {
  color: #e6edf2 !important;
}

html[data-theme="dark"] .awm-summary-item__ans,
html[data-theme="dark"] .awm-summary-item__ok,
html[data-theme="dark"] .awm-summary-item p,
html[data-theme="dark"] .awm-gabarito-resumo__lead,
html[data-theme="dark"] .awm-summary-item__num {
  color: #d5dee6;
}

html[data-theme="dark"] .awm-summary-item__ans strong {
  color: #e6edf2;
}

html[data-theme="dark"] .awm-summary-item__ok strong {
  color: #7ee0d8;
}

html[data-theme="dark"] .awm-panel__title {
  color: #e6edf2;
}

html[data-theme="dark"] .awm-skeleton {
  background: linear-gradient(90deg, #2a3544 25%, #323e4e 50%, #2a3544 75%);
  background-size: 200% 100%;
}

html[data-theme="dark"] .awm-auth-sheet__card {
  background: linear-gradient(165deg, #2a3544 0%, #243040 100%);
  color: #e6edf2;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .awm-auth-sheet__close {
  color: #9aa8b4;
}

html[data-theme="dark"] .awm-auth-sheet h2,
html[data-theme="dark"] .awm-auth-sheet__lead,
html[data-theme="dark"] .awm-profile-sheet__email,
html[data-theme="dark"] .awm-profile-sheet__credits {
  color: #e6edf2;
}

html[data-theme="dark"] .awm-toast {
  background: #2a3544;
  color: #e6edf2;
  border-color: var(--awm-color-border);
}

/* Professor IA — overlays contextuais (não editar professor-ia.css) */
html[data-theme="dark"] .awm-pi-plans--v2,
html[data-theme="dark"] .awm-pi-plans--v2 .awm-pi-plans__hero h2,
html[data-theme="dark"] .awm-pi-plans--v2 .awm-pi-plans__sub,
html[data-theme="dark"] .awm-pi-plans--v2 .awm-pi-plans__card h3,
html[data-theme="dark"] .awm-pi-plans--v2 .awm-pi-plans__price,
html[data-theme="dark"] .awm-pi-plans--v2 .awm-pi-plans__card ul,
html[data-theme="dark"] .awm-pi-plans--v2 .awm-pi-plans__form h3,
html[data-theme="dark"] .awm-pi-plans--v2 .awm-pi-plans__form label,
html[data-theme="dark"] .awm-pi-plans--v2 .awm-pi-plans__form input[type="text"],
html[data-theme="dark"] .awm-pi-plans--v2 .awm-pi-plans__form input[type="email"] {
  color: #e6edf2;
}

html[data-theme="dark"] .awm-pi-plans--v2 .awm-pi-plans__hero,
html[data-theme="dark"] .awm-pi-plans--v2 .awm-pi-plans__card,
html[data-theme="dark"] .awm-pi-plans--v2 .awm-pi-plans__form {
  background: #2a3544;
  border-color: rgba(230, 237, 242, 0.12);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .awm-pi-plans--v2 .awm-pi-plans__form input[type="text"],
html[data-theme="dark"] .awm-pi-plans--v2 .awm-pi-plans__form input[type="email"] {
  background: #243040;
  border-color: rgba(230, 237, 242, 0.18);
}

html[data-theme="dark"] .awm-pi-legal-check {
  color: #e6edf2;
}
html[data-theme="dark"] .awm-pi-legal-hint {
  color: #9aa8b4;
}

html[data-theme="dark"] .awm-legal__article {
  background: linear-gradient(165deg, #243040 0%, #1e2834 100%);
  border-color: rgba(230, 237, 242, 0.12);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
}
html[data-theme="dark"] .awm-legal__header h1,
html[data-theme="dark"] .awm-legal__section h2 {
  color: #e6edf2;
}
html[data-theme="dark"] .awm-legal__section p {
  color: #c5d4de;
}
html[data-theme="dark"] .awm-legal__eyebrow {
  color: #7ee0d8;
  background: rgba(14, 165, 160, 0.16);
  border-color: rgba(46, 196, 214, 0.28);
}
html[data-theme="dark"] .awm-legal__meta,
html[data-theme="dark"] .awm-legal__hash {
  color: #9aa8b4;
}
html[data-theme="dark"] .awm-legal__chip {
  color: #c5f3ef;
  background: rgba(14, 165, 160, 0.16);
  border-color: rgba(46, 196, 214, 0.22);
}
html[data-theme="dark"] .awm-legal__section {
  border-left-color: rgba(46, 196, 214, 0.55);
}
html[data-theme="dark"] .awm-legal__hash {
  border-top-color: rgba(230, 237, 242, 0.1);
}
html[data-theme="dark"] .awm-legal__nav .awm-btn--ghost {
  color: #e6edf2;
  border-color: rgba(230, 237, 242, 0.22);
}

html[data-theme="dark"] .awm-pi-report,
html[data-theme="dark"] .awm-pi-tutor {
  background: linear-gradient(180deg, #243040 0%, #1e2834 100%);
  color: #e6edf2;
  border-color: rgba(230, 237, 242, 0.12);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] .awm-pi-report__block,
html[data-theme="dark"] .awm-pi-report__error,
html[data-theme="dark"] .awm-pi-tutor__callout,
html[data-theme="dark"] .awm-pi-tutor__card,
html[data-theme="dark"] .awm-pi-tutor__section,
html[data-theme="dark"] .awm-pi-tutor__closing,
html[data-theme="dark"] .awm-pi-tutor__focus,
html[data-theme="dark"] .awm-pi-tutor__lesson,
html[data-theme="dark"] .awm-pi-tutor__timeline li {
  background: #2a3544;
  border-color: rgba(230, 237, 242, 0.12);
  color: #e6edf2;
}

html[data-theme="dark"] .awm-pi-report__block h3,
html[data-theme="dark"] .awm-pi-report__coach-label,
html[data-theme="dark"] .awm-pi-report__next-label,
html[data-theme="dark"] .awm-pi-report__error strong,
html[data-theme="dark"] .awm-pi-tutor__card h3,
html[data-theme="dark"] .awm-pi-tutor__focus h4,
html[data-theme="dark"] .awm-pi-tutor__lesson header strong {
  color: #c5dce8;
}

html[data-theme="dark"] .awm-pi-tutor__facts {
  color: #9aa8b4 !important;
}

html[data-theme="dark"] .awm-pi-tutor__facts strong {
  color: #e6edf2 !important;
}

html[data-theme="dark"] .awm-pi-tutor__lesson-block span {
  color: #7ee0d8;
}

html[data-theme="dark"] .awm-pi-tutor__callout-head,
html[data-theme="dark"] .awm-pi-tutor__card-head,
html[data-theme="dark"] .awm-pi-tutor__section-head {
  color: #b8c5ce;
}

html[data-theme="dark"] .awm-pi-report__error p,
html[data-theme="dark"] .awm-pi-tutor__callout p,
html[data-theme="dark"] .awm-pi-tutor__card p,
html[data-theme="dark"] .awm-pi-tutor__focus p,
html[data-theme="dark"] .awm-pi-tutor__timeline p,
html[data-theme="dark"] .awm-pi-tutor__lesson-block p,
html[data-theme="dark"] .awm-pi-tutor__closing p {
  color: #d5dee6;
}

html[data-theme="dark"] .awm-pi-report__error-q {
  color: #e6edf2 !important;
}

html[data-theme="dark"] .awm-pi-report__error-ans,
html[data-theme="dark"] .awm-pi-report__error-ans span,
html[data-theme="dark"] .awm-pi-report__exam-meta {
  color: #9aa8b4;
}

html[data-theme="dark"] .awm-pi-report__error-ans strong {
  color: #e6edf2;
}

html[data-theme="dark"] .awm-pi-report__error-tip {
  color: #b8c5ce !important;
  border-top-color: rgba(230, 237, 242, 0.16);
}

html[data-theme="dark"] .awm-pi-report__error-ans--ok strong {
  color: #5ec4c0;
}

html[data-theme="dark"] .awm-pi-modal__card {
  background: linear-gradient(180deg, #2a3544 0%, #243040 100%);
  color: #e6edf2;
  border-color: rgba(230, 237, 242, 0.14);
}

html[data-theme="dark"] .awm-pi-modal__close,
html[data-theme="dark"] .awm-pi-modal__card h2,
html[data-theme="dark"] .awm-pi-modal__step-body label {
  color: #e6edf2;
}

html[data-theme="dark"] .awm-pi-modal__step {
  color: #7ec8d8;
}

html[data-theme="dark"] .awm-pi-modal__step-body input {
  background: #1e2834;
  color: #e6edf2;
  border-color: rgba(230, 237, 242, 0.18);
}

html[data-theme="dark"] .awm-pi-feedback--compact {
  background: rgba(42, 53, 68, 0.72);
  border-color: rgba(230, 237, 242, 0.16);
}

html[data-theme="dark"] .awm-pi-feedback {
  border-top-color: rgba(230, 237, 242, 0.12);
}

html[data-theme="dark"] .awm-pi-mail-btn {
  color: #e6edf2;
  background: linear-gradient(180deg, #2a3544 0%, #243040 100%);
  border-color: rgba(230, 237, 242, 0.16);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .awm-pi-mail-btn__icon {
  color: #5ec4c0;
}

html[data-theme="dark"] .awm-pi-mail-btn__sub {
  color: #d5dee6;
}

html[data-theme="dark"] .awm-pi-offer {
  background: #323e4e;
  color: #e6edf2;
}

html[data-theme="dark"] .awm-pi-offer--last {
  background: #3d3426;
  color: #f3d9a8;
}

html[data-theme="dark"] .awm-pi-plans__msg.is-error {
  color: #f0a0a0;
}

html[data-theme="dark"] .awm-pi-orb-btn svg circle[fill="#0b3a52"],
html[data-theme="dark"] .awm-pi-orb-btn svg [fill="#0b3a52"] {
  fill: #0b3a52;
}

html[data-theme="dark"] .awm-pi-report__plan-item,
html[data-theme="dark"] .awm-pi-report__error {
  background: #2a3544;
  border-color: rgba(230, 237, 242, 0.12);
}

html[data-theme="dark"] .awm-pi-report__plan-item header strong,
html[data-theme="dark"] .awm-pi-report__plan-item p {
  color: #e6edf2;
}

html[data-theme="dark"] .awm-pi-report__plan-item header span,
html[data-theme="dark"] .awm-pi-report__chip {
  color: #7ec8d8;
}

html[data-theme="dark"] .awm-pi-report__chip {
  background: rgba(46, 196, 214, 0.16);
}

html[data-theme="dark"] .awm-pi-tutor__lesson {
  background: #2a3544;
  border-color: rgba(230, 237, 242, 0.12);
}

html[data-theme="dark"] .awm-pi-tutor__card--concern {
  background: linear-gradient(90deg, rgba(196, 91, 106, 0.22), #2a3544 40%);
}

html[data-theme="dark"] .awm-pi-tutor__card--news {
  background: linear-gradient(90deg, rgba(26, 155, 142, 0.22), #2a3544 40%);
}

html[data-theme="dark"] .awm-profile-sheet__draft {
  background: rgba(14, 165, 160, 0.14);
  border-color: rgba(14, 165, 160, 0.35);
}

html[data-theme="dark"] .awm-profile-sheet__draft p,
html[data-theme="dark"] .awm-profile-sheet__credits,
html[data-theme="dark"] textarea.awm-input {
  color: #e6edf2;
}

html[data-theme="dark"] .site-footer,
html[data-theme="dark"] .site-footer__address,
html[data-theme="dark"] .site-footer__dev {
  color: #c5dce8;
}

html[data-theme="dark"] .site-footer a,
html[data-theme="dark"] .site-footer__link,
html[data-theme="dark"] .awm-link {
  color: #7ee0d8;
}

html[data-theme="dark"] .site-footer__link:hover,
html[data-theme="dark"] .awm-link:hover {
  color: #e6edf2;
}
