/* ============================================================
   BPOC Theme Variables
   Bootstrap 5.3 handles most components via data-bs-theme.
   These rules handle custom elements and navbar bg.
   ============================================================ */

/* ── Light theme (default) ── */
[data-bs-theme="light"] {
  --app-bg:        #f5f7fb;
  --app-nav-bg:    #0d6efd;
  --app-nav-text:  #fff;
  --app-card-bg:   #fff;
  --app-footer-bg: #fff;
}

[data-bs-theme="light"] body           { background: var(--app-bg); }
[data-bs-theme="light"] .navbar        { background: var(--app-nav-bg) !important; }
/* Target only direct navbar content — NOT .dropdown-menu which renders outside the nav */
[data-bs-theme="light"] .navbar .navbar-brand,
[data-bs-theme="light"] .navbar .nav-link,
[data-bs-theme="light"] .navbar .navbar-text,
[data-bs-theme="light"] .navbar .navbar-toggler-icon,
[data-bs-theme="light"] .navbar .navbar-toggler { color: var(--app-nav-text) !important; }
[data-bs-theme="light"] .navbar .btn-outline-light { color: #fff !important; border-color: rgba(255,255,255,.5) !important; }
[data-bs-theme="light"] footer         { background: var(--app-footer-bg); }

/* ── Dark theme ── */
[data-bs-theme="dark"] {
  --app-bg:        #0f1623;
  --app-nav-bg:    #0b0f1a;
  --app-nav-text:  #e8edf5;
  --app-card-bg:   #131929;
  --app-footer-bg: #0b0f1a;
}

[data-bs-theme="dark"] body           { background: var(--app-bg); color: #e8edf5; }
[data-bs-theme="dark"] .navbar        { background: var(--app-nav-bg) !important; border-bottom: 1px solid #1e2d45; }
[data-bs-theme="dark"] footer         { background: var(--app-footer-bg); border-color: #1e2d45 !important; color: #6b7a99; }
[data-bs-theme="dark"] .card          { background: var(--app-card-bg); border-color: #1e2d45; }
[data-bs-theme="dark"] .card-header   { background: #1a2236 !important; color: #e8edf5 !important; border-color: #1e2d45 !important; }
[data-bs-theme="dark"] .card-footer   { background: #1a2236 !important; border-color: #1e2d45 !important; }
[data-bs-theme="dark"] .table         { --bs-table-bg: transparent; border-color: #1e2d45; }
[data-bs-theme="dark"] .dropdown-menu { background: #131929; border-color: #1e2d45; }
[data-bs-theme="dark"] .dropdown-item { color: #c8d3e8; }
[data-bs-theme="dark"] .dropdown-item:hover { background: #1e2d45; color: #fff; }
[data-bs-theme="dark"] .dropdown-divider { border-color: #1e2d45; }
[data-bs-theme="dark"] .stat-card     { box-shadow: 0 3px 14px rgba(0,0,0,.35); }
[data-bs-theme="dark"] .alert-success { background: rgba(57,224,123,.1); border-color: rgba(57,224,123,.25); color: #39e07b; }
[data-bs-theme="dark"] .alert-danger  { background: rgba(220,53,69,.12); border-color: rgba(220,53,69,.3); color: #f88; }
[data-bs-theme="dark"] .alert-warning { background: rgba(255,193,7,.1); border-color: rgba(255,193,7,.25); color: #ffc107; }
[data-bs-theme="dark"] .pagination .page-link { background: #131929; border-color: #1e2d45; color: #c8d3e8; }
[data-bs-theme="dark"] .pagination .page-item.active .page-link { background: #39e07b; border-color: #39e07b; color: #0b0f1a; }
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select   { background: #0f1825 !important; border-color: #253349 !important; color: #e8edf5 !important; }
[data-bs-theme="dark"] .form-control::placeholder { color: #6b7a99 !important; }
[data-bs-theme="dark"] .input-group-text { background: #0f1825 !important; border-color: #253349 !important; color: #6b7a99 !important; }
[data-bs-theme="dark"] .modal-content { background: #131929; border-color: #1e2d45; }
[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer  { border-color: #1e2d45; }
[data-bs-theme="dark"] .badge.bg-light { background: #1e2d45 !important; color: #c8d3e8 !important; }
/* card-header btn should stay visible in dark mode */
[data-bs-theme="dark"] .card-header .btn-outline-secondary { border-color: #3d5270 !important; color: #c8d3e8 !important; }
[data-bs-theme="dark"] .card-header .btn-outline-secondary:hover { background: #253349 !important; color: #fff !important; }

/* ── Toggle button ── */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.3);
  background: transparent;
  color: rgba(255,255,255,.85);
  cursor: pointer;
  transition: background .2s, border-color .2s;
  flex-shrink: 0;
}
.theme-toggle-btn:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.6); }

/* Guest page floating toggle */
.theme-toggle-float {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 999;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(128,128,128,.35);
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(6px);
  color: #aab;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s;
}
.theme-toggle-float:hover { background: rgba(255,255,255,.18); color: #fff; }

/* ── Guest layout — light theme overrides ── */
[data-bs-theme="light"] .guest-page {
  background: #f0f4ff !important;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(13,110,253,.10) 0%, transparent 70%) !important;
}
[data-bs-theme="light"] .guest-card {
  background: #ffffff !important;
  border-color: #dee2e6 !important;
  box-shadow: 0 4px 24px rgba(0,0,0,.08) !important;
}
[data-bs-theme="light"] .guest-brand-name { color: #1f2937 !important; }
[data-bs-theme="light"] .guest-brand-sub  { color: #6b7280 !important; }
[data-bs-theme="light"] .step-title       { color: #1f2937 !important; }
[data-bs-theme="light"] .step-sub         { color: #6b7280 !important; }
[data-bs-theme="light"] .form-label       { color: #374151 !important; }
[data-bs-theme="light"] .form-control,
[data-bs-theme="light"] .form-select      { background: #f9fafb !important; border-color: #d1d5db !important; color: #111827 !important; }
[data-bs-theme="light"] .form-control::placeholder { color: #9ca3af !important; }
[data-bs-theme="light"] .input-group-text { background: #f3f4f6 !important; border-color: #d1d5db !important; color: #6b7280 !important; }
[data-bs-theme="light"] .btn-outline-secondary { background: #f3f4f6 !important; border-color: #d1d5db !important; color: #374151 !important; }
[data-bs-theme="light"] .guest-footer     { color: #6b7280 !important; }
[data-bs-theme="light"] .guest-footer a   { color: #0d6efd !important; }
[data-bs-theme="light"] .back-link        { color: #6b7280 !important; }
[data-bs-theme="light"] .back-link:hover  { color: #111827 !important; }
[data-bs-theme="light"] .captcha-box      { background: #f3f4f6 !important; border-color: #d1d5db !important; color: #0d6efd !important; }
[data-bs-theme="light"] .alert-danger     { background: #fef2f2 !important; border-color: #fecaca !important; color: #b91c1c !important; }
[data-bs-theme="light"] .alert-success    { background: #f0fdf4 !important; border-color: #bbf7d0 !important; color: #15803d !important; }
[data-bs-theme="light"] .alert-warning    { background: #fffbeb !important; border-color: #fde68a !important; color: #92400e !important; }
[data-bs-theme="light"] .otp-input        { color: #111827 !important; }
[data-bs-theme="light"] .btn-bpoc         { background: #0d6efd !important; color: #fff !important; }
[data-bs-theme="light"] .btn-bpoc:hover   { background: #0b5ed7 !important; }

/* ── Common ── */
.navbar { box-shadow: 0 2px 10px rgba(0,0,0,.1); }
.card   { border-radius: .85rem; }
.stat-card { border: 0; }
.table thead th { font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.table td { vertical-align: middle; }
