/* ==========================================================================
   BDO Collaboration Portal — base stylesheet
   Brand colors sampled from img/bdo_logo_color.png. Sharp corners throughout
   (no border-radius), light mode only.
   ========================================================================== */

:root {
    --bdo-blue: #204399;
    --bdo-blue-dark: #152e6b;
    --bdo-red: #ec1b3c;
    --bdo-red-dark: #c31530;

    --bg: #f2f3f6;
    --surface: #ffffff;
    --border: #dde1e8;
    --border-strong: #c7ccd6;

    --text: #171a21;
    --text-muted: #5c6270;
    --text-faint: #8a8f9c;

    --success-bg: #e7f6ec;
    --success-text: #1c7a3c;
    --error-bg: #fdecee;
    --error-text: #b3122b;
    --warning-bg: #fff6e0;
    --warning-text: #8a6100;
    --info-bg: #e8edfb;
    --info-text: var(--bdo-blue);

    --shadow-sm: 0 1px 2px rgba(23, 26, 33, 0.06);
    --shadow-md: 0 4px 16px rgba(23, 26, 33, 0.12);
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

/* The [hidden] attribute loses to any class that sets its own `display`
   (equal specificity, author styles win) — force it to actually hide. */
[hidden] {
    display: none !important;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.5;
    overflow-x: hidden;
}

a {
    color: var(--bdo-blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3, h4 {
    margin: 0 0 0.5em 0;
    font-weight: 700;
    color: var(--text);
}

p {
    margin: 0 0 1em 0;
}

img {
    max-width: 100%;
}

/* ---------- Topbar / navigation ---------- */

.topbar {
    background: var(--surface);
    border-bottom: 3px solid var(--bdo-red);
    box-shadow: var(--shadow-sm);
}

.topbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 32px;
    height: 64px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}

.brand:hover {
    text-decoration: none;
}

.brand-logo {
    height: 28px;
    width: auto;
}

.brand-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--bdo-blue);
    letter-spacing: 0.02em;
}

.main-nav {
    display: flex;
    gap: 4px;
    flex: 1;
}

.nav-link {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
    padding: 10px 14px;
    border-bottom: 3px solid transparent;
    margin-bottom: -3px;
}

.nav-link:hover {
    color: var(--bdo-blue);
    text-decoration: none;
}

.nav-link.active {
    color: var(--bdo-blue);
    border-bottom-color: var(--bdo-red);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    text-align: right;
    line-height: 1.3;
    margin-right: 6px;
}

.user-info-name {
    font-weight: 700;
    font-size: 13px;
    color: var(--text);
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-info-meta {
    font-size: 11px;
    color: var(--text-muted);
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inline-form {
    display: inline;
}

.link-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.link-btn:hover {
    color: var(--bdo-red);
    text-decoration: underline;
}

/* ---------- Page layout ---------- */

.page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px 64px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 24px;
}

.page-header-sub {
    color: var(--text-muted);
    margin-top: -8px;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 0;
    cursor: pointer;
    line-height: 1.2;
    white-space: nowrap;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--bdo-blue);
    color: #fff;
}

.btn-primary:hover {
    background: var(--bdo-blue-dark);
    color: #fff;
}

.btn-accent {
    background: var(--bdo-red);
    color: #fff;
}

.btn-accent:hover {
    background: var(--bdo-red-dark);
    color: #fff;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border-strong);
}

.btn-secondary:hover {
    background: var(--bg);
    color: var(--text);
}

.btn-danger {
    background: var(--surface);
    color: var(--error-text);
    border-color: var(--error-text);
}

.btn-danger:hover {
    background: var(--error-bg);
    color: var(--error-text);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Topbar icon buttons: help "?", feedback, settings, log out */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--bdo-blue);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    border-radius: 0;
    flex-shrink: 0;
    text-decoration: none;
}

.icon-btn:hover {
    background: var(--bdo-blue);
    color: #fff;
    border-color: var(--bdo-blue);
    text-decoration: none;
}

