
/* Ivan & Associates – Bootstrap 5 Overrides (palette extracted from provided image)
   Load AFTER bootstrap.min.css */

/* ===== LIGHT THEME (default) ===== */
:root,
[data-bs-theme="light"] {
  /* Brand palette (hex approximations from image) */
  --ia-primary: #1F3A5F;   /* deep navy */
  --ia-secondary: #2A547F; /* medium navy */
  --ia-accent: #F1A734;    /* golden accent */
  --ia-sand: #E8D7B4;      /* beige swatch */
  --ia-bg: #F7F0E5;        /* light cream background */
  --ia-surface: #FFFFFF;   /* cards/surfaces */
  --ia-text: #1F2328;      /* dark readable text */
  --ia-muted: #6B7280;     /* secondary text/borders */

  /* Map to Bootstrap tokens */
  --bs-primary: var(--ia-primary);
  --bs-secondary: var(--ia-secondary);
  --bs-warning: var(--ia-accent); /* use accent as warning/CTA hue */
  --bs-info: #2F6FA2;      /* complementary blue */
  --bs-success: #1E7F5A;   /* standard success green */
  --bs-danger: #C44141;    /* standard error red */

  /* Base text & background */
  --bs-body-bg: var(--ia-bg);
  --bs-body-color: var(--ia-text);
  --bs-secondary-color: color-mix(in srgb, var(--ia-text) 60%, transparent);
  --bs-tertiary-color: color-mix(in srgb, var(--ia-text) 45%, transparent);

  /* Subtle backgrounds & borders */
  --bs-border-color: color-mix(in srgb, var(--ia-muted) 28%, #ffffff 72%);
  --bs-secondary-bg: color-mix(in srgb, var(--ia-muted) 10%, #ffffff 90%);
  --bs-tertiary-bg: color-mix(in srgb, var(--ia-muted) 6%, #ffffff 94%);

  /* Links */
  --bs-link-color: var(--ia-primary);
  --bs-link-hover-color: color-mix(in srgb, var(--ia-primary) 85%, #000 15%);

  /* Emphasis/subtle tokens used by utilities */
  --bs-primary-text-emphasis: color-mix(in srgb, var(--ia-primary) 25%, #000 75%);
  --bs-primary-bg-subtle: color-mix(in srgb, var(--ia-primary) 18%, #ffffff 82%);
  --bs-secondary-text-emphasis: color-mix(in srgb, var(--ia-secondary) 25%, #000 75%);
  --bs-secondary-bg-subtle: color-mix(in srgb, var(--ia-secondary) 15%, #ffffff 85%);
  --bs-warning-text-emphasis: color-mix(in srgb, var(--ia-accent) 30%, #000 70%);
  --bs-warning-bg-subtle: color-mix(in srgb, var(--ia-accent) 18%, #ffffff 82%);

  /* Cards & modals */
  --bs-card-bg: var(--ia-surface);
  --bs-card-border-color: color-mix(in srgb, var(--ia-muted) 20%, #ffffff 80%);
  --bs-modal-bg: var(--ia-surface);

  /* Buttons */
  --bs-btn-border-radius: 0.375rem;
  --bs-btn-padding-x: 0.9rem;
  --bs-btn-padding-y: 0.5rem;
}

/* Components tuned to brand */
.btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--ia-primary);
  --bs-btn-border-color: var(--ia-primary);
  --bs-btn-hover-bg: color-mix(in srgb, var(--ia-primary) 88%, #000 12%);
  --bs-btn-hover-border-color: color-mix(in srgb, var(--ia-primary) 80%, #000 20%);
  --bs-btn-active-bg: color-mix(in srgb, var(--ia-primary) 75%, #000 25%);
  --bs-btn-active-border-color: color-mix(in srgb, var(--ia-primary) 70%, #000 30%);
  --bs-btn-focus-shadow-rgb: 31,58,95;
}

.btn-secondary {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--ia-secondary);
  --bs-btn-border-color: var(--ia-secondary);
  --bs-btn-hover-bg: color-mix(in srgb, var(--ia-secondary) 88%, #000 12%);
  --bs-btn-hover-border-color: color-mix(in srgb, var(--ia-secondary) 80%, #000 20%);
  --bs-btn-focus-shadow-rgb: 42,84,127;
}

.btn-warning, .btn-accent {
  --bs-btn-color: #1b1b1b;
  --bs-btn-bg: var(--ia-accent);
  --bs-btn-border-color: var(--ia-accent);
  --bs-btn-hover-bg: color-mix(in srgb, var(--ia-accent) 90%, #000 10%);
  --bs-btn-hover-border-color: color-mix(in srgb, var(--ia-accent) 85%, #000 15%);
}

.btn-outline-primary {
  --bs-btn-color: var(--ia-primary);
  --bs-btn-border-color: var(--ia-primary);
  --bs-btn-hover-bg: var(--ia-primary);
  --bs-btn-hover-border-color: var(--ia-primary);
  --bs-btn-hover-color: #fff;
}

/* Links */
a, .link-primary { color: var(--ia-primary); }
a:hover, .link-primary:hover { color: color-mix(in srgb, var(--ia-primary) 85%, #000 15%); }

/* Navbar (light) */
.navbar, .navbar-light {
  background-color: #ffffff;
  border-bottom: 1px solid color-mix(in srgb, var(--ia-muted) 18%, #ffffff 82%);
}

/* Badges */
.badge.bg-primary { background-color: var(--ia-primary) !important; }
.badge.bg-warning { background-color: var(--ia-accent) !important; color:#1b1b1b; }

/* Forms */
.form-control:focus, .form-select:focus {
  border-color: color-mix(in srgb, var(--ia-primary) 60%, #86b7fe 40%);
  box-shadow: 0 0 0 .25rem color-mix(in srgb, var(--ia-primary) 25%, transparent);
}

/* ===== DARK THEME (opt-in with [data-bs-theme="dark"]) ===== */
[data-bs-theme="dark"] {
  --ia-primary: #94B3E1;   /* lightened brand blue for contrast */
  --ia-secondary: #7FA7D1;
  --ia-accent: #F0B35A;
  --ia-sand: #D9C59A;
  --ia-bg: #0F141B;
  --ia-surface: #161C24;
  --ia-text: #E6E7EA;
  --ia-muted: #94A3B8;

  --bs-body-bg: var(--ia-bg);
  --bs-body-color: var(--ia-text);
  --bs-border-color: color-mix(in srgb, var(--ia-muted) 30%, transparent);
  --bs-primary: #1F3A5F;   /* preserve brand hue for filled buttons */
  --bs-secondary: #2A547F;
  --bs-warning: #F1A734;
  --bs-link-color: #94B3E1;
  --bs-link-hover-color: #B6C7E7;
  --bs-primary-text-emphasis: #6ea8fe;
  --bs-primary-bg-subtle: #031633;
  --bs-card-bg: var(--ia-surface);
  --bs-modal-bg: var(--ia-surface);
  --bs-secondary-bg: #1A2230;
  --bs-tertiary-bg: #121821;
}

[data-bs-theme="dark"] .navbar {
  background-color: #121821;
  border-bottom-color: #1f2835;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  border-color: color-mix(in srgb, var(--bs-primary) 60%, #86b7fe 40%);
  box-shadow: 0 0 0 .25rem rgba(31, 58, 95, .35);
}
