/* Cohesive theme guard: prevents mixed dark/light sections if old cached CSS or stale classes survive. */

html[data-theme="dark"],
body.dark-mode {
  background: #160427 !important;
  color: #f8f2ff !important;
}

html[data-theme="light"],
body.light-mode {
  background: #fffaf6 !important;
  color: #2b0e52 !important;
}

body.dark-mode main,
body.dark-mode section,
body.dark-mode .theme-light {
  color: #f8f2ff;
}

body.light-mode main,
body.light-mode section,
body.light-mode .theme-dark {
  color: #2b0e52;
}

body.dark-mode .theme-light,
body.dark-mode section.theme-light {
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 200, 97, .12), transparent 30%),
    radial-gradient(circle at 82% 16%, rgba(255, 111, 181, .10), transparent 35%),
    linear-gradient(180deg, #21083f 0%, #160427 100%) !important;
}

body.light-mode .theme-dark,
body.light-mode section.theme-dark {
  background:
    radial-gradient(circle at 15% 8%, rgba(255, 200, 97, .18), transparent 28%),
    radial-gradient(circle at 85% 14%, rgba(255, 111, 181, .14), transparent 34%),
    linear-gradient(180deg, #fffaf6 0%, #fbf4ff 100%) !important;
}

body.dark-mode .theme-light h1,
body.dark-mode .theme-light h2,
body.dark-mode .theme-light h3,
body.dark-mode .theme-light h4,
body.dark-mode .theme-light h5 {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

body.light-mode .theme-dark h1,
body.light-mode .theme-dark h2,
body.light-mode .theme-dark h3,
body.light-mode .theme-dark h4,
body.light-mode .theme-dark h5 {
  color: #210934 !important;
  -webkit-text-fill-color: #210934 !important;
}

body.dark-mode .theme-light p,
body.dark-mode .theme-light li,
body.dark-mode .theme-light label,
body.dark-mode .theme-light .checkbox {
  color: rgba(248, 242, 255, .88) !important;
}

body.light-mode .theme-dark p,
body.light-mode .theme-dark li,
body.light-mode .theme-dark label,
body.light-mode .theme-dark .checkbox {
  color: #4a2d80 !important;
}

body.light-mode .theme-dark .btn:not(.btn-login):not(.btn-ghostline):not(.btn-ghost-dark):not(.btn-accent),
body.light-mode section.theme-dark .btn:not(.btn-login):not(.btn-ghostline):not(.btn-ghost-dark):not(.btn-accent),
.theme-light .btn:not(.btn-login):not(.btn-ghostline):not(.btn-ghost-dark):not(.btn-accent) {
  background: #e7a534 !important;
  color: #2b0e52 !important;
  -webkit-text-fill-color: #2b0e52 !important;
  border-color: #2b0e52 !important;
  box-shadow: 5px 5px 0 rgba(74, 23, 133, .9) !important;
}

body.light-mode .theme-dark .btn:not(.btn-login):not(.btn-ghostline):not(.btn-ghost-dark):not(.btn-accent):hover,
body.light-mode section.theme-dark .btn:not(.btn-login):not(.btn-ghostline):not(.btn-ghost-dark):not(.btn-accent):hover,
.theme-light .btn:not(.btn-login):not(.btn-ghostline):not(.btn-ghost-dark):not(.btn-accent):hover {
  background: #5b2fd6 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-color: #2b0e52 !important;
  box-shadow: 7px 7px 0 rgba(231, 165, 52, .72) !important;
}