.icon-btn svg {
    width: 16px;
    height: 16px;
}

/* ---------- Cards / surfaces ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0;
}

.card-pad {
    padding: 24px;
}

.stat-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--bdo-blue);
    padding: 18px 20px;
}

.stat-tile .stat-label {
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.stat-tile .stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--bdo-blue);
}

/* ---------- Forms ---------- */

.form-group {
    margin-bottom: 18px;
}

.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.form-row > .form-group {
    flex: 1;
    min-width: 180px;
}

label, .form-label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 6px;
}

.form-input, input[type="text"], input[type="email"], input[type="password"],
input[type="number"], select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 0;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
}

select[multiple] {
    min-height: 110px;
}

.form-input:focus, input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--bdo-blue);
    box-shadow: 0 0 0 2px rgba(32, 67, 153, 0.15);
}

textarea {
    resize: vertical;
}

.form-check {
    width: auto;
    margin-right: 8px;
}

.form-check-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check-row label {
    margin-bottom: 0;
    font-weight: 500;
}

.help-text {
    color: var(--text-faint);
    font-size: 12px;
    margin-top: 4px;
}

.switch-row {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 0;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex: none;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    inset: 0;
    background: var(--border-strong);
    border-radius: 22px;
    transition: background 0.15s;
}

.switch-slider::before {
    content: "";
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.15s;
}

.switch input:checked + .switch-slider {
    background: var(--bdo-blue);
}

.switch input:checked + .switch-slider::before {
    transform: translateX(18px);
}

.switch input:focus-visible + .switch-slider {
    outline: 2px solid var(--bdo-blue);
    outline-offset: 2px;
}

.field-errors, ul.errorlist {
    color: var(--error-text);
    font-size: 13px;
    margin: 4px 0 0 0;
    padding: 0;
    list-style: none;
}

.non-field-errors {
    background: var(--error-bg);
    color: var(--error-text);
    padding: 10px 14px;
    margin-bottom: 16px;
    border-left: 3px solid var(--error-text);
}

.banner-warning {
    background: var(--bdo-red);
    color: #fff;
    padding: 12px 16px;
    margin-bottom: 18px;
    font-size: 13px;
    line-height: 1.6;
    border-left: 4px solid var(--bdo-red-dark);
}

.banner-warning code {
    background: rgba(255, 255, 255, 0.2);
    padding: 1px 5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.banner-info {
    background: var(--info-bg);
    color: var(--text);
    padding: 12px 16px;
    margin-bottom: 18px;
    font-size: 13px;
    line-height: 1.6;
    border-left: 4px solid var(--bdo-blue);
}

.banner-info code {
    background: rgba(32, 67, 153, 0.12);
    padding: 1px 5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    border: 1px solid var(--border);
    padding: 12px;
    max-height: 220px;
    overflow-y: auto;
}

.checkbox-grid label {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
}

.checkbox-filter-search {
    margin-bottom: 8px;
}

.checkbox-filter .checkbox-grid {
    grid-template-columns: 1fr;
    max-height: 180px;
}

.checkbox-filter-item {
    font-size: 13px;
}

/* ---------- Messages ---------- */

.messages {
    list-style: none;
    margin: 0 0 20px 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message {
    padding: 12px 16px;
    border-left: 4px solid var(--text-faint);
    font-size: 14px;
}

.message-success {
    background: var(--success-bg);
    color: var(--success-text);
    border-left-color: var(--success-text);
}

.message-error {
    background: var(--error-bg);
    color: var(--error-text);
    border-left-color: var(--error-text);
}

.message-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
    border-left-color: var(--warning-text);
}

.message-info {
    background: var(--info-bg);
    color: var(--info-text);
    border-left-color: var(--bdo-blue);
}

/* ---------- Modal / dialog ---------- */

dialog.modal {
    border: 1px solid var(--border-strong);
    border-radius: 0;
    padding: 0;
    width: min(640px, 92vw);
    max-height: 88vh;
    box-shadow: var(--shadow-md);
}

dialog.modal::backdrop {
    background: rgba(15, 18, 25, 0.55);
}

dialog.modal-lg {
    width: min(880px, 94vw);
}

.modal-content {
    display: flex;
    flex-direction: column;
    max-height: 88vh;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-header h2, .modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
}

.modal-close:hover {
    color: var(--bdo-red);
}

.modal-body {
    padding: 22px;
    overflow-y: auto;
}

.modal-body ul {
    padding-left: 20px;
}

.modal-body li {
    margin-bottom: 8px;
}

/* ---------- Badges / tags ---------- */

.badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 9px;
    background: var(--info-bg);
    color: var(--bdo-blue);
    border: 1px solid rgba(32, 67, 153, 0.2);
}

