/* Tema exclusivo das páginas públicas do GEducacional.
   Não utiliza data-theme nem a preferência do painel administrativo. */
html[data-theme-scope="public"] {
  --public-theme-surface: #ffffff;
  --public-theme-surface-soft: #f7f9fd;
  --public-theme-surface-raised: #ffffff;
  --public-theme-background: #f4f7fb;
  --public-theme-border: #d8e1ef;
  --public-theme-text: #172033;
  --public-theme-muted: #647089;
  --public-theme-input: #ffffff;
  --public-theme-shadow: 0 16px 42px rgba(23, 47, 89, .11);
}

html[data-theme-scope="public"][data-public-theme="dark"] {
  color-scheme: dark;
  --public-theme-surface: #101a2b;
  --public-theme-surface-soft: #131f32;
  --public-theme-surface-raised: #162337;
  --public-theme-background: #08111f;
  --public-theme-border: #2b3c58;
  --public-theme-text: #eef4ff;
  --public-theme-muted: #a7b5cb;
  --public-theme-input: #142137;
  --public-theme-shadow: 0 18px 48px rgba(0, 0, 0, .28);
  --color-surface: #101a2b;
  --color-background: #08111f;
  --color-background-strong: #17243a;
  --color-border: #2b3c58;
  --color-text: #eef4ff;
  --color-muted: #a7b5cb;
  --color-primary-50: #142a4d;
  --color-blue-50: #12283d;
  --color-danger-50: #351d27;
  --color-warning-50: #332a17;
  --color-success-50: #14283a;
  --shadow-sm: 0 6px 20px rgba(0, 0, 0, .2);
  --shadow-md: 0 16px 42px rgba(0, 0, 0, .3);
}

/* Controle compartilhado das páginas públicas */
.public-theme-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.public-theme-toggle {
  --public-toggle-border: #bfd0e9;
  --public-toggle-surface: rgba(255, 255, 255, .82);
  --public-toggle-text: #294464;
  --public-toggle-track: #e8eef8;
  --public-toggle-thumb: #ffffff;
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex: 0 0 auto;
  padding: 5px 12px 5px 7px;
  border: 1px solid var(--public-toggle-border);
  border-radius: 13px;
  color: var(--public-toggle-text);
  background: var(--public-toggle-surface);
  box-shadow: 0 6px 18px rgba(30, 63, 110, .07);
  font: inherit;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(14px);
  transition: border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.public-theme-toggle:hover {
  border-color: #8eadd7;
  transform: translateY(-1px);
  box-shadow: 0 9px 22px rgba(30, 63, 110, .11);
}

.public-theme-toggle:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .22);
  outline-offset: 2px;
}

.public-theme-toggle__track {
  position: relative;
  width: 46px;
  height: 28px;
  flex: 0 0 46px;
  border-radius: 999px;
  background: var(--public-toggle-track);
  transition: background .2s ease;
}

.public-theme-toggle__track svg {
  position: absolute;
  top: 7px;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  z-index: 1;
}

.public-theme-toggle__sun { left: 7px; color: #d7891d; }
.public-theme-toggle__moon { right: 7px; color: #64748b; }

.public-theme-toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--public-toggle-thumb);
  box-shadow: 0 2px 7px rgba(33, 52, 79, .2);
  transition: transform .22s ease, background .22s ease;
  z-index: 2;
}

html[data-public-theme="dark"] .public-theme-toggle {
  --public-toggle-border: #385071;
  --public-toggle-surface: rgba(17, 29, 48, .9);
  --public-toggle-text: #dce8fa;
  --public-toggle-track: #263b59;
  --public-toggle-thumb: #dce8fa;
  box-shadow: 0 7px 20px rgba(0, 0, 0, .18);
}

