@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --brand-primary: #0069d9;
    --brand-dark: #082f6b;
    --brand-accent: #38bdf8;
    --brand-success: #0f9d58;
    --brand-warning: #b45309;
    --brand-grey: #64748b;
    --brand-bg: #f1f5f9;
    --surface: #ffffff;
    --border: #e6eaf0;
    --border-strong: #d3dae4;
    --text: #0f172a;
    --text-muted: #64748b;
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 8px 24px -6px rgba(15, 23, 42, 0.10), 0 2px 6px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 20px 45px -12px rgba(15, 23, 42, 0.18);
}

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    -webkit-text-size-adjust: 100%;
}

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background: #fafbfd;
    height: 100%;
    letter-spacing: -0.011em;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-size: 0.9375rem;
    line-height: 1.6;
    overflow-x: hidden;
}

.main-content-wrap {
    flex: 1 0 auto;
}

main {
    max-width: 1240px;
    margin: 0 auto;
    width: 100%;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.025em;
    line-height: 1.25;
    overflow-wrap: break-word;
}

h1 {
    font-size: 2rem;
    font-weight: 800;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.0625rem;
}

a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

    a:hover {
        color: var(--brand-dark);
    }

.text-muted, p.small {
    color: var(--text-muted) !important;
}

img {
    max-width: 100%;
    height: auto;
}

/* ---------- Header ---------- */
.site-header-top {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.site-nav-bar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.35rem 0;
}

    .site-nav-bar .navbar-nav {
        gap: 0.25rem;
    }

    .site-nav-bar .nav-link {
        color: var(--text-muted) !important;
        font-weight: 500;
        font-size: 0.9rem;
        padding: 0.5rem 0.95rem !important;
        border-radius: 999px;
        border-bottom: none;
        transition: background-color 0.15s ease, color 0.15s ease;
    }

        .site-nav-bar .nav-link:hover {
            background: var(--brand-bg);
            color: var(--text) !important;
            border-bottom: none;
        }

        .site-nav-bar .nav-link.active {
            background: rgba(0, 105, 217, 0.10);
            color: var(--brand-primary) !important;
            font-weight: 600;
        }

.navbar-toggler {
    border-color: var(--border-strong);
    padding: 0.35rem 0.6rem;
}

    .navbar-toggler:focus {
        box-shadow: 0 0 0 3px rgba(0, 105, 217, 0.12);
    }

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

    .card:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-md);
    }

.card-title {
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Tile links */
.tile-link {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: var(--radius);
    padding: 1.75rem;
    height: 100%;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

    .tile-link::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
        opacity: 0;
        transition: opacity 0.2s ease;
    }

    .tile-link:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-md);
    }

        .tile-link:hover::before {
            opacity: 1;
        }

    .tile-link h3 {
        color: var(--text);
        margin-bottom: 0.4rem;
        font-size: 1.125rem;
    }

    .tile-link p {
        color: var(--text-muted);
        margin-bottom: 0;
        font-size: 0.9rem;
    }