.badge-muted {
    background: var(--bg);
    color: var(--text-muted);
    border-color: var(--border);
}

.tag-input-row {
    display: flex;
    gap: 8px;
}

.tag-input-row .form-input {
    flex: 1;
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.chip-list:empty {
    margin-top: 0;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding-right: 4px;
}

.chip-remove {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    padding: 2px 4px;
}

.chip-remove:hover {
    color: var(--bdo-red);
}

.rating {
    color: var(--bdo-red);
    font-weight: 700;
    white-space: nowrap;
}

.rating .stars {
    letter-spacing: 1px;
}

/* ---------- Directory: filters + grid ---------- */

.directory-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    align-items: start;
}

.filter-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 20px;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.filter-panel h3 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.filter-panel-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    margin: 0 0 16px 0;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.filter-panel-toggle h3 {
    margin-bottom: 0;
}

.filter-toggle-chevron {
    flex-shrink: 0;
    color: var(--bdo-blue);
    transition: transform 0.15s ease;
}

.filter-panel-toggle[aria-expanded="true"] .filter-toggle-chevron {
    transform: rotate(180deg);
}

/* Filters only collapse on phones — on tablet/desktop the panel is always
   visible and the toggle button is inert, just a plain "Filters" heading. */
@media (min-width: 601px) {
    .filter-panel-body[hidden] {
        display: block !important;
    }
    .filter-panel-toggle {
        cursor: default;
        pointer-events: none;
    }
    .filter-toggle-chevron {
        display: none;
    }
}

.results-meta {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 12px;
}

/* ---------- Sort dropdown ---------- */

.sort-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.sort-dropdown {
    position: relative;
    display: inline-block;
}

.sort-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-strong);
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 0;
}

.sort-dropdown-trigger:hover {
    border-color: var(--bdo-blue);
    color: var(--bdo-blue);
}

.sort-dropdown-chevron {
    transition: transform 0.15s ease;
}

.sort-dropdown[data-open] .sort-dropdown-chevron {
    transform: rotate(180deg);
}

.sort-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 210px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 6px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sort-dropdown-option {
    text-align: left;
    background: none;
    border: none;
    font: inherit;
    font-size: 13px;
    color: var(--text);
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 0;
}

.sort-dropdown-option:hover {
    background: var(--bg);
}

.sort-dropdown-option.active {
    background: var(--info-bg);
    color: var(--bdo-blue);
    font-weight: 700;
}

.sort-active-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--info-bg);
    color: var(--bdo-blue);
    border: 1px solid rgba(32, 67, 153, 0.2);
    font-size: 12px;
    font-weight: 600;
    padding: 5px 6px 5px 10px;
}

.sort-chip-clear {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    padding: 2px 4px;
}

.sort-chip-clear:hover {
    color: var(--bdo-red);
}

.consultant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.consultant-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 0;
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.consultant-card:hover {
    border-color: var(--bdo-blue);
    box-shadow: var(--shadow-sm);
}

.consultant-card-photo {
    height: 150px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border);
}