html[data-public-theme="dark"] .public-theme-toggle__thumb { transform: translateX(18px); }
html[data-public-theme="dark"] .public-theme-toggle__sun { color: #8ea1bc; }
html[data-public-theme="dark"] .public-theme-toggle__moon { color: #f4b553; }

.public-theme-toggle--floating {
  position: fixed;
  top: 22px;
  right: 24px;
  z-index: 20;
}

.public-theme-actions--admin {
  width: 100%;
  justify-self: stretch;
  justify-content: flex-end;
}

/* Página pública de escolha de portal */
html[data-public-theme="dark"] .portal-entry-page {
  --entry-navy-900: #eef4ff;
  --entry-navy-800: #d6e4fa;
  --entry-text: #e8f0fb;
  --entry-muted: #a4b3c9;
  --entry-border: #2b3d59;
  --entry-surface: #101a2b;
  --entry-background: #08111f;
  background:
    radial-gradient(circle at 4% 18%, rgba(56, 189, 248, .11), transparent 25%),
    radial-gradient(circle at 94% 16%, rgba(124, 58, 237, .12), transparent 23%),
    linear-gradient(180deg, #0b1525 0%, #08111f 100%);
}

html[data-public-theme="dark"] .entry-header,
html[data-public-theme="dark"] .entry-footer {
  border-color: rgba(64, 83, 112, .72);
  background: rgba(10, 20, 35, .9);
}

html[data-public-theme="dark"] .portal-card {
  background: rgba(16, 27, 45, .96);
  box-shadow: 0 16px 38px rgba(0, 0, 0, .2);
}

html[data-public-theme="dark"] .portal-card--admin { --portal-soft: #142a4d; }
html[data-public-theme="dark"] .portal-card--teacher { --portal-soft: #261f47; }
html[data-public-theme="dark"] .portal-card--student { --portal-soft: #352916; }

html[data-public-theme="dark"] .entry-create-access {
  border-color: #3a5274;
  color: #dce8fa;
  background: rgba(18, 34, 56, .9);
}

html[data-public-theme="dark"] .entry-create-access:hover { background: #172a45; }
html[data-public-theme="dark"] .entry-create-access__icon { background: #1d4d96; }

/* Login administrativo */
html[data-public-theme="dark"] .admin-login-page {
  --admin-ink: #edf4ff;
  --admin-muted: #a6b5cb;
  --admin-line: #30425f;
  --admin-surface: #08111f;
}

html[data-public-theme="dark"] .admin-login-access {
  background:
    radial-gradient(circle at 80% 12%, rgba(39, 91, 172, .14), transparent 42%),
    #0b1525;
}

html[data-public-theme="dark"] .admin-login-card h2,
html[data-public-theme="dark"] .admin-login-form .field > span,
html[data-public-theme="dark"] .admin-login-form .field-heading,
html[data-public-theme="dark"] .admin-login-form .check {
  color: #e6eefb;
}

html[data-public-theme="dark"] .admin-login-form .field-heading a,
html[data-public-theme="dark"] .portal-switcher__label,
html[data-public-theme="dark"] .admin-security { color: #9aaac1; }

html[data-public-theme="dark"] .admin-login-form .input {
  border-color: #30425f;
  color: #eef4ff;
  background: #142137;
}

html[data-public-theme="dark"] .admin-login-form .input:hover { border-color: #466184; }
html[data-public-theme="dark"] .admin-login-form .input:focus { border-color: var(--admin-blue); background: #17263e; }
html[data-public-theme="dark"] .admin-login-form .input::placeholder { color: #74859f; }

html[data-public-theme="dark"] .admin-create-button {
  border-color: #36547e;
  color: #8fb6ff;
  background: #14233a;
}
html[data-public-theme="dark"] .admin-create-button:hover { background: #192b47; }
html[data-public-theme="dark"] .portal-switcher { border-top-color: #263952; }
html[data-public-theme="dark"] .portal-switcher__links a {
  border-color: #2c405d;
  color: #c2d0e3;
  background: #111f33;
}
html[data-public-theme="dark"] .portal-switcher__links a:hover { border-color: #45658f; color: #8fb6ff; background: #172943; }
html[data-public-theme="dark"] .portal-switcher__links a > span { color: #8fb6ff; background: #172f54; }

/* Portal público do professor */
html[data-public-theme="dark"] .teacher-login-page {
  --teacher-ink: #eef1fb;
  --teacher-muted: #aaa8bd;
  --teacher-line: #393755;
  background: #0c1220;
}

html[data-public-theme="dark"] .teacher-login-access {
  background: #0d1423;
  box-shadow: 24px 0 70px rgba(0, 0, 0, .18);
}
html[data-public-theme="dark"] .teacher-login-form .field > span,
html[data-public-theme="dark"] .teacher-login-form .check { color: #d2d0df; }
html[data-public-theme="dark"] .teacher-login-form .input {
  border-color: #3a3856;
  color: #eef1fb;
  background: #17172a;
}
html[data-public-theme="dark"] .teacher-login-form .input::placeholder { color: #7c7a90; }
html[data-public-theme="dark"] .teacher-create-button { border-color: #4b4378; color: #aa9cff; background: #1b1933; }
html[data-public-theme="dark"] .teacher-create-button:hover { background: #24203f; }
html[data-public-theme="dark"] .teacher-login-visual {
  background:
    radial-gradient(circle at 86% 8%, rgba(114, 86, 218, .22), transparent 29%),
    radial-gradient(circle at 15% 88%, rgba(53, 127, 184, .16), transparent 35%),
    linear-gradient(145deg, #15152b 0%, #161a32 52%, #132238 100%);
}
html[data-public-theme="dark"] .teacher-visual-copy h2 { color: #c8bcff; }
html[data-public-theme="dark"] .teacher-visual-copy p { color: #aaa7bd; }
html[data-public-theme="dark"] .teacher-routine span { border-color: #3d3b5c; color: #d2d0df; background: rgba(22, 22, 39, .8); }
html[data-public-theme="dark"] .teacher-login-visual::after { border-color: rgba(154, 130, 241, .17); }

/* Portal público do aluno */
html[data-public-theme="dark"] .student-login-page {
  --student-ink: #eaf5ff;
  --student-muted: #a4bbcd;
  --student-line: #2d4b60;
  background:
    radial-gradient(circle at 6% 80%, rgba(45, 152, 180, .14), transparent 25%),
    radial-gradient(circle at 92% 10%, rgba(183, 126, 38, .1), transparent 23%),
    linear-gradient(135deg, #091825 0%, #0a1523 48%, #1a1711 100%);
}
html[data-public-theme="dark"] .student-topbar { border-bottom-color: #274257; background: rgba(8, 18, 31, .84); }
html[data-public-theme="dark"] .student-login-card { border-color: #2d5066; background: rgba(14, 29, 43, .96); box-shadow: 0 24px 70px rgba(0, 0, 0, .25); }
html[data-public-theme="dark"] .student-progress-list span,
html[data-public-theme="dark"] .student-login-form .field > span,
html[data-public-theme="dark"] .student-login-form .check { color: #c3d5e1; }
html[data-public-theme="dark"] .student-login-form .input { border-color: #315167; color: #eaf5ff; background: #11283a; }
html[data-public-theme="dark"] .student-login-form .input::placeholder { color: #718da1; }
html[data-public-theme="dark"] .student-create-button { border-color: #315d75; color: #64c5ef; background: #102b3e; }
html[data-public-theme="dark"] .student-create-button:hover { background: #14364b; }
html[data-public-theme="dark"] .student-visual-note { border-color: #31556b; color: #bad0df; background: rgba(13, 31, 45, .92); box-shadow: 0 9px 24px rgba(0, 0, 0, .18); }

/* Escolha pública do tipo de cadastro */
html[data-public-theme="dark"] .access-create-page {
  --create-navy: #edf4ff;
  --create-ink: #e9f0fb;
  --create-muted: #a5b3c8;
  --create-line: #2d3f5a;
  background:
    radial-gradient(circle at 4% 84%, rgba(21, 149, 197, .11), transparent 28%),
    radial-gradient(circle at 94% 9%, rgba(115, 85, 220, .11), transparent 25%),
    #08111f;
}
html[data-public-theme="dark"] .access-create-header,
html[data-public-theme="dark"] .access-create-footer { border-color: #293b55; background: rgba(10, 20, 35, .9); }
html[data-public-theme="dark"] .access-create-notice { border-color: #304762; background: rgba(17, 32, 52, .86); }
html[data-public-theme="dark"] .access-create-notice p { color: #afbed1; }
html[data-public-theme="dark"] .access-choice-card { background: rgba(16, 27, 45, .96); box-shadow: 0 16px 38px rgba(0, 0, 0, .19); }
html[data-public-theme="dark"] .access-choice-card--admin { --choice-soft: #142a4d; }
html[data-public-theme="dark"] .access-choice-card--teacher { --choice-soft: #261f47; }
html[data-public-theme="dark"] .access-choice-card--student { --choice-soft: #123345; }

/* Formulários públicos de cadastro */
html[data-public-theme="dark"] .registration-page {
  --profile-dark: #e8f0ff;
  --registration-ink: #e9f1fd;
  --registration-muted: #a4b3c8;
  --registration-line: #2d405d;
  background: #08111f;
}
html[data-public-theme="dark"] .registration-topbar { border-bottom-color: #2a3d57; background: rgba(9, 19, 33, .94); }
html[data-public-theme="dark"] .registration-form-area {
  background:
    radial-gradient(circle at 94% 4%, rgba(39, 86, 155, .12), transparent 31%),
    #0a1423;
}
html[data-public-theme="dark"] .registration-card { border-color: #2c405d; background: rgba(16, 27, 45, .98); box-shadow: 0 22px 58px rgba(0, 0, 0, .25); }
html[data-public-theme="dark"] .registration-card h2 { color: #edf4ff; }
html[data-public-theme="dark"] .registration-field > span { color: #c4d1e2; }
html[data-public-theme="dark"] .registration-field input,
html[data-public-theme="dark"] .registration-field select { border-color: #30445f; color: #edf4ff; background: #142137; }
html[data-public-theme="dark"] .registration-field input::placeholder { color: #7889a1; }
html[data-public-theme="dark"] .registration-field select option { color: #edf4ff; background: #142137; }
html[data-public-theme="dark"] .registration-consent { border-color: #30445f; }
html[data-public-theme="dark"] .registration-check { color: #b7c5d8; }
html[data-public-theme="dark"] .registration-page--admin .registration-window-arrow,
html[data-public-theme="dark"] .registration-page--teacher .registration-window-arrow,
html[data-public-theme="dark"] .registration-page--student .registration-window-arrow { color: #dce8fa; background: #15243a; box-shadow: 0 12px 28px rgba(0, 0, 0, .22); }

/* Recuperação e definição de senha */
html[data-public-theme="dark"] .recovery-page {
  background:
    radial-gradient(circle at 18% 22%, rgba(37, 99, 235, .12), transparent 30%),
    linear-gradient(135deg, #0a1729, #08111f);
}
html[data-public-theme="dark"] .new-password-page {
  background:
    radial-gradient(circle at 82% 20%, rgba(23, 105, 170, .13), transparent 30%),
    linear-gradient(135deg, #0a1729, #08111f);
}
html[data-public-theme="dark"] .recovery-card,
html[data-public-theme="dark"] .new-password-card { border-color: #2c405d; color: #edf4ff; background: #101b2d; box-shadow: var(--public-theme-shadow); }
html[data-public-theme="dark"] .recovery-card .input,
html[data-public-theme="dark"] .new-password-card .input { border-color: #30445f; color: #edf4ff; background: #142137; }

@media (max-width: 760px) {
  .public-theme-toggle { min-height: 36px; padding-right: 8px; }
  .public-theme-toggle__label { display: none; }
  .public-theme-actions { gap: 8px; }
  .public-theme-toggle--floating { top: 14px; right: 14px; }
}

@media (max-width: 650px) {
  .access-create-header .public-theme-actions > a { display: none; }
}

@media (max-width: 480px) {
  .student-topbar .public-theme-actions > a { font-size: 0 !important; }
  .student-topbar .public-theme-actions > a::after { content: "← Voltar"; font-size: .75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .public-theme-toggle,
  .public-theme-toggle__thumb { transition: none; }
}

/* 2026-08-28 - Card do login do professor no tema público escuro */
html[data-theme-scope="public"][data-public-theme="dark"] .teacher-login-card {
  border-color: #34435d;
  background: rgba(16, 26, 43, .97);
  box-shadow: 0 22px 54px rgba(0, 0, 0, .30);
}

html[data-theme-scope="public"][data-public-theme="dark"] .teacher-login-card > header,
html[data-theme-scope="public"][data-public-theme="dark"] .teacher-admin-link {
  border-color: #2b3a52;
}

html[data-theme-scope="public"][data-public-theme="dark"] .teacher-login-options {
  border-color: #34435d;
  background: #121d30;
}
