/* Theme-aware button labels: bright fills always receive a readable foreground. */
:root[data-theme="starry"],
:root[data-theme="cyberpunk"],
:root[data-theme="woodland"],
:root[data-theme="summernight"] {
  --button-on-accent: #101a24;
  --button-text-shadow: none;
}

:root[data-theme="starry"] { --button-on-accent: #10162b; }
:root[data-theme="cyberpunk"] { --button-on-accent: #08202c; }
:root[data-theme="woodland"] { --button-on-accent: #08170e; }
:root[data-theme="summernight"] { --button-on-accent: #152b3b; }

:root :is(
  .primary,
  .auth-submit,
  .admin-primary,
  .calculator-equals,
  .mistake-filters button.active,
  .beginner-guide-launcher,
  .guide-footer button:last-child,
  .forbidden-actions a:first-child,
  .message-compose-actions button
) {
  color: var(--button-on-accent) !important;
  text-shadow: var(--button-text-shadow);
}

:root .lang-btn.active {
  color: var(--button-on-accent) !important;
  text-shadow: var(--button-text-shadow);
}

/* Pale header controls and course-count badges need dark labels in every theme. */
:root .demo-pill,
:root .logout-button {
  color: #25344a !important;
  text-shadow: none;
}

:root .logout-button:hover,
:root .logout-button:focus-visible {
  color: #17253a !important;
  background: rgba(255,255,255,.86) !important;
  border-color: rgba(37,52,74,.28) !important;
}

:root .subject .count {
  color: #2c3c52 !important;
  background: rgba(240,245,252,.82) !important;
  border-color: rgba(42,58,82,.2) !important;
  font-weight: 750;
}

:root .subject.active .count {
  color: #18283d !important;
}

/* Keep the action label above high-tier theme artwork. */
.auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  line-height: 1.35;
}

.auth-submit-label {
  position: relative;
  z-index: 1;
  display: inline-block;
  color: inherit;
  font-weight: 800;
  letter-spacing: .01em;
}

:root:is(
  [data-theme="palace"],
  [data-theme="starry"],
  [data-theme="cyberpunk"],
  [data-theme="woodland"],
  [data-theme="summernight"]
) .auth-submit {
  min-height: 52px;
  padding-right: 20px !important;
}

:root:is(
  [data-theme="palace"],
  [data-theme="starry"],
  [data-theme="cyberpunk"],
  [data-theme="woodland"],
  [data-theme="summernight"]
) .auth-submit-label {
  padding: 2px 9px;
  border-radius: 7px;
  background: color-mix(in srgb, currentColor 8%, transparent);
}