/* Generic default avatar shown wherever a person has no photo on file. */
.avatar-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(180deg, #eceef1 0%, #dde0e6 100%);
    color: #9aa0ac;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

/* An actual person's photo, cropped into the same circular shape/size as the
   initials avatar above so cards look consistent whether or not a photo is on file. */
.avatar-photo {
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.avatar-circle-md, .avatar-photo-md {
    width: 108px;
    height: 108px;
    font-size: 30px;
}

.avatar-circle-lg, .avatar-photo-lg {
    width: 116px;
    height: 116px;
    font-size: 34px;
}

.consultant-card-body {
    padding: 14px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.consultant-card-name {
    font-weight: 700;
    font-size: 15px;
}

.consultant-card-title {
    color: var(--text-muted);
    font-size: 13px;
}

.consultant-card-service-line {
    color: var(--bdo-blue);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.consultant-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-top: auto;
    padding-top: 8px;
}

.consultant-card-rate {
    font-weight: 700;
    color: var(--bdo-blue);
}

.consultant-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.language-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
}

.language-flag {
    font-size: 17px;
    line-height: 1;
    cursor: default;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    padding: 48px 20px;
    border: 1px dashed var(--border-strong);
}

/* ---------- Consultant detail modal ---------- */

.detail-layout {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.detail-photo-col {
    flex-shrink: 0;
}

.detail-main-col {
    flex: 1;
    min-width: 0;
}

.linkedin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: #0a66c2;
    color: #fff;
    flex-shrink: 0;
}

.linkedin-btn:hover {
    background: #004182;
}

.linkedin-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.detail-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.detail-section {
    margin-top: 22px;
}

.detail-section h4 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
    margin-bottom: 10px;
}

.message-preview {
    background: var(--bg);
    border: 1px solid var(--border);
    border-left: 3px solid var(--bdo-blue);
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.reference-item, .review-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.reference-item:last-child, .review-item:last-child {
    border-bottom: none;
}

.review-item[data-consultant-url] {
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
}

.review-item[data-consultant-url]:hover {
    background: var(--bg);
}

/* ---------- Tables ---------- */

.table-scroll {
    width: 100%;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
}

table.data-table th, table.data-table td {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

table.data-table th {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--bg);
}

/* ---------- Tabs ---------- */

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-link {
    flex-shrink: 0;
}

.tab-link {
    padding: 10px 18px;
    font-weight: 600;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
}

.tab-link.active {
    color: var(--bdo-blue);
    border-bottom-color: var(--bdo-red);
}

.tab-link:hover {
    text-decoration: none;
    color: var(--bdo-blue);
}

/* ---------- Auth pages ---------- */

.auth-body {
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-wrap {
    width: 100%;
    max-width: 420px;
}

.auth-brand {
    text-align: center;
    margin-bottom: 20px;
}

.auth-logo {
    height: 60px;
}

.auth-subtitle {
    color: var(--bdo-blue);
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-top: 12px;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--bdo-red);
    padding: 32px;
    box-shadow: var(--shadow-md);
}

.auth-card h1 {
    font-size: 20px;
    margin-bottom: 4px;
}

.auth-card .auth-lead {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 22px;
}

.auth-card a {
    color: var(--bdo-red);
}

.auth-links {
    margin-top: 18px;
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

.auth-legal-links {
    position: fixed;
    right: 20px;
    bottom: 16px;
    font-size: 12px;
    color: var(--text-faint);
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-legal-links a {
    color: var(--text-muted);
}

.auth-legal-links a:hover {
    color: var(--bdo-red);
}

.auth-legal-links-sep {
    color: var(--border-strong);
}

@media (max-width: 600px) {
    .auth-legal-links {
        left: 0;
        right: 0;
        justify-content: center;
    }
}

/* ---------- MFA ---------- */

.mfa-qr {
    display: flex;
    justify-content: center;
    padding: 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    margin-bottom: 16px;
}

.mfa-key {
    text-align: center;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 14px;
    letter-spacing: 0.08em;
    background: var(--bg);
    padding: 8px 12px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
    word-break: break-all;
}

/* ---------- Utility ---------- */

.text-muted { color: var(--text-muted); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

/* ---------- Cookie banner ---------- */

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 500;
    background: var(--text);
    color: #fff;
    border-top: 3px solid var(--bdo-red);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.25);
}

.cookie-banner[hidden] {
    display: none;
}

.cookie-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.cookie-banner-text {
    flex: 1;
    min-width: 260px;
}

.cookie-banner-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}

.cookie-banner-text p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.75);
    max-width: 70ch;
}

