/* DoorBell — shared base styles (identical across all three portals).
 * Portal-specific primaries/tokens live in <portal>.css, loaded after this file.
 * Extracted from header.php inline <style> blocks — verified byte-identical
 * rule-by-rule (not line-by-line) across all three portals before extraction.
 */

*, *::before, *::after { box-sizing: border-box; }

.alert-danger  { background: rgba(15,23,42,.05); color: #212529; }

.alert-success { background: rgba(var(--primary-rgb), .10); color: var(--primary); }

.alert-warning { background: rgba(15,23,42,.05); color: #212529; }

.btn-danger  { background: #212529; border-color: #212529; }

.btn-danger:hover  { background: #212529; border-color: #212529; }

.btn-menu {
      background: none; border: none; padding: 4px 6px; cursor: pointer;
      color: var(--ink-secondary); font-size: 1.25rem; line-height: 1;
      border-radius: var(--radius-sm);
      display: flex; align-items: center; justify-content: center;
    }

.btn-menu:hover { background: var(--page-bg); }

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

.btn-success { background: var(--primary); border-color: var(--primary); }

.btn-success:hover { background: var(--primary); border-color: var(--primary); }

.card { border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: none; }

.card.shadow-sm { box-shadow: none !important; }

.main-content { flex: 1; overflow-x: hidden; min-width: 0; }

.mobile-brand {
      display: flex; align-items: center; gap: 8px;
      font-weight: 700; font-size: 0.9375rem; color: var(--ink);
      text-decoration: none;
    }

.offcanvas-sidebar { width: var(--sidebar-width) !important; background: var(--sidebar-bg) !important; }

.offcanvas-sidebar .offcanvas-header { padding: 16px 16px 12px; border-bottom: 1px solid rgba(255,255,255,.07); }

.sidebar {
      min-height: 100vh;
      background: var(--sidebar-bg);
      width: var(--sidebar-width);
      flex-shrink: 0;
      display: flex;
      flex-direction: column;
    }

.sidebar .nav-link {
      display: flex;
      align-items: center;
      gap: 10px;
      color: rgba(15,23,42,.52);
      border-radius: var(--radius-md);
      padding: 8px 12px;
      font-size: 0.875rem;
      font-weight: 500;
      min-height: 40px;
      transition: background 150ms, color 150ms;
    }

.sidebar .nav-link i { width: 16px; text-align: center; flex-shrink: 0; font-size: 0.9rem; }

.sidebar .nav-link.active { background: rgba(255,255,255,.1); color: #fff; }

.sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: rgba(15,23,42,.12); }

.sidebar-brand {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 20px 16px 16px;
      font-size: 1.0rem;
      font-weight: 700;
      color: #fff;
      text-decoration: none;
      letter-spacing: -0.01em;
    }

@media (max-width: 767.98px) { .sidebar { display: none !important; } }

/* "More" group in the sidebar / drawer: a nav-link styled button that opens a collapsed list */
.nav-more-toggle { width: 100%; background: none; border: 0; text-align: left; }
.nav-more-toggle .chev { margin-left: auto; font-size: .7rem; transition: transform 150ms; }
.nav-more-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.nav-more-toggle[aria-expanded="true"] { color: rgba(15,23,42,.12); }
.nav-more { padding-left: 6px; border-left: 1px solid rgba(255,255,255,.08); margin-left: 12px; }


body {
      font-family: 'Inter', system-ui, sans-serif;
      font-size: 0.9375rem;
      background: var(--page-bg);
      color: var(--ink);
      -webkit-font-smoothing: antialiased;
    }

textarea.form-control { height: auto; }

/* ── UX hardening (2026-10-06) ─────────────────────────────────────────────
 * Touch targets: on coarse pointers every control is at least 44px tall and
 * icon-only buttons are 44×44, with 8px between adjacent actions. */
@media (pointer: coarse) {
  .form-control, .form-select, .btn:not(.btn-close) { min-height: 44px; }
  .btn-sm, .form-control-sm, .form-select-sm { min-height: 44px; padding-top: .5rem; padding-bottom: .5rem; }
  .btn-icon, .btn-sm[aria-label], .btn-sm[title] { min-width: 44px; }
  .table td .btn + .btn, .table td form + .btn, .table td .btn + form { margin-left: 8px; }
  .nav-link, .dropdown-item { min-height: 44px; display: flex; align-items: center; }
}

/* Progress stepper (booking lifecycle, sign-up flow) */
.stepper { display: flex; gap: 0; list-style: none; padding: 0; margin: 0; counter-reset: step; }
.stepper li { flex: 1; position: relative; text-align: center; font-size: .75rem; color: var(--ink-muted, rgba(15,23,42,.64)); padding-top: 30px; }
.stepper li::before {
  content: counter(step); counter-increment: step;
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 24px; height: 24px; border-radius: 50%; background: rgba(15,23,42,.12); color: rgba(15,23,42,.72);
  font-weight: 700; font-size: .7rem; display: flex; align-items: center; justify-content: center; z-index: 1;
}
.stepper li::after { content: ""; position: absolute; top: 12px; left: 50%; width: 100%; height: 2px; background: rgba(15,23,42,.12); }
.stepper li:last-child::after { display: none; }
.stepper li.done { color: var(--primary); }
.stepper li.done::before { content: "\2713"; background: var(--primary); color: #fff; }
.stepper li.done::after { background: var(--primary); }
.stepper li.current { color: var(--ink, #0f172a); font-weight: 600; }
.stepper li.current::before { background: var(--primary); color: #fff; box-shadow: 0 0 0 4px rgba(var(--primary-rgb), .15); }
.stepper li.failed::before { content: "\00d7"; background: #212529; color: #fff; }
.stepper.compact li { font-size: .7rem; padding-top: 28px; }
@media (max-width: 575.98px) { .stepper li span.lbl-long { display: none; } }

/* Onboarding checklist */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(15,23,42,.05); font-size: .9rem; }
.checklist li:last-child { border-bottom: none; }
.checklist .tick { width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; border: 2px solid rgba(15,23,42,.24); color: transparent; margin-top: 1px; }
.checklist li.done .tick { background: var(--primary); border-color: var(--primary); color: #fff; }
.checklist li.done .lbl { color: rgba(15,23,42,.64); text-decoration: line-through; }
.checklist li.next .tick { border-color: var(--primary); }
.checklist li.next .lbl { font-weight: 600; }
.progress-thin { height: 6px; border-radius: 9999px; background: rgba(15,23,42,.12); overflow: hidden; }
.progress-thin > div { height: 100%; background: var(--primary); border-radius: 9999px; transition: width 300ms; }

/* Sticky mobile action bar (listing page) */
.sticky-action { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; background: #fff; border-top: 1px solid rgba(15,23,42,.12); padding: .6rem 1rem calc(.6rem + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(15,23,42,.08); }
@media (min-width: 992px) { .sticky-action { display: none !important; } }
body.has-sticky-action { padding-bottom: 80px; }
@media (min-width: 992px) { body.has-sticky-action { padding-bottom: 0; } }

/* Step hint under page titles */
.step-hint { font-size: .8125rem; color: rgba(15,23,42,.64); display: inline-flex; align-items: center; gap: 6px; }
.step-hint .pill { background: rgba(var(--primary-rgb), .10); color: var(--primary); border-radius: 9999px; padding: 2px 10px; font-weight: 600; font-size: .75rem; }

/* ── Accessibility baseline ───────────────────────────────────────────────── */
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 2000; background: #0f172a; color: #fff; padding: 10px 14px; border-radius: 8px; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 8px; outline: 3px solid rgba(var(--primary-rgb), .10); }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
/* Submit feedback */
.btn[aria-busy="true"] { position: relative; pointer-events: none; opacity: .85; }
.btn[aria-busy="true"] .spinner-border { width: 1rem; height: 1rem; border-width: .15em; margin-right: .5rem; vertical-align: -.15em; }

/* Phones: data tables stack into one compact card per row (footer.php copies each header into
   data-label). The first column is the row title; the others are label/value lines; a trailing
   action cell becomes a full-width button. Opt out with .table-keep. */
@media (max-width: 767.98px) {
  .table-responsive > .table:not(.table-keep) thead { position: absolute; left: -9999px; }
  .table-responsive > .table:not(.table-keep), .table-responsive > .table:not(.table-keep) tbody,
  .table-responsive > .table:not(.table-keep) tr, .table-responsive > .table:not(.table-keep) td { display: block; width: 100%; }
  .table-responsive > .table:not(.table-keep) tr { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .6rem .75rem .5rem; margin-bottom: .5rem; background: #fff; }
  .table-responsive > .table:not(.table-keep) td { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .15rem .75rem; border: 0; padding: .2rem 0; text-align: right; font-size: .8125rem; line-height: 1.4; min-width: 0; overflow-wrap: anywhere; }
  .table-responsive > .table:not(.table-keep) td > * { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
  .table-responsive > .table:not(.table-keep) td[data-label]::before { content: attr(data-label); font-size: .6875rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: rgba(15,23,42,.52); text-align: left; flex-shrink: 0; }
  .table-responsive > .table:not(.table-keep) td:first-child { display: block; text-align: left; font-size: .9375rem; font-weight: 600; padding: 0 0 .35rem; margin-bottom: .3rem; border-bottom: 1px solid rgba(15,23,42,.05); }
  .table-responsive > .table:not(.table-keep) td:first-child::before { display: none; }
  .table-responsive > .table:not(.table-keep) td:last-child:has(.btn) { display: block; padding-top: .5rem; }
  .table-responsive > .table:not(.table-keep) td:last-child:has(.btn)::before { display: none; }
  .table-responsive > .table:not(.table-keep) td:last-child .btn { width: 100%; justify-content: center; }
  .table-responsive > .table:not(.table-keep) td:last-child form { display: block; }
  .table-responsive > .table:not(.table-keep) td:empty { display: none; }
}
}

/* ── Site-wide UI pieces (2026-10-07) — behaviour lives in assets/js/ui.js ─── */

/* Mobile top bar stays reachable while a long page scrolls */
.mobile-topbar { position: sticky; top: 0; z-index: 1020; }

/* Announcement banner (SITE_BANNER in .env; empty = not rendered) */
.site-banner { background: #0f172a; color: rgba(15,23,42,.03); font-size: .875rem; padding: .5rem 1rem; display: flex; align-items: center; justify-content: center; gap: .75rem; text-align: center; }
.site-banner[hidden] { display: none; }
.site-banner a { color: #fff; font-weight: 600; text-decoration: underline; }
.site-banner .banner-close { background: none; border: 0; color: rgba(15,23,42,.24); padding: 4px 8px; line-height: 1; border-radius: 6px; flex-shrink: 0; }
.site-banner .banner-close:hover { color: #fff; background: rgba(255,255,255,.12); }

/* Floating stack, bottom right: back-to-top above the support button */
.float-stack { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 1025; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.float-stack > * { pointer-events: auto; }
@media (max-width: 991.98px) { body.has-sticky-action .float-stack { bottom: calc(92px + env(safe-area-inset-bottom)); } }
.to-top { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border, rgba(15,23,42,.12)); background: #fff; color: var(--ink, #0f172a); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; box-shadow: 0 4px 14px rgba(15,23,42,.12); transition: background 150ms, transform 150ms; }
.to-top[hidden] { display: none; }
.to-top:hover { background: var(--page-bg, rgba(15,23,42,.03)); transform: translateY(-2px); }
.float-contact { height: 48px; padding: 0 16px; border-radius: 9999px; background: var(--primary); color: #fff; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .875rem; text-decoration: none; box-shadow: 0 6px 18px rgba(15,23,42,.2); transition: background 150ms, transform 150ms; }
.float-contact:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }
.float-contact i { font-size: 1.25rem; }
.float-contact.is-email { background: var(--primary); }
@media (max-width: 575.98px) { .float-contact { width: 48px; padding: 0; justify-content: center; } .float-contact span { position: absolute; left: -9999px; } }

/* Reading progress on long documents (terms, privacy, agreements) */
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1040; background: transparent; pointer-events: none; }
.scroll-progress > div { height: 100%; width: 0; background: var(--primary); }

/* Copy-to-clipboard button next to a reference or link */
.copy-btn { background: none; border: 0; padding: 2px 6px; margin-left: 2px; border-radius: 6px; color: var(--ink-secondary, rgba(15,23,42,.72)); line-height: 1; vertical-align: baseline; }
.copy-btn:hover { background: var(--page-bg, rgba(15,23,42,.05)); color: var(--ink, #0f172a); }
.copy-btn.copied { color: var(--primary); }
@media (pointer: coarse) { .copy-btn { min-width: 44px; min-height: 44px; } }

/* Confirmation modal */
.confirm-modal .modal-content { border: 0; border-radius: var(--radius-xl, 14px); }
.confirm-modal .modal-body { padding: 1.25rem 1.25rem .5rem; font-weight: 500; }
.confirm-modal .modal-footer { border: 0; padding: .75rem 1.25rem 1.25rem; }

/* Print: the document only — no navigation, no controls, no floating pieces */
@media print {
  .sidebar, .offcanvas, .mobile-topbar, .site-nav, footer, .float-stack, .site-banner, .skip-link,
  .sticky-action, .scroll-progress, .no-print, .btn, .copy-btn, .alert-dismissible .btn-close, .modal, .modal-backdrop { display: none !important; }
  body { background: #fff !important; color: #000; font-size: 11pt; padding: 0 !important; }
  .main-content, #main { padding: 0 !important; overflow: visible !important; }
  .card { border: 1px solid rgba(15,23,42,.24) !important; box-shadow: none !important; break-inside: avoid; }
  .table-responsive { overflow: visible !important; }
  tr, img { break-inside: avoid; }
  a[href] { color: inherit; text-decoration: none; }
  @page { margin: 15mm; }
}

/* ── Surfaces: hairline borders, no floating (2026-10-08) ─────────────────────
   Shadows are reserved for things that open above the page: offcanvas, modal, dropdown,
   sticky action bar, floating buttons. Everything in the page flow sits flat on a 1px border. */
.card, .panel, .stat-card, .action-card, .dispute-card, .dispute-row { border: 1px solid var(--border) !important; box-shadow: none !important; border-radius: var(--radius-md) !important; background: #fff; }
.card:hover, .action-card:hover, .dispute-card:hover, .dispute-row:hover { box-shadow: none !important; transform: none !important; }
a.action-card:hover, a.card:hover { border-color: var(--border-strong, rgba(15,23,42,.24)) !important; }
.badge, .btn-sm, .form-control-sm, .form-select-sm { border-radius: var(--radius-sm) !important; }

/* Metrics: one hero number per page, then a single row of small secondary numbers */
.metric-hero { margin: 2px 0 14px; }
.metric-hero .metric-label { font-size: .8125rem; font-weight: 500; color: rgba(15,23,42,.64); }
.metric-hero .metric-value { display: block; font-size: 2.75rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; color: var(--ink, #0f172a); text-decoration: none; }
.metric-hero a.metric-value:hover { color: var(--primary, #0f172a); }
.metric-hero .metric-sub { font-size: .8125rem; color: rgba(15,23,42,.64); margin-top: 4px; }
.metric-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 20px; }
.metric { background: #fff; padding: 10px 14px; display: block; color: inherit; text-decoration: none; min-width: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-right: -1px; margin-bottom: -1px; }
a.metric:hover { background: rgba(15,23,42,.03); color: inherit; }
.metric .metric-value { font-size: 1.125rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; color: var(--ink, #0f172a); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric .metric-label { font-size: .75rem; color: rgba(15,23,42,.64); margin-top: 1px; }
@media (max-width: 575.98px) {
  .metric-hero .metric-value { font-size: 2.25rem; }
  .metric-row { grid-template-columns: repeat(2, 1fr); }
  .metric-row > .metric:last-child:nth-child(odd) { grid-column: span 2; }
}
/* Pages that still use the old stat tiles: drop the icon square, flatten the tile */
.stat-card { padding: 10px 14px !important; gap: 0 !important; }
.stat-card .stat-icon, .stat-card .stat-icon-wrap { display: none !important; }
.stat-card .stat-value { font-size: 1.125rem !important; }

/* ── Responsive hardening (2026-10-08 width sweep 320–1920px) ───────────────────────────
   Flex children may shrink and long tokens (emails, references) wrap; button rows wrap on
   small phones; plain document tables scroll instead of pushing the page wider. */
#main, .main-content { overflow-wrap: anywhere; min-width: 0; }
.d-flex > * { min-width: 0; }
.btn, .badge, .nav-link, .pill { overflow-wrap: normal; }
@media (max-width: 575.98px) {
  .d-flex.gap-2:not(.flex-nowrap):not(.flex-column), .d-flex.gap-3:not(.flex-nowrap):not(.flex-column) { flex-wrap: wrap; }
  table:not(.table) { display: block; max-width: 100%; overflow-x: auto; }
}
@media (pointer: coarse) { .form-check-input { width: 1.25em; height: 1.25em; margin-top: .15em; } }