/* Callout */
.callout-box {
    background: linear-gradient(135deg, #f8fbff 0%, #f1f5f9 100%);
    border: 1px solid var(--border);
    border-left: 3px solid var(--brand-primary);
    border-radius: var(--radius);
    padding: 1.5rem 1.75rem;
    box-shadow: var(--shadow-xs);
}

    .callout-box h4 {
        margin-bottom: 0.5rem;
        color: var(--text);
    }

    .callout-box p {
        color: var(--text-muted);
    }

/* Hero */
.hero-section {
    background: linear-gradient(135deg, #eef4ff 0%, #f5f9ff 45%, #eefaff 100%) !important;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-sm);
}

    .hero-section h1 {
        letter-spacing: -0.035em;
    }

.hero-illustration img {
    max-width: 100%;
    height: auto;
}

/* ---------- Buttons ---------- */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.55rem 1.15rem;
    transition: all 0.15s ease;
    border-width: 1px;
}

    .btn:active {
        transform: translateY(1px);
    }

.btn-brand {
    background: var(--brand-primary);
    color: #ffffff;
    border: none;
    box-shadow: 0 1px 2px rgba(8, 47, 107, 0.2);
}

    .btn-brand:hover {
        background: var(--brand-dark);
        color: #ffffff;
        box-shadow: 0 4px 12px rgba(8, 47, 107, 0.24);
    }

.btn-outline-secondary {
    border-color: var(--border-strong);
    color: var(--text-muted);
    background: var(--surface);
}

    .btn-outline-secondary:hover {
        background: var(--brand-bg);
        border-color: var(--border-strong);
        color: var(--text);
    }

.btn-outline-danger {
    border-color: #fecaca;
    color: #dc2626;
    background: var(--surface);
}

    .btn-outline-danger:hover {
        background: #dc2626;
        border-color: #dc2626;
        color: #fff;
    }

.btn-sm {
    padding: 0.35rem 0.8rem;
    font-size: 0.825rem;
}

/* ---------- Forms ---------- */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
    background: var(--surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

    .form-control:focus, .form-select:focus {
        border-color: var(--brand-primary);
        box-shadow: 0 0 0 3px rgba(0, 105, 217, 0.12);
    }

    .form-control::placeholder {
        color: #a3aec0;
    }

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.form-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.input-group-text {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    border-color: var(--border-strong);
    background: var(--surface);
}

.input-group > .form-control:not(:last-child) {
    border-radius: 0;
}

.input-group > .btn {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ---------- Tables ---------- */
.table {
    margin-bottom: 0;
    font-size: 0.9rem;
}

    .table thead th {
        background: #fafbfd;
        border-bottom: 1px solid var(--border);
        color: var(--text-muted);
        font-weight: 600;
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        padding: 0.85rem 1.1rem;
        white-space: nowrap;
    }

    .table tbody td {
        padding: 0.95rem 1.1rem;
        border-bottom: 1px solid var(--border);
        vertical-align: middle;
        color: var(--text);
    }

    .table tbody tr:last-child td {
        border-bottom: none;
    }

    .table tbody tr {
        transition: background-color 0.12s ease;
    }

        .table tbody tr:hover {
            background: #fafbfd;
        }

/* Any card wrapping a table scrolls sideways rather than breaking the layout */
.card:has(> .table),
.card:has(> table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ---------- Badges ---------- */
.badge {
    font-weight: 600;
    font-size: 0.72rem;
    padding: 0.35em 0.7em;
    border-radius: 999px;
    letter-spacing: 0.01em;
}

/* ---------- Tabs ---------- */
.nav-tabs {
    border-bottom: 1px solid var(--border);
    gap: 0.25rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

    .nav-tabs .nav-link {
        border: none;
        border-bottom: 2px solid transparent;
        color: var(--text-muted);
        font-weight: 500;
        font-size: 0.9rem;
        padding: 0.65rem 1rem;
        border-radius: 0;
        white-space: nowrap;
    }

        .nav-tabs .nav-link:hover {
            border-color: transparent;
            color: var(--text);
        }

        .nav-tabs .nav-link.active {
            color: var(--brand-primary);
            border-bottom-color: var(--brand-primary);
            background: transparent;
            font-weight: 600;
        }

/* ---------- Alerts / modals / lists ---------- */
.alert {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 0.9rem;
    padding: 0.9rem 1.15rem;
}

.alert-success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.alert-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.modal-content {
    border-radius: var(--radius);
    border: none;
    box-shadow: var(--shadow-lg);
}

.modal-header, .modal-footer {
    border-color: var(--border);
    padding: 1.15rem 1.4rem;
}

.modal-body {
    padding: 1.4rem;
}

.list-group-item {
    border-color: var(--border);
    padding: 0.95rem 1.15rem;
    font-size: 0.9rem;
}

/* ---------- Provider cards ---------- */
.provider-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--surface);
    box-shadow: var(--shadow-md);
    margin-top: -56px;
    background: #fff;
    position: relative;
    z-index: 2;
}

.provider-card-top {
    height: 76px;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-dark) 100%);
    position: relative;
}

    .provider-card-top::after {
        content: '';
        position: absolute;
        inset: 0;
        background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.22), transparent 60%);
    }

/* ---------- Footer ---------- */
footer.footer {
    position: static !important;
    bottom: auto !important;
    width: auto !important;
}

