/*
  ICARYS CLEAN WHITE BOOTSTRAP RESET
  Loaded last. Purpose: fix white/black contrast, broken buttons, cramped header/nav.
*/

:root {
  color-scheme: light !important;
  --bs-body-bg: #ffffff !important;
  --bs-body-color: #111111 !important;
  --bs-border-color: #dee2e6 !important;
  --bs-link-color: #111111 !important;
  --bs-link-hover-color: #000000 !important;
  --icarys-bg: #ffffff !important;
  --icarys-text: #111111 !important;
  --icarys-muted: #555555 !important;
  --icarys-border: #dee2e6 !important;
}

html,
body {
  background: #ffffff !important;
  color: #111111 !important;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
}

/* Clean public header/nav. Fixes logo/login/news collision. */
body > header,
body > nav,
.site-header,
.app-header,
.topbar,
.navbar {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 14px 22px !important;
  min-height: 64px !important;
  width: 100% !important;
  padding: 16px 28px !important;
  margin: 0 !important;
  background: #ffffff !important;
  color: #111111 !important;
  border-bottom: 1px solid #e5e7eb !important;
  box-shadow: none !important;
  z-index: 10 !important;
}

body > header *,
body > nav *,
.site-header *,
.app-header *,
.topbar *,
.navbar * {
  position: relative !important;
  color: #111111 !important;
  background-color: transparent !important;
  text-shadow: none !important;
  white-space: nowrap !important;
}

.nav,
.navbar-nav,
.site-nav,
.app-nav,
.header-nav,
.topbar nav,
header nav {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 0 !important;
}

.nav a,
.navbar a,
.site-header a,
.app-header a,
.topbar a,
header a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 36px !important;
  padding: 7px 12px !important;
  color: #111111 !important;
  text-decoration: none !important;
  border-radius: 6px !important;
}

.nav a:hover,
.navbar a:hover,
.site-header a:hover,
.app-header a:hover,
.topbar a:hover,
header a:hover {
  background: #f8f9fa !important;
  color: #000000 !important;
}

/* General white/black page reset */
main,
section,
article,
aside,
footer,
.container,
.container-fluid,
.wrapper,
.page,
.app,
.app-shell,
.content,
.panel,
.card,
.module-card,
.dashboard-card,
.workflow-card,
.intel-card,
.admin-card,
.login-card,
.auth-card,
.form-card,
.list-group,
.list-group-item,
.dropdown-menu,
.modal-content {
  background: #ffffff !important;
  color: #111111 !important;
  border-color: #dee2e6 !important;
  box-shadow: none !important;
}

.card,
.panel,
.module-card,
.dashboard-card,
.workflow-card,
.intel-card,
.admin-card,
.login-card,
.auth-card,
.form-card {
  border: 1px solid #dee2e6 !important;
  border-radius: 12px !important;
}

/* Readable text */
body :where(h1,h2,h3,h4,h5,h6,p,span,small,li,label,strong,em,b,i,div,td,th,a) {
  color: #111111 !important;
  text-shadow: none !important;
}

.text-muted,
.muted,
.subtle,
small,
.form-text,
.help-text,
.lead,
.subtitle,
.kicker,
.eyebrow {
  color: #555555 !important;
}

/* Standard Bootstrap-like buttons */
button,
[type="button"],
[type="submit"],
[type="reset"],
.btn,
.btn-primary,
.btn-secondary,
.btn-dark,
.btn-light,
.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-dark,
.btn-outline-light,
a.btn,
.icarys-btn,
.mb-btn,
.action-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #111111 !important;
  border: 1px solid #111111 !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  text-shadow: none !important;
  font-weight: 500 !important;
  min-height: 38px !important;
  padding: 8px 14px !important;
}

button:hover,
[type="button"]:hover,
[type="submit"]:hover,
[type="reset"]:hover,
.btn:hover,
a.btn:hover,
.icarys-btn:hover,
.mb-btn:hover,
.action-btn:hover {
  background: #f8f9fa !important;
  color: #000000 !important;
  border-color: #000000 !important;
}

/* Forms */
input,
select,
textarea,
.form-control,
.form-select,
.input-group-text {
  background: #ffffff !important;
  color: #111111 !important;
  border: 1px solid #ced4da !important;
  box-shadow: none !important;
}