.cookie-banner-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.cookie-banner-actions .btn-secondary {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}

.cookie-banner-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ---------- About page ---------- */

.about-hero {
    border-top: 3px solid var(--bdo-red);
}

.about-lead {
    font-size: 16px;
    line-height: 1.7;
    margin: 0;
}

.about-diagram {
    margin-top: 16px;
}

.about-diagram svg {
    width: 100%;
    max-width: 700px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.about-diagram-line {
    stroke: var(--bdo-blue);
    stroke-width: 1.5;
    opacity: 0.45;
}

.about-diagram-line-direct {
    stroke: var(--bdo-red);
    stroke-dasharray: 5 4;
    opacity: 0.7;
}

.about-diagram-hub {
    fill: var(--bdo-blue);
}

.about-diagram-hub-label {
    fill: #fff;
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font-sans);
}

.about-diagram-node {
    fill: var(--bdo-red);
}

.about-diagram-node-label {
    fill: var(--text);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-sans);
}

.about-diagram-caption {
    text-align: center;
    font-size: 13px;
    margin-top: 8px;
}

.about-diagram-swatch {
    display: inline-block;
    width: 20px;
    height: 2px;
    margin-right: 4px;
    vertical-align: middle;
}

.about-diagram-swatch-blue {
    background: var(--bdo-blue);
}

.about-diagram-swatch-red {
    background: var(--bdo-red);
    border-top: 1px dashed var(--bdo-red);
}

.about-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.about-step-number {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bdo-blue);
    color: #fff;
    font-weight: 700;
    margin-bottom: 12px;
}

@media (max-width: 860px) {
    .directory-layout {
        grid-template-columns: 1fr;
    }
    .filter-panel {
        position: static;
        max-height: none;
        overflow-y: visible;
    }
    .topbar-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 16px;
    }
    .main-nav {
        order: 3;
        width: 100%;
        flex-wrap: wrap;
        gap: 2px;
    }
}

/* ---------- Phone-specific compaction ---------- */

@media (max-width: 600px) {
    .topbar-inner {
        padding: 10px 12px;
        gap: 8px 12px;
        justify-content: space-between;
    }
    .brand {
        gap: 6px;
    }
    .brand-logo {
        height: 24px;
    }
    .brand-title {
        display: none;
    }
    .main-nav {
        justify-content: flex-end;
    }
    .nav-link {
        padding: 8px 10px;
        font-size: 13px;
    }
    .topbar-user {
        gap: 4px;
    }
    .user-info {
        margin-right: 2px;
        text-align: left;
    }
    .user-info-name {
        max-width: 110px;
        font-size: 12px;
    }
    .user-info-meta {
        display: none;
    }
    .icon-btn {
        width: 30px;
        height: 30px;
    }
    .icon-btn svg {
        width: 14px;
        height: 14px;
    }
    .page {
        padding: 18px 14px 40px;
    }
    .page-header {
        flex-wrap: wrap;
    }
    .page-header h1 {
        font-size: 20px;
    }
    .directory-layout {
        gap: 16px;
    }
    .filter-panel {
        padding: 16px;
    }
    .consultant-grid {
        gap: 12px;
    }
    .modal-header {
        padding: 14px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .modal-header-actions {
        flex-wrap: wrap;
    }
    .modal-header h2, .modal-header h3 {
        font-size: 16px;
    }
    .modal-body {
        padding: 16px;
    }
    .detail-layout {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .detail-main-col {
        width: 100%;
        text-align: left;
    }
    .detail-photo-col {
        align-self: center;
    }
    .table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table-scroll table.data-table {
        min-width: 640px;
    }
}
