/* Light Mode for the existing email and administration flows.
   This layer changes presentation only: validation, recipients, submissions,
   newsletter consent and all authentication actions remain in their modules. */
html[data-theme='light'] :is(.email-auth-page, .email-form, .email-identity,
  .admin-content, .admin-tabs, .newsletter-consent) {
  color: var(--text);
}

html[data-theme='light'] :is(.email-divider, .email-form-status,
  .admin-action-status, .admin-facts dt, .reward-publication) {
  color: var(--muted);
}
html[data-theme='light'] :is(.email-back, .email-text-actions .auth-switch,
  .email-auth-page .auth-switch, .admin-back, .admin-table a,
  .newsletter-consent a) {
  color: var(--accent);
}
html[data-theme='light'] :is(.email-back, .email-text-actions .auth-switch,
  .email-auth-page .auth-switch, .admin-back, .admin-table a,
  .newsletter-consent a):hover {
  color: #004e67;
}
html[data-theme='light'] :is(.email-identity, .admin-note) { border-color: var(--line); }

/* Keep visible controls separate from the pale page and from a white card. */
html[data-theme='light'] :is(.email-form, .admin-form, .admin-search, .reward-editor)
  :where(input:not([type='checkbox']):not([type='radio']), select, textarea) {
  color: var(--text);
  background: #f8fbfd;
  border-color: #7394a6;
  box-shadow: inset 0 1px 2px #244a5e05;
}
html[data-theme='light'] :is(.email-form, .admin-form, .admin-search, .reward-editor)
  :is(input, textarea)::placeholder {
  color: #536f80;
  opacity: 1;
}
html[data-theme='light'] :is(.email-form, .admin-form, .admin-search, .reward-editor)
  :is(input, select, textarea):hover:not(:disabled) {
  border-color: var(--accent);
}
html[data-theme='light'] :is(.email-form, .admin-form, .admin-search, .reward-editor)
  :is(input, select, textarea):focus-visible {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
html[data-theme='light'] :is(.email-form, .admin-form, .admin-search, .reward-editor)
  :is(input, select, textarea)[aria-invalid='true'] {
  border-color: var(--danger);
  background: #fff8f7;
}
html[data-theme='light'] :is(.email-form, .admin-form, .admin-search, .reward-editor)
  :is(input, select, textarea):disabled {
  color: #5c7280;
  background: #eaf1f5;
  border-color: #adbfca;
}
html[data-theme='light'] :is(.email-form, .admin-form, .admin-search, .reward-editor)
  select option {
  color: var(--text);
  background: var(--surface);
}
html[data-theme='light'] :is(.email-form, .admin-form, .reward-editor, .newsletter-consent)
  :is(input[type='checkbox'], input[type='radio']) {
  accent-color: var(--accent);
}
html[data-theme='light'] .reward-editor input[type='file']::file-selector-button {
  color: var(--accent);
  background: #e4f2f8;
  border: 1px solid #8fb4c6;
  border-radius: 6px;
}
html[data-theme='light'] .reward-editor input[type='file']:hover:not(:disabled)::file-selector-button {
  color: #004e67;
  background: #d4ebf5;
  border-color: var(--accent);
}

/* Administration navigation, data tables and editable cards share the same
   navy/ice-blue hierarchy as the public portal. */
html[data-theme='light'] .admin-tab {
  color: var(--body);
  background: #ffffff;
  border-color: var(--line);
}
html[data-theme='light'] .admin-tab:hover {
  color: var(--accent);
  background: #eaf5fa;
  border-color: #77a9be;
}
html[data-theme='light'] .admin-tab[aria-current='page'] {
  color: #004f68;
  background: #d9eef7;
  border-color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}
html[data-theme='light'] .admin-panel {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
  box-shadow: 0 6px 24px #174d6910;
}
html[data-theme='light'] .admin-panel :is(h2, h3, .admin-facts dd) { color: var(--text); }
html[data-theme='light'] .admin-table-scroll {
  border-color: #abc6d4;
  background: var(--surface);
  scrollbar-color: #82acbe #e8f2f7;
}
html[data-theme='light'] .admin-table { color: var(--text); }
html[data-theme='light'] .admin-table :is(th, td) { border-color: var(--line); }
html[data-theme='light'] .admin-table th {
  color: var(--body);
  background: #e7f2f8;
}
html[data-theme='light'] .admin-table tbody tr:nth-child(even) { background: #f5fafd; }
html[data-theme='light'] .admin-table tbody tr:hover { background: #edf6fb; }
html[data-theme='light'] .reward-admin-preview { background: #eaf3f8; }
html[data-theme='light'] .reward-publication.published { color: var(--mint); }

/* Explicit states also cover the standalone newsletter page, which does not
   load the account interface. No state is inferred from a response message. */
html[data-theme='light'] :is(.email-form, .email-auth-page, .admin-content,
  #newsletter-content) .button.primary {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}
html[data-theme='light'] :is(.email-form, .email-auth-page, .admin-content,
  #newsletter-content) .button.primary:hover:not(:disabled) {
  color: #ffffff;
  background: #005770;
  border-color: #005770;
}
html[data-theme='light'] :is(.email-form, .email-auth-page, .admin-content,
  #newsletter-content) .button.quiet {
  color: var(--accent);
  border-color: #8eafc0;
  background: #ffffff;
}
html[data-theme='light'] :is(.email-form, .email-auth-page, .admin-content,
  #newsletter-content) .button.quiet:hover:not(:disabled) {
  color: #004e67;
  background: #e6f3f9;
  border-color: var(--accent);
}
html[data-theme='light'] :is(.email-form, .email-auth-page, .admin-content,
  #newsletter-content) .button:disabled {
  opacity: 1;
  color: #566e7e;
  border-color: #a9bfcb;
  background: #e2ecf2;
  box-shadow: none;
}
html[data-theme='light'] .email-form-status.error { color: var(--danger); }
html[data-theme='light'] :is(.email-auth-page, .email-form, .admin-content,
  #newsletter-content) .inline-error {
  color: #97252d;
  border-color: #d6a2a6;
  background: #fff1f0;
}
html[data-theme='light'] :is(.email-auth-page, .admin-content,
  #newsletter-content) .notice {
  color: #16604b;
  border-color: #94c1b1;
  background: #eaf7f1;
}
/* The public newsletter uses the same element for success and failure text.
   Keep that unclassified status neutral instead of implying success in green. */
html[data-theme='light'] #newsletter-status {
  color: var(--body);
  border-color: #9fbecd;
  background: #eaf4f9;
}
html[data-theme='light'] :is(.email-auth-page, .admin-content,
  #newsletter-content) .notice.error,
html[data-theme='light'] #newsletter-status.error {
  color: #97252d;
  border-color: #d6a2a6;
  background: #fff1f0;
}

/* The message preview remains a paper-like content preview. Its text is still
   inserted with textContent by the existing newsletter editor. */
html[data-theme='light'] .newsletter-preview {
  color: var(--text);
  border: 1px solid #bed5e1;
  background: #f8fcff;
  box-shadow: 0 4px 18px #174d690c;
}
html[data-theme='light'] .newsletter-preview :is(h2, h3, .newsletter-preview-body) {
  color: var(--text);
}
html[data-theme='light'] .newsletter-preview :is(small, .muted) { color: var(--muted); }
html[data-theme='light'] .newsletter-consent a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