input::placeholder,
textarea::placeholder {
  color: #777777 !important;
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus,
.form-select:focus {
  background: #ffffff !important;
  color: #111111 !important;
  border-color: #111111 !important;
  box-shadow: 0 0 0 .2rem rgba(0,0,0,.08) !important;
}

/* Kill dark utilities visually */
.bg-dark,
.bg-black,
.text-bg-dark,
.navbar-dark,
.dropdown-menu-dark,
.alert-dark,
.btn-dark {
  background: #ffffff !important;
  color: #111111 !important;
  border-color: #111111 !important;
}

.text-white,
.text-light,
.link-light,
.navbar-dark .navbar-brand,
.navbar-dark .navbar-nav .nav-link {
  color: #111111 !important;
}

/* Fix inline dark/white accidents */
[style*="background:#000"],
[style*="background: #000"],
[style*="background-color:#000"],
[style*="background-color: #000"],
[style*="background:black"],
[style*="background: black"],
[style*="background-color:black"],
[style*="background-color: black"],
[style*="background:#111"],
[style*="background: #111"],
[style*="background-color:#111"],
[style*="background-color: #111"],
[style*="background:#0b0b0b"],
[style*="background: #0b0b0b"],
[style*="background-color:#0b0b0b"],
[style*="background-color: #0b0b0b"] {
  background: #ffffff !important;
  color: #111111 !important;
}

[style*="color:#fff"],
[style*="color: #fff"],
[style*="color:white"],
[style*="color: white"],
[style*="color:#ffffff"],
[style*="color: #ffffff"] {
  color: #111111 !important;
}

/* Front/home spacing */
.hero,
.home-hero,
.landing-hero,
.marketing-hero,
main > section:first-child {
  padding-top: 64px !important;
  padding-bottom: 64px !important;
}

.hero .btn,
.home-hero .btn,
.landing-hero .btn,
.marketing-hero .btn {
  margin-right: 8px !important;
  margin-bottom: 8px !important;
}

/* Footer */
footer,
.site-footer {
  background: #ffffff !important;
  color: #555555 !important;
  border-top: 1px solid #e5e7eb !important;
}

/* Code/debug blocks */
pre,
code,
kbd,
samp {
  background: #f8f9fa !important;
  color: #111111 !important;
  border: 1px solid #dee2e6 !important;
}

/* ICARYS FINAL HEADER/HOME LOGIN FIX */
body {
  background: #ffffff !important;
  color: #111111 !important;
}

body > header,
body > nav,
.site-header,
.app-header,
.topbar,
.navbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 12px 18px !important;
  padding: 16px 28px !important;
  min-height: 64px !important;
  background: #ffffff !important;
  color: #111111 !important;
  border-bottom: 1px solid #e5e7eb !important;
  overflow: visible !important;
}

body > header *,
body > nav *,
.site-header *,
.app-header *,
.topbar *,
.navbar * {
  color: #111111 !important;
  background: transparent !important;
  text-shadow: none !important;
  line-height: 1.25 !important;
}

header a,
nav a,
.navbar a,
.site-header a,
.app-header a,
.topbar a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 36px !important;
  padding: 7px 12px !important;
  margin: 0 !important;
  border-radius: 6px !important;
  text-decoration: none !important;
  color: #111111 !important;
  background: #ffffff !important;
}

header a:hover,
nav a:hover,
.navbar a:hover,
.site-header a:hover,
.app-header a:hover,
.topbar a:hover {
  background: #f8f9fa !important;
  color: #000000 !important;
}

form,
.login-card,
.auth-card,
.form-card {
  background: #ffffff !important;
  color: #111111 !important;
  border: 1px solid #dee2e6 !important;
  border-radius: 12px !important;
}

label,
.form-label {
  color: #111111 !important;
}

input,
select,
textarea,
.form-control,
.form-select {
  background: #ffffff !important;
  color: #111111 !important;
  border: 1px solid #ced4da !important;
}

button,
.btn,
a.btn,
[type="submit"],
[type="button"] {
  background: #ffffff !important;
  color: #111111 !important;
  border: 1px solid #111111 !important;
}

button:hover,
.btn:hover,
a.btn:hover,
[type="submit"]:hover,
[type="button"]:hover {
  background: #f8f9fa !important;
  color: #000000 !important;
}

/* ICARYS SIMPLE SAFE RESET */
html,
body {
  margin: 0;
  overflow-x: hidden !important;
  background: #ffffff !important;
  color: #111111 !important;
}

body {
  max-width: 100vw !important;
}

a,
button,
.btn,
.button,
input[type="submit"] {
  color: #111111;
}

.btn,
.button,
button,
input[type="submit"] {
  background: #ffffff;
  border: 1px solid #111111;
}

/* Never force black card backgrounds globally. */
.card,
.panel,
.module-card,
.dashboard-card {
  background-color: #ffffff;
  color: #111111;
}

/* === ICARYS GLOBAL BUTTON CONTRAST FIX — NO BLACK TEXT ON DARK BUTTONS === */
button,
.btn,
a.btn,
input[type="submit"],
input[type="button"],
input[type="reset"],
.button,
.action-btn,
.open-btn,
.open-link,
.primary,
.btn-primary,
button.primary,
a.primary {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

button *,
.btn *,
a.btn *,
input[type="submit"] *,
input[type="button"] *,
.button *,
.action-btn *,
.open-btn *,
.open-link *,
.primary *,
.btn-primary * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

header a.btn:not(.primary),
nav a.btn:not(.primary),
.topbar a.btn:not(.primary),
.nav a.btn:not(.primary) {
  color: #111111 !important;
  -webkit-text-fill-color: #111111 !important;
  background: #ffffff !important;
}

header a.btn.primary,
nav a.btn.primary,
.topbar a.btn.primary,
.nav a.btn.primary {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: #111827 !important;
}
