/* Palette matches AxoSync's Theme.axaml (AxoSync/Styles/Theme.axaml) so the portal and the
   desktop app read as one product. */
:root {
  --ia-bg: #F7F8F9;
  --ia-card-bg: #FFFFFF;
  --ia-border: #E5E7EB;
  --ia-surface-muted: #F3F4F6;
  --ia-heading: #111827;
  --ia-subheading: #374151;
  --ia-body: #1F2937;
  --ia-muted: #6B7280;
  --ia-faint: #9CA3AF;
  --ia-accent: #007AFF;
  --ia-accent-hover: #0056CC;
  --ia-accent-muted: #DBEAFE;

  color-scheme: light dark;

  --bs-body-bg: var(--ia-bg);
  --bs-body-color: var(--ia-body);
  --bs-border-color: var(--ia-border);
  --bs-primary: var(--ia-accent);
  --bs-primary-rgb: 0, 122, 255;
  --bs-link-color: var(--ia-accent);
  --bs-link-color-rgb: 0, 122, 255;
  --bs-link-hover-color: var(--ia-accent-hover);
  --bs-secondary-color: var(--ia-muted);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ia-bg: #161B22;
    --ia-card-bg: #1E2530;
    --ia-border: #2D3646;
    --ia-surface-muted: #232B38;
    --ia-heading: #F1F5F9;
    --ia-subheading: #CBD5E1;
    --ia-body: #E2E8F0;
    --ia-muted: #94A3B8;
    --ia-faint: #64748B;
    --ia-accent-hover: #3399FF;
    --ia-accent-muted: #1E3A5F;
  }
}

/* Bootstrap tables take their text from --bs-emphasis-color (black) and paint --bs-body-bg over
   whatever they sit on. The portal themes through --ia-* variables rather than data-bs-theme, so
   without this the cells are black on the dark card. Heading colour is near-white in dark mode. */
.table {
  --bs-table-color: var(--ia-heading);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--ia-border);
}

body {
  background-color: var(--ia-bg);
  color: var(--ia-body);
}

.site-header {
  background-color: var(--ia-card-bg);
  border-bottom: 1px solid var(--ia-border);
}

.site-header .navbar-brand,
.site-header .nav-link {
  color: var(--ia-heading) !important;
}

.site-header .nav-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.site-header .nav-icon {
  flex-shrink: 0;
  opacity: 0.85;
}

/* The My Account dropdown follows the header's theme (Bootstrap's menu is light-only by default). */
.site-header .dropdown-menu {
  background-color: var(--ia-card-bg);
  border: 1px solid var(--ia-border);
}

.site-header .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ia-heading);
}

.site-header .dropdown-item:hover,
.site-header .dropdown-item:focus {
  background-color: var(--ia-accent-muted);
  color: var(--ia-heading);
}

.site-header .dropdown-divider {
  border-top-color: var(--ia-border);
}

.site-header .nav-link:hover {
  color: var(--ia-accent) !important;
}

/* Bootstrap's hamburger icon is a fixed dark-grey SVG with a dark border, which vanishes on the dark
   header (the portal doesn't use data-bs-theme). Draw it as a mask in the heading colour instead. */
.site-header .navbar-toggler {
  border-color: var(--ia-border);
}

.site-header .navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem var(--ia-accent-muted);
}

.site-header .navbar-toggler-icon {
  background-image: none;
  background-color: var(--ia-heading);
  -webkit-mask: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='black' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") center / 100% no-repeat;
  mask: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='black' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") center / 100% no-repeat;
}

.brand-logo {
  height: 28px;
  width: auto;
  display: block;
}

.brand-logo-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .brand-logo-light {
    display: none;
  }

  .brand-logo-dark {
    display: block;
  }
}

.brand-suffix {
  font-weight: 600;
  color: var(--ia-heading);
}

.site-footer {
  background-color: var(--ia-card-bg);
  border-top: 1px solid var(--ia-border);
  color: var(--ia-muted);
}

.site-footer a {
  color: var(--ia-muted);
}

.hero {
  padding: 4rem 0 3rem;
}

.hero h1 {
  color: var(--ia-heading);
  font-weight: 700;
}

.hero .lead {
  color: var(--ia-subheading);
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
}

.btn-ia-primary {
  background-color: var(--ia-accent);
  border-color: var(--ia-accent);
  color: #fff;
}

.btn-ia-primary:hover {
  background-color: var(--ia-accent-hover);
  border-color: var(--ia-accent-hover);
  color: #fff;
}

.btn-ia-outline {
  background-color: transparent;
  border: 1px solid var(--ia-border);
  color: var(--ia-heading);
}

.btn-ia-outline:hover {
  border-color: var(--ia-accent);
  color: var(--ia-accent);
}

.feature-card {
  background-color: var(--ia-card-bg);
  border: 1px solid var(--ia-border);
  border-radius: 0.5rem;
  padding: 1.5rem;
  height: 100%;
}

.feature-card h3 {
  color: var(--ia-heading);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--ia-muted);
  margin-bottom: 0;
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}
/* Staff notifications: the red count on the navbar's Staff item, and the highlighted dashboard cards. */
.site-header .nav-badge {
  display: inline-block;
  min-width: 1.15rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background-color: #dc3545;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.15rem;
  text-align: center;
}

.feature-card-alert {
  border-color: #dc3545;
  box-shadow: 0 0 0 1px #dc3545, 0 0 0.75rem rgba(220, 53, 69, 0.35);
}
