/* =========================================================================
   Lazer registration console — brand theme + light/dark support
   Loaded AFTER Bootstrap so these rules win.
   ========================================================================= */

:root {
    /* Brand tokens */
    --lazer-green: #439541;
    --lazer-green-rgb: 67, 149, 65;
    --lazer-green-hover: #367a34;

    --lazer-blue: #4994ec;
    --lazer-blue-rgb: 73, 148, 236;
    --lazer-blue-hover: #3a80d6;
    --lazer-blue-active: #3576c9;

    --lazer-grey: #101417;
    --lazer-white: #ffffff;

    /* Map Bootstrap's "primary" to the brand blue (buttons / navbar / emphasis) */
    --bs-primary: var(--lazer-blue);
    --bs-primary-rgb: var(--lazer-blue-rgb);

    /* Links use the green accent */
    --bs-link-color: var(--lazer-green);
    --bs-link-color-rgb: var(--lazer-green-rgb);
    --bs-link-hover-color: var(--lazer-green-hover);
    --bs-link-hover-color-rgb: var(--lazer-green-rgb);


}

/* --- Primary buttons -> brand blue -------------------------------------- */
.btn-primary {
    --bs-btn-bg: var(--lazer-blue);
    --bs-btn-border-color: var(--lazer-blue);
    --bs-btn-hover-bg: var(--lazer-blue-hover);
    --bs-btn-hover-border-color: var(--lazer-blue-hover);
    --bs-btn-active-bg: var(--lazer-blue-active);
    --bs-btn-active-border-color: var(--lazer-blue-active);
    --bs-btn-disabled-bg: var(--lazer-blue);
    --bs-btn-disabled-border-color: var(--lazer-blue);
}

/* Utility classes Bootstrap ships with !important, so match it */
.bg-primary {
    background-color: var(--lazer-blue) !important;
}

.text-primary {
    color: var(--lazer-blue) !important;
}

.badge.bg-primary,
.badge.text-bg-primary {
    background-color: var(--lazer-blue) !important;
    color: #fff !important;
}

/* --- Green accent ------------------------------------------------------- */
/* Thin heartbeat-white line under the primary navbar */
.navbar.bg-primary {
    border-bottom: 3px solid var(--lazer-green);
}

/* Active nav item gets a white underline */
.navbar .nav-link.active {
    border-bottom: 2px solid var(--lazer-white);
}

/* White focus ring on inputs */
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--lazer-green);
    box-shadow: 0 0 0 0.25rem rgba(var(--lazer-green-rgb), 0.25);
}

.form-check-input:checked {
    background-color: var(--lazer-green);
    border-color: var(--lazer-green);
}

/* --- Theme toggle button ----------------------------------------------- */
/* Default: adapts to the current surface (used on plain body pages). */
.theme-toggle {
    line-height: 1;
    color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color);
    background-color: transparent;
}

.theme-toggle:hover {
    color: var(--bs-body-color);
    background-color: var(--bs-secondary-bg);
}

.theme-toggle-icon {
    font-size: 1rem;
}

/* On dark surfaces (colored navbar, grey org-select page) use light styling
   regardless of the active color mode. */
.navbar .theme-toggle,
body.org-select .theme-toggle {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
}

.navbar .theme-toggle:hover,
body.org-select .theme-toggle:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.15);
}

/* --- Organization-select landing page ---------------------------------- */
/* Grey in BOTH modes so the white Lazer wordmark stays legible. */
body.org-select {
    background-color: var(--lazer-grey);
    color: #e9ecef;
}

body.org-select .theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}

/* ========================================================================= */
/* DARK MODE                                                                 */
/* ========================================================================= */
[data-bs-theme="dark"] {
    --bs-body-bg: #101417;
    --bs-body-color: #e9ecef;
    --bs-emphasis-color: #ffffff;
    --bs-secondary-color: rgba(233, 236, 239, 0.75);
    --bs-secondary-bg: #1a1f24;
    --bs-tertiary-bg: #1a1f24;
    --bs-border-color: #2a3138;
    color-scheme: dark;
}

[data-bs-theme="dark"] .card {
    --bs-card-bg: #171c21;
    --bs-card-border-color: #2a3138;
    --bs-card-cap-bg: #1a1f24;
}

[data-bs-theme="dark"] .modal {
    --bs-modal-bg: #171c21;
    --bs-modal-border-color: #2a3138;
}

[data-bs-theme="dark"] .list-group {
    --bs-list-group-bg: #171c21;
    --bs-list-group-border-color: #2a3138;
    --bs-list-group-color: var(--bs-body-color);
    --bs-list-group-action-hover-bg: #1f262c;
    --bs-list-group-action-hover-color: var(--bs-body-color);
}

[data-bs-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--bs-body-color);
    --bs-table-border-color: #2a3138;
    --bs-table-hover-bg: rgba(255, 255, 255, 0.04);
    --bs-table-hover-color: var(--bs-body-color);
}

/* Blue-tinted table headers, muted for dark */
[data-bs-theme="dark"] .table-primary {
    --bs-table-bg: #16324f;
    --bs-table-color: #dbe9fb;
    --bs-table-border-color: #1d4a78;
    --bs-table-hover-bg: #1a3a5c;
    --bs-table-hover-color: #eaf2fd;
}

/* Danger-tinted rows/headers, muted for dark */
[data-bs-theme="dark"] .table-danger {
    --bs-table-bg: #4a1d24;
    --bs-table-color: #f8d7da;
    --bs-table-border-color: #6a2a33;
    --bs-table-hover-bg: #5a2530;
    --bs-table-hover-color: #ffe3e6;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #1a1f24;
    border-color: #2a3138;
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: rgba(233, 236, 239, 0.5);
}