html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f2f2f7;
    color: var(--bms-ink);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

/* Layout-specific rules live in css/layout-wide.css and css/layout-vertical.css */

/* Modern Card Styles */
.card {
    border: none !important;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03), 0 1px 2px rgba(0,0,0,0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.card-header {
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* Modern Button Styles */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: all 0.2s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: var(--bms-tint);
}

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

.btn-primary:hover {
    background-color: var(--bms-tint-hover);
    border-color: #381730;
}

.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 rgba(59, 18, 97, 0.25);
}

.bg-purple {
    background-color: var(--bms-tint) !important;
    color: white !important;
}

.text-gold {
    color: var(--bms-gold) !important;
}

.border-gold {
    border-color: var(--bms-gold) !important;
}

.bg-gold {
    background-color: var(--bms-gold) !important;
    color: #333 !important;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: #fff8e1;
    border-top: 3px solid var(--bms-gold);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* ---- Startup splash (index.html #bms-splash; hidden by App.razor via bmsHideSplash) ---- */
.bms-splash {
    position: fixed;
    inset: 0;
    z-index: 999; /* below #blazor-error-ui (1000) so boot errors stay visible */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem calc(1.5rem + env(safe-area-inset-bottom));
    background: radial-gradient(120% 120% at 0% 0%, #4C1D95 0%, #3B1261 45%, #220041 100%);
    color: #fff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-align: center;
    transition: opacity 0.5s ease, visibility 0s linear 0.5s;
}

    .bms-splash.is-done {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

        .bms-splash.is-done .bms-splash-inner {
            transform: scale(0.98) translateY(-6px);
        }

.bms-splash-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(22rem, 100%);
    transition: transform 0.5s ease;
    animation: bms-splash-in 0.6s cubic-bezier(.2, .7, .2, 1) both;
}

.bms-splash-emblem {
    position: relative;
    width: 9rem;
    height: 9rem;
    display: grid;
    place-items: center;
}

.bms-splash-seal {
    width: 7rem;
    height: 7rem;
    border-radius: 50%;
    background: #fff;
    padding: 5px;
    box-shadow: 0 0 0 5px rgba(217, 119, 6, 0.35), 0 20px 40px rgba(0, 0, 0, 0.35);
    animation: bms-splash-breathe 2.8s ease-in-out infinite;
}

.bms-splash-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    animation: bms-splash-spin 1.6s linear infinite;
}

    .bms-splash-ring circle {
        fill: none;
        stroke-width: 1.6;
    }

    .bms-splash-ring .track {
        stroke: rgba(255, 255, 255, 0.1);
    }

    .bms-splash-ring .arc {
        stroke: #F59E0B;
        stroke-linecap: round;
        stroke-dasharray: 22 78;
    }

.bms-splash-name {
    margin-top: 1.75rem;
    font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
    font-size: clamp(1.4rem, 5vw, 1.75rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.bms-splash-sub {
    margin-top: 0.4rem;
    color: #FDBA74;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.bms-splash-bar {
    position: relative;
    width: 11rem;
    height: 3px;
    margin-top: 2rem;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

    .bms-splash-bar span {
        position: absolute;
        inset: 0 auto 0 0;
        width: var(--blazor-load-percentage, 4%);
        border-radius: inherit;
        background: linear-gradient(90deg, #D97706, #FBBF24);
        transition: width 0.25s ease-out;
    }

        .bms-splash-bar span::after {
            content: "";
            position: absolute;
            inset: 0;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
            animation: bms-splash-shimmer 1.4s ease-in-out infinite;
        }

.bms-splash-status {
    margin-top: 0.75rem;
    min-height: 1.1em;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    font-variant-numeric: tabular-nums;
}

    .bms-splash-status::after {
        content: "Loading portal\2002" var(--blazor-load-percentage-text, "");
    }

@keyframes bms-splash-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

@keyframes bms-splash-spin {
    to { transform: rotate(360deg); }
}

@keyframes bms-splash-breathe {
    0%, 100% { box-shadow: 0 0 0 5px rgba(217, 119, 6, 0.35), 0 20px 40px rgba(0, 0, 0, 0.35); }
    50% { box-shadow: 0 0 0 9px rgba(217, 119, 6, 0.18), 0 20px 40px rgba(0, 0, 0, 0.35); }
}

@keyframes bms-splash-shimmer {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

code {
    color: #c02d76;
}

.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;
}

/* ---- UX/UI enhancements ---- */
.skip-link {
    position: absolute;
    left: 1rem;
    top: -100px;
    z-index: 2000;
    background: var(--bms-tint);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.skip-link:focus {
    top: 1rem;
    color: #fff;
}

#main-content:focus {
    outline: none;
}

a:focus-visible, .nav-link:focus-visible, .btn:focus-visible {
    outline: 2px solid var(--bms-gold);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* =================================================================
   Apple Human Interface style layer (buttons, fields, surfaces)
   ================================================================= */
:root {
    /* Academic Clinical Prestige tokens (Design Mockups/academic_clinical_prestige/DESIGN.md) */
    --bms-tint: #3B1261;          /* Imperial Royal Purple */
    --bms-tint-hover: #4C1D95;    /* Deep Royal Violet */
    --bms-tint-soft: rgba(59, 18, 97, 0.08);
    --bms-primary-deep: #220041;
    --bms-gold: #D97706;          /* Caduceus Gold / Amber */
    --bms-gold-text: #B45309;     /* AA-legible gold for small text */
    --bms-gold-soft: rgba(217, 119, 6, 0.08);
    --bms-ink: #0F172A;           /* Slate Navy */
    --bms-ink-2: #475569;
    --bms-canvas: #F8FAFC;
    --bms-surface: #FFFFFF;
    --bms-surface-2: #F1F5F9;
    --bms-border: #E2E8F0;
    --bms-input-border: #CBD5E1;
    --bms-shadow-1: 0 1px 3px 0 rgba(15, 23, 42, 0.05), 0 1px 2px -1px rgba(15, 23, 42, 0.05);
    --bms-shadow-2: 0 10px 15px -3px rgba(59, 18, 97, 0.07), 0 4px 6px -4px rgba(59, 18, 97, 0.04);
    --bms-shadow-3: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
    --bms-font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
    --bms-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    --ios-bg: var(--bms-canvas);
    --ios-fill: var(--bms-surface-2);
    --ios-separator: var(--bms-border);
    --ios-label-2: var(--bms-ink-2);
    --ios-red: #ba1a1a;
    --ios-green: #15803d;
    --ios-radius: 8px;

    /* Bootstrap re-theme */
    --bs-primary: #3B1261;
    --bs-primary-rgb: 59, 18, 97;
    --bs-body-bg: var(--bms-canvas);
    --bs-body-color: var(--bms-ink);
    --bs-body-font-family: var(--bms-font-sans);
    --bs-border-color: var(--bms-border);
    --bs-link-color: #3B1261;
    --bs-link-color-rgb: 59, 18, 97;
    --bs-link-hover-color: #4C1D95;
    --bs-link-hover-color-rgb: 76, 29, 149;
    --bs-secondary-color: var(--bms-ink-2);
}

.page-wrapper {
    background-color: var(--ios-bg) !important;
}

/* Surfaces */
.card {
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}

.card-header {
    border-top-left-radius: 16px !important;
    border-top-right-radius: 16px !important;
    border-bottom: 0.5px solid var(--ios-separator);
}

.modal-content {
    border: 0;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

/* Buttons: filled, tinted, plain */
.btn {
    min-height: 44px;
    border-radius: var(--ios-radius);
    border-width: 0;
    font-weight: 590;
    font-size: 1rem;
    letter-spacing: -0.01em;
    padding: 0.6rem 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    transition: transform 0.12s ease, opacity 0.12s ease, background-color 0.2s ease;
}

.btn:active {
    transform: scale(0.97);
    opacity: 0.85;
}

.btn:disabled, .btn.disabled {
    opacity: 0.4;
}

.btn-sm {
    min-height: 32px;
    font-size: 0.875rem;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
}

.btn-lg {
    min-height: 50px;
    font-size: 1.0625rem;
    border-radius: 14px;
}

.btn.rounded-pill {
    border-radius: 999px !important;
}

.btn-primary, .btn-primary:focus {
    background-color: var(--bms-tint);
    color: #fff;
}

.btn-primary:hover, .btn-primary:active {
    background-color: var(--bms-tint-hover) !important;
    color: #fff;
}

.btn-secondary {
    background-color: var(--ios-fill);
    color: var(--bms-ink);
}

.btn-secondary:hover {
    background-color: rgba(118, 118, 128, 0.2);
    color: var(--bms-ink);
}

.btn-danger { background-color: var(--ios-red); }
.btn-success { background-color: var(--ios-green); }

/* Outline buttons become HIG "tinted" buttons */
.btn-outline-primary, .btn-outline-secondary, .btn-outline-danger, .btn-outline-success,
.btn-outline-warning, .btn-outline-info, .btn-outline-dark, .btn-outline-light {
    border: 0 !important;
}

.btn-outline-primary { background-color: var(--bms-tint-soft); color: var(--bms-tint); }
.btn-outline-primary:hover, .btn-outline-primary.active { background-color: rgba(59, 18, 97, 0.2); color: var(--bms-tint); }
.btn-outline-secondary { background-color: var(--ios-fill); color: var(--bms-ink); }
.btn-outline-secondary:hover { background-color: rgba(118, 118, 128, 0.2); color: var(--bms-ink); }
.btn-outline-danger { background-color: rgba(255, 59, 48, 0.12); color: var(--ios-red); }
.btn-outline-danger:hover { background-color: rgba(255, 59, 48, 0.2); color: var(--ios-red); }
.btn-outline-success { background-color: rgba(52, 199, 89, 0.14); color: #248a3d; }
.btn-outline-success:hover { background-color: rgba(52, 199, 89, 0.22); color: #248a3d; }

.btn-link {
    background: transparent;
    min-height: auto;
    text-decoration: none;
}

.btn-close {
    min-height: auto;
}

/* Text fields & selects */
.form-control, .form-select {
    min-height: 44px;
    border-radius: 10px;
    border: 0.5px solid var(--ios-separator);
    background-color: #fff;
    font-size: 1rem; /* 16px avoids iOS zoom-on-focus */
    padding: 0.55rem 0.85rem;
    color: var(--bms-ink);
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.form-select {
    padding-right: 2.25rem;
}

textarea.form-control {
    min-height: 88px;
}

.form-control-sm, .form-select-sm {
    min-height: 34px;
    font-size: 0.875rem;
}

.form-control::placeholder {
    color: rgba(60, 60, 67, 0.3);
}

.form-control:focus, .form-select:focus {
    border-color: var(--bms-tint);
    box-shadow: 0 0 0 4px rgba(59, 18, 97, 0.15) !important;
}

.form-control:disabled, .form-control[readonly] {
    background-color: var(--ios-bg);
}

.form-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ios-label-2);
    margin-bottom: 0.35rem;
    margin-left: 0.15rem;
}

.input-group > .form-control, .input-group > .btn {
    min-height: 44px;
}

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

.form-switch .form-check-input {
    width: 2.6em;
    height: 1.5em;
}

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

.invalid {
    outline: none;
    border-color: var(--ios-red) !important;
}

.validation-message {
    color: var(--ios-red);
    font-size: 0.8125rem;
}

/* Alerts, tables, badges */
.alert {
    border: 0;
    border-radius: var(--ios-radius);
}

.table-responsive {
    border-radius: 16px !important;
    border: 0 !important;
}

.badge {
    border-radius: 999px;
    font-weight: 600;
}

/* Translucent header (vibrancy) */
header.bg-white {
    background-color: rgba(255, 255, 255, 0.82) !important;
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    position: relative;
    z-index: 1020;
}

header .navbar.bg-white {
    background-color: transparent !important;
}

/* ---- Auth layout (Login / Register), shared ---- */
.auth-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    background: var(--ios-bg);
}

.auth-brand {
    color: #fff;
    background: radial-gradient(120% 120% at 0% 0%, var(--bms-tint-hover) 0%, var(--bms-tint) 45%, var(--bms-primary-deep) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.auth-seal {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #fff;
    padding: 6px;
    box-shadow: 0 0 0 6px rgba(217, 119, 6, 0.35), 0 20px 40px rgba(0, 0, 0, 0.3);
}

.auth-brand-name { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.02em; margin-top: 1.5rem; line-height: 1.2; }
.auth-brand-sub { color: var(--bms-gold); font-weight: 600; margin-top: 0.35rem; }
.auth-brand-tag { margin: 1.25rem 0 0; opacity: 0.7; font-size: 0.9rem; }

.auth-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.auth-form { width: 100%; }

/* Neutralise page-level grid columns so the form uses the layout's width */
.auth-form .container-fluid { padding: 0; margin-top: 0 !important; }
.auth-form .row { margin: 0; }
.auth-form .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; padding: 0; }
.auth-form .row.g-3 > [class*="col-md-6"] { padding: calc(var(--bs-gutter-x) * .5); }
.auth-form .card { box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 0 0 0.5px rgba(0,0,0,0.05); }
.auth-form .card-body > .text-center:first-child img { display: none; } /* seal already in brand panel */

.auth-footer { padding: 1.25rem; color: var(--ios-label-2); text-align: center; }

/* =================================================================
   Academic Clinical Prestige layer (overrides the HIG layer above)
   Source: Design Mockups/academic_clinical_prestige/DESIGN.md
   ================================================================= */
html, body {
    font-family: var(--bms-font-sans);
    background-color: var(--bms-canvas);
    color: var(--bms-ink);
}

h1, h2, h3, .display-1, .display-2, .display-3, .display-4, .display-5, .display-6,
.auth-brand-name, .brand-title {
    font-family: var(--bms-font-serif);
    font-weight: 600;
    letter-spacing: -0.015em;
    font-variant-numeric: oldstyle-nums proportional-nums;
}

h4, h5, h6 { font-family: var(--bms-font-sans); font-weight: 600; letter-spacing: 0; }

/* Level 1 surfaces: hairline + ambient shadow; Level 2 on hover */
.card {
    background-color: var(--bms-surface);
    border: 1px solid var(--bms-border) !important;
    border-radius: 8px;
    box-shadow: var(--bms-shadow-1);
}

.card:hover { box-shadow: var(--bms-shadow-2); }
.card.border-0, .card.shadow-none { border-color: var(--bms-border) !important; }

.card-header {
    background-color: var(--bms-surface-2);
    border-top-left-radius: 7px !important;
    border-top-right-radius: 7px !important;
    border-bottom: 1px solid var(--bms-border);
}

.modal-content { border-radius: 8px; box-shadow: var(--bms-shadow-3); }
.modal-backdrop.show { background-color: var(--bms-ink); opacity: 0.45; }
.dropdown-menu { border: 1px solid var(--bms-border); border-radius: 8px; box-shadow: var(--bms-shadow-2); }

/* Buttons */
.btn { border-radius: 8px; font-weight: 600; letter-spacing: 0; }
.btn-sm { border-radius: 6px; }
.btn-lg { border-radius: 8px; }

.btn-primary, .btn-primary:focus { background-color: var(--bms-tint); border-color: var(--bms-tint); color: #fff; }
.btn-primary:hover, .btn-primary:active { background-color: var(--bms-tint-hover) !important; color: #fff; }

.btn-secondary, .btn-outline-primary, .btn-outline-secondary {
    background-color: var(--bms-surface);
    color: var(--bms-tint);
    border: 1px solid var(--bms-input-border) !important;
}

.btn-secondary:hover, .btn-outline-primary:hover, .btn-outline-primary.active,
.btn-outline-secondary:hover {
    background-color: var(--bms-canvas);
    color: var(--bms-tint);
    border-color: var(--bms-tint) !important;
}

.btn-outline-secondary { color: var(--bms-ink); }

/* Prestigious / honor action */
.btn-honor, .btn-warning { background-color: var(--bms-gold); border-color: var(--bms-gold); color: #fff; }
.btn-honor:hover, .btn-warning:hover { background-color: var(--bms-gold-text); color: #fff; }

/* Inputs */
.form-control, .form-select {
    border: 1px solid var(--bms-input-border);
    border-radius: 6px;
    color: var(--bms-ink);
}

.form-control:focus, .form-select:focus {
    border-color: var(--bms-tint);
    box-shadow: 0 0 0 3px rgba(59, 18, 97, 0.12) !important;
}

.form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--bms-ink-2);
}

.form-switch .form-check-input:checked { background-color: var(--bms-tint); border-color: var(--bms-tint); }

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 18, 97, 0.12);
}

a:focus-visible, .nav-link:focus-visible, .btn:focus-visible { outline-color: var(--bms-gold); }

/* Alerts, tables, badges */
.alert { border: 1px solid var(--bms-border); border-radius: 8px; }
.table-responsive { border: 1px solid var(--bms-border) !important; border-radius: 8px !important; background: var(--bms-surface); }
.table > thead th, .table > thead td {
    background-color: var(--bms-surface-2);
    color: var(--bms-ink-2);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom-color: var(--bms-border);
}

.badge { border-radius: 4px; font-weight: 700; letter-spacing: 0.04em; }
.badge.rounded-pill { border-radius: 999px; }

/* Specialty chip & honor badge */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--bms-border);
    background: var(--bms-surface-2);
    color: var(--bms-ink);
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 14px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.badge-honor {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--bms-gold);
    background: var(--bms-gold-soft);
    color: var(--bms-gold-text);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Officer / board accent and avatar rings */
.accent-gold { border-top: 3px solid var(--bms-gold) !important; }
.accent-purple { border-top: 3px solid var(--bms-tint) !important; }
.avatar-ring { border-radius: 50%; border: 2px solid var(--bms-border); }
.avatar-ring.officer { border-color: var(--bms-gold); }

/* Color helpers */
.text-gold { color: var(--bms-gold-text) !important; }
.bg-gold { background-color: var(--bms-gold) !important; color: #fff !important; }
.text-primary { color: var(--bms-tint) !important; }
.bg-primary { background-color: var(--bms-tint) !important; }

/* Frosted header */
header.bg-white {
    background-color: rgba(250, 248, 255, 0.9) !important;
    box-shadow: 0 1px 8px rgba(34, 0, 65, 0.04);
    border-bottom: 1px solid var(--bms-border);
}

/* Auth brand panel */
.auth-brand { background: radial-gradient(120% 120% at 0% 0%, var(--bms-tint-hover) 0%, var(--bms-tint) 45%, var(--bms-primary-deep) 100%); }
.auth-brand-sub { color: #FDBA74; letter-spacing: 0.06em; text-transform: uppercase; font-family: var(--bms-font-sans); font-size: 0.8rem; }

/* ---- Read-only profile details (InfoGroup / InfoRow) ---- */
.info-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr));
    gap: 1.25rem;
    align-items: start;
}

.info-group .info-group-title {
    margin: 0 0 0.5rem 0.25rem;
    color: var(--bms-gold-text);
    font-family: var(--bms-font-sans);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.info-group-body {
    background: var(--bms-surface);
    border: 1px solid var(--bms-border);
    border-radius: 12px;
    box-shadow: var(--bms-shadow-1);
    overflow: hidden;
}

/* Inside a white card, a soft fill reads better than a second white box */
.card .info-group-body {
    background: var(--bms-canvas);
    box-shadow: none;
}

.info-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-height: 3.75rem;
    padding: 0.7rem 1rem;
}

/* Inset separator, aligned with the text rather than the icon */
.info-row + .info-row::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 4.35rem;
    border-top: 1px solid var(--bms-border);
}

.info-icon {
    flex: 0 0 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--bms-tint-soft);
    color: var(--bms-tint);
    font-size: 1.15rem;
}

.info-text { min-width: 0; flex: 1; }

.info-label {
    color: var(--bms-ink-2);
    font-size: 0.85rem;
    line-height: 1.3;
}

.info-value {
    color: var(--bms-ink);
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.info-value--empty {
    color: var(--bms-ink-2);
    font-weight: 400;
    font-style: italic;
}

.info-link {
    display: block;
    color: var(--bms-tint);
    text-decoration: none;
}

.info-link:hover { text-decoration: underline; }

.info-value .chip {
    margin: 0.2rem 0.25rem 0 0;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    white-space: normal;
}

/* Viewing someone else's profile: drop blank fields, and any group left with none */
.info-list--hide-empty .info-row--empty,
.info-list--hide-empty .info-group:not(:has(.info-row:not(.info-row--empty))) {
    display: none;
}

/* ...and keep the separator off whichever row ends up first */
.info-list--hide-empty .info-row::before { display: none; }
.info-list--hide-empty .info-row:not(.info-row--empty) ~ .info-row::before { display: block; }