.site-footer {
    background: #0b1b34;
    color: #94a3b8;
    flex-shrink: 0;
    font-size: 0.875rem;
}

    .site-footer a {
        color: #94a3b8;
        text-decoration: none;
        transition: color 0.15s ease;
    }

        .site-footer a:hover {
            color: #ffffff;
        }

    .site-footer .footer-heading {
        color: #ffffff;
        font-weight: 600;
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        margin-bottom: 1rem;
    }

    .site-footer ul li {
        margin-bottom: 0.55rem;
    }

.footer-bottom {
    background: #071224;
    color: #64748b;
    font-size: 0.8125rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-logo-badge {
    display: inline-block;
    background: #ffffff;
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-sm);
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
    border: 3px solid #fafbfd;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }

/* =========================================================
   TABLET
   ========================================================= */
@media (max-width: 991.98px) {
    h1 {
        font-size: 1.75rem;
    }

    .hero-section {
        padding: 2rem !important;
    }

    .tile-link {
        padding: 1.4rem;
    }
}

/* =========================================================
   PHONE
   ========================================================= */
@media (max-width: 767.98px) {
    body {
        font-size: 0.9rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    /* Tighter gutters so content isn't squeezed into the middle */
    .container-fluid.px-4 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    main[role="main"] {
        padding-top: 1.25rem !important;
    }

    /* Header: logo shrinks, controls stay on one row */
    .site-header-top .container-fluid {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }

    .site-header-top img {
        height: 32px !important;
    }

    .site-header-top .navbar-nav {
        gap: 0.75rem !important;
    }

    /* Collapsed nav becomes a stacked panel */
    .site-nav-bar .navbar-collapse {
        padding: 0.5rem 0;
    }

    .site-nav-bar .navbar-nav {
        flex-direction: column;
        gap: 0.15rem;
        width: 100%;
    }

    .site-nav-bar .nav-link {
        padding: 0.7rem 0.9rem !important;
        border-radius: var(--radius-sm);
    }

    /* Cards and forms use the full width */
    .card {
        border-radius: var(--radius-sm);
    }

        .card.p-4 {
            padding: 1.15rem !important;
        }

    .tile-link {
        padding: 1.25rem;
        margin-bottom: 0.25rem;
    }

    .callout-box {
        padding: 1.15rem 1.25rem;
    }

    .hero-section {
        padding: 1.5rem !important;
        text-align: center;
    }

        .hero-section .display-5 {
            font-size: 1.6rem;
        }

        .hero-section .fs-5 {
            font-size: 0.95rem !important;
        }

    /* Bootstrap column helpers that assume a wide screen */
    .col-lg-6, .col-lg-5, .col-lg-4 {
        width: 100%;
    }

    /* Buttons: comfortable touch targets, stacked not crammed */
    .btn {
        padding: 0.65rem 1.1rem;
        font-size: 0.9rem;
    }

    .btn-sm {
        padding: 0.45rem 0.8rem;
    }

    /* Action buttons inside table rows stop overlapping */
    .table td.text-end .btn,
    .table td.text-end form {
        margin-bottom: 0.25rem;
    }

    /* Tables keep readable column widths and scroll horizontally */
    .card:has(> .table),
    .card:has(> table) {
        overflow-x: auto;
    }

    .table {
        min-width: 640px;
        font-size: 0.85rem;
    }

        .table thead th,
        .table tbody td {
            padding: 0.7rem 0.8rem;
        }

    /* Headings with a button beside them stack instead of colliding */
    .d-flex.justify-content-between {
        gap: 0.75rem;
    }

    /* Provider cards */
    .provider-avatar {
        width: 72px;
        height: 72px;
        margin-top: -46px;
    }

    .provider-card-top {
        height: 62px;
    }

    /* Modals sit closer to the edges */
    .modal-dialog {
        margin: 0.75rem;
    }

    .modal-header, .modal-footer {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer .btn,
    .modal-footer form {
        width: 100%;
    }

        .modal-footer form .btn {
            width: 100%;
        }

    /* Footer stacks with breathing room */
    .site-footer .container-fluid {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    .site-footer .row > div {
        margin-bottom: 1.25rem;
    }
}

/* =========================================================
   SMALL PHONE
   ========================================================= */
@media (max-width: 575.98px) {
    h1 {
        font-size: 1.35rem;
    }

    /* Hide the greeting text, keep the profile icon */
    #manage span {
        display: none;
    }

    .site-header-top .navbar-nav {
        gap: 0.6rem !important;
    }

    .site-header-top .btn-sm {
        padding: 0.4rem 0.7rem;
        font-size: 0.78rem;
    }

    /* Full-width primary actions read better than tiny centred ones */
    .card.p-4 .btn-brand,
    .card.p-4 .btn-outline-secondary {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .hero-section .display-5 {
        font-size: 1.4rem;
    }

    .filter-chip {
        font-size: 0.78rem;
        padding: 0.3rem 0.7rem;
    }
}

/* Stop iOS zooming the page when a field is focused */
@media (max-width: 767.98px) {
    .form-control,
    .form-select,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    textarea {
        font-size: 16px;
    }
}
/* ---------- Active page indicator ---------- */
.site-nav-bar .nav-link.active {
    background: rgba(0, 105, 217, 0.10);
    color: var(--brand-primary) !important;
    font-weight: 600;
    box-shadow: 0 2px 10px -2px rgba(0, 105, 217, 0.45), inset 0 0 0 1px rgba(0, 105, 217, 0.14);
}

/* Header lifts off the page once you scroll */
.site-header-top {
    transition: box-shadow 0.25s ease, background-color 0.25s ease;
}

    .site-header-top.is-scrolled {
        box-shadow: 0 6px 20px -8px rgba(15, 23, 42, 0.22);
        background: rgba(255, 255, 255, 0.94);
    }

.site-nav-bar {
    transition: box-shadow 0.25s ease;
}

    .site-nav-bar.is-scrolled {
        box-shadow: 0 4px 14px -6px rgba(15, 23, 42, 0.18);
    }

/* ---------- Entrance animation ---------- */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1), transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}

    .reveal.is-visible {
        opacity: 1;
        transform: none;
    }

/* Page content eases in on load */
main[role="main"] > *:not(.reveal) {
    animation: pageFade 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes pageFade {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* Interactive polish */
.btn, .card, .tile-link, .filter-chip, .practice-item, .nav-link {
    will-change: transform;
}

.btn-brand:active,
.btn-outline-secondary:active {
    transform: translateY(1px) scale(0.995);
}

.table tbody tr {
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.badge {
    transition: transform 0.15s ease;
}

.card:hover .badge {
    transform: scale(1.04);
}

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}
/* ---------- Icon buttons ---------- */
.mb-icon {
    width: 17px;
    height: 17px;
    display: block;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0 !important;
    border-radius: var(--radius-sm);
    line-height: 1;
}

    .btn-icon:active {
        transform: scale(0.94);
    }

.row-actions {
    display: flex;
    gap: 0.3rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

    .row-actions form {
        display: inline-flex;
        margin: 0;
    }

/* Tooltip styling to match the rest of the UI */
.tooltip-inner {
    background: #0f172a;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: #0f172a;
}

.tooltip.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: #0f172a;
}

@media (max-width: 575.98px) {
    .btn-icon {
        width: 40px;
        height: 40px;
    }
}
/* ---------- Mobile nav toggle ---------- */
.navbar-toggler {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

    .navbar-toggler:hover {
        background: var(--brand-bg);
    }

    .navbar-toggler:focus {
        box-shadow: 0 0 0 3px rgba(0, 105, 217, 0.14);
        outline: none;
    }

    /* Draw the icon ourselves so it doesn't depend on navbar-dark / navbar-light */
    .navbar-toggler .navbar-toggler-icon {
        width: 22px;
        height: 22px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='%230f172a' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.6' d='M4 8h22M4 15h22M4 22h22'/%3E%3C/svg%3E");
        background-size: 22px 22px;
        background-repeat: no-repeat;
        background-position: center;
        transition: background-image 0.15s ease;
    }

    /* Turns into a cross while the menu is open */
    .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='%230069d9' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.6' d='M7 7l16 16M23 7L7 23'/%3E%3C/svg%3E");
    }

    .navbar-toggler[aria-expanded="true"] {
        border-color: var(--brand-primary);
        background: rgba(0, 105, 217, 0.06);
    }

/* The expanded menu panel on phones */
@media (max-width: 575.98px) {
    .site-nav-bar .container-fluid {
        padding-top: 0.4rem;
        padding-bottom: 0.4rem;
    }

    .site-nav-bar .navbar-collapse {
        margin-top: 0.5rem;
        border-top: 1px solid var(--border);
        padding-top: 0.5rem;
    }

    .site-nav-bar .nav-link {
        padding: 0.8rem 0.9rem !important;
        border-radius: var(--radius-sm);
        font-size: 0.95rem;
    }

        .site-nav-bar .nav-link.active {
            box-shadow: inset 0 0 0 1px rgba(0, 105, 217, 0.20);
        }
}
/* =========================================================
   DARK MODE
   Everything hangs off the variables, so most components
   need no rules of their own - only ones with hard-coded
   light colours are overridden below.
   ========================================================= */

.theme-toggle .icon-moon {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: block;
}

[data-theme="dark"] {
    --brand-primary: #4c9bf5;
    --brand-dark: #7fb8f8;
    --brand-accent: #38bdf8;
    --brand-bg: #1c2740;
    --surface: #151d2e;
    --border: #26324a;
    --border-strong: #33415e;
    --text: #e6edf7;
    --text-muted: #94a5c0;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.28);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.38), 0 1px 2px rgba(0, 0, 0, 0.28);
    --shadow-md: 0 10px 26px -8px rgba(0, 0, 0, 0.60), 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 22px 48px -14px rgba(0, 0, 0, 0.70);
}

    [data-theme="dark"] html,
    [data-theme="dark"] body {
        background: #0d1424;
        color: var(--text);
    }

    /* Header and nav */
    [data-theme="dark"] .site-header-top {
        background: rgba(19, 26, 42, 0.86);
        border-bottom-color: var(--border);
    }

        [data-theme="dark"] .site-header-top.is-scrolled {
            background: rgba(19, 26, 42, 0.96);
            box-shadow: 0 6px 20px -8px rgba(0, 0, 0, 0.6);
        }

    [data-theme="dark"] .site-nav-bar {
        background: #131a2a;
        border-bottom-color: var(--border);
    }

        [data-theme="dark"] .site-nav-bar .nav-link:hover {
            background: var(--brand-bg);
        }

        [data-theme="dark"] .site-nav-bar .nav-link.active {
            background: rgba(76, 155, 245, 0.16);
            color: var(--brand-primary) !important;
            box-shadow: 0 2px 12px -2px rgba(76, 155, 245, 0.45), inset 0 0 0 1px rgba(76, 155, 245, 0.25);
        }

    [data-theme="dark"] .navbar-toggler {
        background: var(--surface);
        border-color: var(--border-strong);
    }

        [data-theme="dark"] .navbar-toggler .navbar-toggler-icon {
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='%23e6edf7' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.6' d='M4 8h22M4 15h22M4 22h22'/%3E%3C/svg%3E");
        }

        [data-theme="dark"] .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon {
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='%234c9bf5' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.6' d='M7 7l16 16M23 7L7 23'/%3E%3C/svg%3E");
        }

    /* Surfaces with hard-coded light values */
    [data-theme="dark"] .table thead th {
        background: #1a2334;
    }

    [data-theme="dark"] .table tbody tr:hover {
        background: #1a2334;
    }

    [data-theme="dark"] .callout-box {
        background: linear-gradient(135deg, #182136 0%, #1c2740 100%);
    }

    [data-theme="dark"] .hero-section {
        background: linear-gradient(135deg, #16213a 0%, #16233c 45%, #14283c 100%) !important;
    }

    [data-theme="dark"] .feature-media {
        background: linear-gradient(135deg, #16213a 0%, #16233c 50%, #14283c 100%);
    }

    [data-theme="dark"] .feature-row:hover {
        border-color: #33507d;
    }

    [data-theme="dark"] .footer-logo-badge {
        background: #e8eef8;
    }

    /* Forms and buttons */
    [data-theme="dark"] .form-control,
    [data-theme="dark"] .form-select,
    [data-theme="dark"] .input-group-text {
        background: #101828;
        border-color: var(--border-strong);
        color: var(--text);
    }

        [data-theme="dark"] .form-control::placeholder {
            color: #64748b;
        }

        [data-theme="dark"] .form-control:focus,
        [data-theme="dark"] .form-select:focus {
            background: #101828;
            border-color: var(--brand-primary);
            box-shadow: 0 0 0 3px rgba(76, 155, 245, 0.18);
            color: var(--text);
        }

    [data-theme="dark"] .form-check-input {
        background-color: #101828;
        border-color: var(--border-strong);
    }

        [data-theme="dark"] .form-check-input:checked {
            background-color: var(--brand-primary);
            border-color: var(--brand-primary);
        }

    [data-theme="dark"] .btn-brand {
        background: var(--brand-primary);
        color: #08101f;
    }

        [data-theme="dark"] .btn-brand:hover {
            background: #6fadf8;
            color: #08101f;
        }

    [data-theme="dark"] .btn-outline-secondary {
        background: var(--surface);
        border-color: var(--border-strong);
        color: var(--text-muted);
    }

        [data-theme="dark"] .btn-outline-secondary:hover {
            background: var(--brand-bg);
            color: var(--text);
        }

    [data-theme="dark"] .btn-outline-danger {
        background: var(--surface);
        border-color: #7f2230;
        color: #f2808f;
    }

        [data-theme="dark"] .btn-outline-danger:hover {
            background: #b3243a;
            border-color: #b3243a;
            color: #fff;
        }

    /* Feedback surfaces */
    [data-theme="dark"] .alert {
        border-color: var(--border);
    }

    [data-theme="dark"] .alert-success {
        background: #14301f;
        border-color: #1f6b3f;
        color: #86e0ab;
    }

    [data-theme="dark"] .alert-danger {
        background: #331319;
        border-color: #7f2230;
        color: #f2a1ac;
    }

    [data-theme="dark"] .practice-banner {
        background: #33270d !important;
        border-color: #7a5a12 !important;
        color: #f0cf85 !important;
    }

    [data-theme="dark"] .modal-content {
        background: var(--surface);
        color: var(--text);
    }

    [data-theme="dark"] .btn-close {
        filter: invert(1) grayscale(100%) brightness(200%);
    }

    [data-theme="dark"] .list-group-item {
        background: var(--surface);
        border-color: var(--border);
        color: var(--text);
    }

        [data-theme="dark"] .list-group-item.bg-light {
            background: #1a2334 !important;
        }

    /* Chat */
    [data-theme="dark"] .chat-window,
    [data-theme="dark"] .chat-messages,
    [data-theme="dark"] .chat-input-bar {
        background: var(--surface);
    }

    [data-theme="dark"] .chat-bubble.assistant {
        background: #1a2334;
        border-color: var(--border);
        color: var(--text);
    }

        [data-theme="dark"] .chat-bubble.assistant strong {
            color: var(--brand-dark);
        }

    [data-theme="dark"] .chat-bubble.user {
        color: #08101f;
    }

    [data-theme="dark"] .suggestion-chip,
    [data-theme="dark"] .filter-chip,
    [data-theme="dark"] .slot-btn,
    [data-theme="dark"] .practice-item {
        background: var(--surface);
        border-color: var(--border-strong);
        color: var(--text-muted);
    }

    [data-theme="dark"] .slot-btn,
    [data-theme="dark"] .practice-item {
        color: var(--text);
    }

        [data-theme="dark"] .slot-btn:hover,
        [data-theme="dark"] .suggestion-chip:hover,
        [data-theme="dark"] .filter-chip:hover {
            background: var(--brand-bg);
            border-color: var(--brand-primary);
            color: var(--brand-primary);
        }

    [data-theme="dark"] .practice-name {
        color: var(--text);
    }

    /* Google Maps stays light, so keep its frame neutral */
    [data-theme="dark"] .map-canvas {
        background: #1a2334;
        border-color: var(--border);
    }

    [data-theme="dark"] .iw-title,
    [data-theme="dark"] .iw-meta {
        color: #0f172a;
    }

    /* Scrollbar */
    [data-theme="dark"] ::-webkit-scrollbar-thumb {
        background: #33415e;
        border-color: #0d1424;
    }

        [data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
            background: #46587d;
        }

/* Smooth the switch, but not on every hover transition */
html[data-theme] body {
    transition: background-color 0.25s ease, color 0.25s ease;
}
/* html itself keeps the light background otherwise, which shows on iOS overscroll */
[data-theme="dark"] {
    background: #0d1424;
}