/* Tokens and components mirror the clearbridge-2026 WordPress theme
   (assets/css/main.css): .site-nav, .support-hero, .btn, .contact-form-card inputs. */
:root {
  --color-text:         #364152;
  --color-text-muted:   rgba(54,65,82,0.6);
  --color-accent:       #1AA9E7;
  --color-accent-hover: #1591c9;
  --color-grey:         #F3F5F7;
  --color-stroke:       #D9DEE3;
  --color-white:        #ffffff;
  --color-dark:         #192436;
  --color-dark-2:       #233445;
  --color-danger:       #D4453A;
  --color-card:         #f7fafc;
  --border-card:        1px solid rgba(25,36,54,.1);
  --font:               'Poppins', sans-serif;
  --container-max:      1100px;
  --container-px:       48px;
  --radius:             2px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  color: var(--color-text);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}
/* The hero's light blue gradient, pinned to the viewport so it runs
   unbroken behind the hero and the content below it. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(135deg,#DBE8F3 0%,#FCFEFF 34%,#D7EBF7 68%,#F5FBFF 100%);
}
a { color: var(--color-accent); text-decoration: none; transition: color .2s ease, opacity .2s ease; }
p, h1, h2, label, td { overflow-wrap: break-word; }
p { text-wrap: pretty; }
h1, h2 { text-wrap: balance; }

.d-container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-px);
}

/* --- HEADER ---
   Same floating bar as the site's .site-nav in its stuck state: inset 16px
   from the viewport edges, translucent navy with a heavy blur. */
.d-header {
  position: fixed; top: 16px; left: 16px; right: 16px; z-index: 100;
  height: 66px;
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
  padding: 12px;
  background: rgba(25,36,54,.6);
  backdrop-filter: blur(32px); -webkit-backdrop-filter: blur(32px);
}
.d-header__brand { display: flex; align-items: center; gap: 16px; min-width: 0; min-height: 44px; }
.d-header__brand img { height: 24px; width: auto; max-width: 100%; display: block; object-fit: contain; }
.d-header__app {
  padding-left: 16px;
  border-left: 1px solid rgba(255,255,255,.2);
  font-size: 14px; font-weight: 400; color: rgba(255,255,255,.6);
}
.d-header__user { display: flex; align-items: center; gap: 16px; flex-shrink: 0; min-width: 0; font-size: 13px; color: rgba(255,255,255,.75); }
.d-header__user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- PAGE HERO ---
   Same as the site's Customer Support hero (.support-hero on
   .single-post__header--hero): centred breadcrumb, bold title and muted
   sub, over the page gradient on body::before. */
.d-hero {
  position: relative; overflow: hidden;
  padding: 160px 48px 48px; /* clears the 16px + 66px floating header */
}
.d-hero__inner {
  position: relative; z-index: 1;
  max-width: 1000px; width: 100%; margin-inline: auto;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 26px;
}
/* Brand Top Bridge logo (stacked, Clearblue on light): the brand's choice
   for a logo centred on its own. Clearspace is the bridge icon's height, so
   the gap below it (hero gap + margin) is at least that. */
.d-hero__logo { display: block; height: 72px; width: auto; margin-bottom: 8px; }

.d-crumbs {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px;
  font-size: 14px; line-height: 1.3; color: var(--color-text-muted);
}
.d-crumbs a { color: var(--color-text-muted); transition: color .2s ease; }
.d-crumbs__sep { color: rgba(48,55,79,.35); }
.d-crumbs__current { color: var(--color-text); max-width: 24ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-hero__copy { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.d-hero__title {
  font-size: 60px; font-weight: 700; line-height: 1.08; letter-spacing: -0.02em;
  color: var(--color-text); max-width: 18ch; text-wrap: balance;
}
.d-hero__sub { font-size: 18px; line-height: 1.6; color: var(--color-text-muted); max-width: 52ch; text-wrap: balance; }

/* --- LAYOUT --- */
/* White cards straight on the page gradient */
.d-section { min-height: 50vh; }
.d-content { padding: 40px var(--container-px) 72px; }
.d-card {
  background: var(--color-white);
  border: var(--border-card);
  padding: 28px;
  margin-bottom: 24px;
}
.d-card__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.d-card__title { font-size: 22px; font-weight: 400; line-height: 1.15; letter-spacing: -0.02em; }
.d-card__sub { margin-top: 4px; font-size: 14px; line-height: 1.45; color: var(--color-text-muted); }
.d-count { color: var(--color-text-muted); font-weight: 300; }
.d-empty { color: var(--color-text-muted); padding: 32px 0; text-align: center; font-size: 14px; }

/* --- SEGMENTED CONTROL ---
   Square, equal-width segments above the card; the white thumb is positioned
   from --i (active index) and --n (segment count). Leading edge moves first
   and the trailing edge lags, so the thumb stretches across both mid-slide. */
.d-segment {
  --pad: 4px;
  position: relative;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  width: fit-content; max-width: 100%;
  margin: 0 auto 20px;
  padding: var(--pad);
  background: rgba(25,36,54,.08);
  border-radius: var(--radius);
}
.d-segment__thumb {
  position: absolute; top: var(--pad); bottom: var(--pad);
  left:  calc(var(--pad) + (100% - 2 * var(--pad)) * var(--i, 0) / var(--n));
  right: calc(var(--pad) + (100% - 2 * var(--pad)) * (var(--n) - 1 - var(--i, 0)) / var(--n));
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(25,36,54,.08), 0 4px 12px rgba(25,36,54,.1);
  transition: left .32s cubic-bezier(.3,.7,.2,1), right .32s cubic-bezier(.3,.7,.2,1);
}
.d-segment[data-dir="right"] .d-segment__thumb { transition-delay: .1s, 0s; }
.d-segment[data-dir="left"]  .d-segment__thumb { transition-delay: 0s, .1s; }
.d-segment__item {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 26px;
  font-size: 15px; font-weight: 500; white-space: nowrap;
  color: var(--color-text-muted);
  transition: color .25s ease;
}
.d-segment__item.is-active { color: var(--color-text); }
@media (prefers-reduced-motion: reduce) {
  .d-segment__thumb { transition: none; }
}

/* --- PAGER --- */
.d-pager {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 16px; font-size: 13px; color: var(--color-text-muted);
}
.d-pager__nav { display: flex; align-items: center; gap: 12px; }
.d-pager .is-disabled { opacity: .4; pointer-events: none; }

/* --- TABLES --- */
.d-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid rgba(25,36,54,.1); }
.d-table th, .d-table td { text-align: left; padding: 14px 16px; border-bottom: 1px solid rgba(25,36,54,.08); vertical-align: middle; }
.d-table th { font-size: 12px; font-weight: 500; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .04em; background: var(--color-grey); }
.d-table tbody tr:last-child td { border-bottom: none; }
.d-table tbody tr.is-link { cursor: pointer; transition: background-color .2s ease; }
.d-table td a { font-weight: 500; }
.d-table .d-col-actions { width: 1%; text-align: right; white-space: nowrap; }
/* One row on wider screens; wraps on phones (see RESPONSIVE) */
.d-row-actions { display: inline-flex; gap: 8px; justify-content: flex-end; }

.d-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* --- CONFIRM DIALOG --- */
.d-dialog {
  width: min(440px, calc(100vw - 32px));
  margin: auto; padding: 28px;
  border: 1px solid rgba(25,36,54,.1); border-radius: var(--radius);
  color: var(--color-text); background: #fff;
  box-shadow: 0 24px 60px rgba(25,36,54,.25);
}
.d-dialog::backdrop { background: rgba(13,18,28,.55); }
.d-dialog__title { font-size: 22px; font-weight: 400; line-height: 1.15; letter-spacing: -0.02em; }
.d-dialog__body { margin-top: 10px; font-size: 14px; line-height: 1.6; color: var(--color-text-muted); }
.d-dialog__actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.d-dialog__field { margin: 18px 0 0; }
.d-link-cell { font-size: 13px; word-break: break-all; }
.d-cell-contact { font-size: 13px; color: var(--color-text-muted); overflow-wrap: anywhere; }
.d-stack { display: flex; flex-direction: column; gap: 24px; }
/* The single questionnaire link, big enough to read out or check at a glance */
.d-single-link {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px 20px; background: var(--color-grey); border: 1px solid rgba(25,36,54,.08);
}
.d-single-link__url { font-size: 18px; font-weight: 500; overflow-wrap: anywhere; }
.d-link-cell a { font-weight: 400; }

/* --- FORMS (contact-form-card) --- */
.d-field { margin-bottom: 14px; }
.d-field label { display: block; font-size: 13px; font-weight: 500; color: var(--color-text); }
.d-input, .d-select {
  width: 100%; margin-top: 4px; padding: 10px 12px;
  background: #fff; border: 1px solid rgba(25,36,54,.16); border-radius: 0;
  font: 400 14px/1.35 var(--font); color: var(--color-text); outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.d-input:focus, .d-select:focus { border-color: var(--color-accent); box-shadow: 0 0 0 4px rgba(26,169,231,.12); }
.d-select { width: auto; max-width: 100%; margin-top: 0; padding-right: 32px; }

/* Chrome 135+: style the dropdown list itself, so it opens exactly as wide
   as the select and on brand. Other browsers keep their native picker. */
@supports (appearance: base-select) {
  .d-select, .d-select::picker(select) { appearance: base-select; }
  .d-select { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-right: 12px; cursor: pointer; }
  .d-select::picker-icon { color: var(--color-text-muted); transition: rotate .2s ease; }
  .d-select:open::picker-icon { rotate: 180deg; }
  .d-select::picker(select) {
    width: anchor-size(width);
    max-height: min(60vh, 360px);
    margin-top: 4px; padding: 4px 0;
    background: #fff; border: 1px solid rgba(25,36,54,.16); border-radius: var(--radius);
    box-shadow: 0 16px 40px rgba(25,36,54,.18);
  }
  .d-select option {
    padding: 10px 12px; font-size: 14px; line-height: 1.35;
    white-space: normal; overflow-wrap: anywhere; cursor: pointer;
  }
  .d-select option::checkmark { display: none; }
  .d-select option:hover, .d-select option:focus-visible { background: var(--color-grey); outline: none; }
  .d-select option:checked { background: #F5FBFF; color: var(--color-accent-hover); font-weight: 500; }
}
.d-search { width: 260px; margin-top: 0; }
.d-inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-top: 20px; }
.d-inline-form .d-field { flex: 1 1 220px; margin-bottom: 0; }
.d-error { color: var(--color-danger); font-size: 13px; margin-top: 10px; }

/* --- BUTTONS (.btn) --- */
.d-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 24px;
  font-family: var(--font); font-size: 14px; font-weight: 500; line-height: 1.4;
  border: 1px solid var(--color-accent); border-radius: var(--radius);
  background: var(--color-accent); color: #fff;
  cursor: pointer; white-space: nowrap;
  transition: background-color .25s ease, border-color .25s ease, color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.d-btn:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(25,36,54,.15); }
.d-btn:disabled { opacity: .5; pointer-events: none; }
.d-btn--outline { background: transparent; color: var(--color-text); border-color: var(--color-stroke); }
.d-btn--outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
/* Destructive actions only (site signal colour --color-danger) */
.d-btn--danger { background: var(--color-danger); border-color: var(--color-danger); color: #fff; }
.d-btn--danger-outline { background: transparent; color: var(--color-danger); border-color: rgba(212,69,58,.35); }
.d-btn--small { min-height: 40px; padding: 6px 14px; font-size: 13px; }
.d-btn--block { width: 100%; }
.d-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.d-btn:focus-visible, .d-segment__item:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* Hover only where a pointer can hover, so a tap on a phone doesn't leave a
   button lifted or highlighted */
@media (hover: hover) {
  a:hover { color: var(--color-accent-hover); }
  .d-crumbs a:hover { color: var(--color-accent); }
  .d-segment__item:hover { color: var(--color-text); }
  .d-table tbody tr.is-link:hover { background: #F5FBFF; }
  .d-btn:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); color: #fff; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(25,36,54,.18); }
  .d-btn--outline:hover, .d-btn--outline-light:hover { background: var(--color-accent); border-color: var(--color-accent); }
  .d-btn--danger:hover { background: #b93a30; border-color: #b93a30; }
  .d-btn--danger-outline:hover { background: var(--color-danger); border-color: var(--color-danger); color: #fff; }
  .d-back:hover span { transform: translateX(-3px); }
  .d-to-top:hover { background: var(--color-accent-hover); }
}

/* --- LOGIN --- */
/* Pulled up into the hero's bottom padding so it sits closer to the sub */
.d-login { max-width: 420px; margin: -32px auto 0; }
/* No nav bar, so the hero drops its header clearance and the page is
   centred in a single screen: no scrolling to reach the Log in button. */
.is-login .d-header { display: none; }
.is-login #app {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center;
}
.is-login .d-hero { padding-top: 32px; }
.is-login .d-section { min-height: 0; }
.is-login .d-content { padding-bottom: 32px; }
.is-login .d-login { margin-bottom: 0; }

/* --- SUBMISSION DETAIL --- */
.d-back {
  display: flex; width: fit-content; align-items: center; gap: 8px; margin: 0 0 16px;
  font-size: 14px; font-weight: 500; color: var(--color-text);
}
.d-back span { transition: transform .2s ease; }
.d-answers { background: #fff; border: 1px solid rgba(25,36,54,.1); }
.d-answer { padding: 20px 24px; border-bottom: 1px solid rgba(25,36,54,.08); break-inside: avoid; }
.d-answer:last-child { border-bottom: none; }
.d-answer__q span:last-child { text-wrap: pretty; }
.d-answer__q { display: flex; gap: 12px; font-size: 13px; font-weight: 500; color: var(--color-text-muted); margin-bottom: 8px; }
.d-answer__num { color: var(--color-accent); min-width: 20px; }
.d-answer__a { padding-left: 32px; white-space: pre-wrap; word-break: break-word; line-height: 1.6; }
.d-answer__a ul { padding-left: 18px; }
.d-answer__a li::marker { color: var(--color-accent); }
.d-answer__a--empty { color: var(--color-text-muted); font-style: italic; }

/* --- BACK TO TOP ---
   Copied from the site's .back-to-top. The site sits it at bottom:92px to
   clear its click-to-call button; there's no call button here, so 32px. */
.d-to-top {
  position: fixed; right: 32px; bottom: 32px; z-index: 200;
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-accent); color: #fff; border: none; cursor: pointer;
  box-shadow: 0 6px 20px rgba(25,36,54,.25);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s, background .18s;
}
.d-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }

/* --- TOAST --- */
.d-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--color-dark); color: #fff; font-size: 13px;
  width: max-content; max-width: calc(100vw - 32px); text-align: center;
  padding: 12px 20px; border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(25,36,54,.18);
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.d-toast.is-visible { opacity: 1; }

/* Holds the PDF for the print dialog. Kept rendered (not display:none)
   so the browser's PDF viewer actually loads it. */
.d-print-frame {
  position: fixed; right: 0; bottom: 0;
  width: 1px; height: 1px;
  border: 0; opacity: 0; pointer-events: none;
}

/* --- RESPONSIVE --- */
/* Touch screens and small windows: 40px+ tap targets, and 16px inputs so
   iOS doesn't zoom in on focus */
@media (pointer: coarse), (max-width: 768px) {
  .d-btn { min-height: 44px; }
  .d-btn--small { padding: 8px 16px; }
  .d-input, .d-select { min-height: 44px; font-size: 16px; }
}

@media (max-width: 768px) {
  :root { --container-px: 16px; }
  .d-header { gap: 16px; }
  .d-header__app { display: none; }
  .d-header__user span { display: none; }
  .d-hero { padding: 140px 24px 40px; }
  .d-hero__title { font-size: 40px; }
  .d-hero__sub { font-size: 16px; }
  .d-card { padding: 20px 16px; }
  .d-card__head > div { flex: 1 1 100%; }
  .d-table th, .d-table td { padding: 12px 10px; }
  .d-hide-mobile { display: none; }
  .d-search, .d-select { width: 100%; }
  .d-segment__item { padding: 10px 18px; font-size: 14px; }
  .d-to-top { right: 20px; bottom: 20px; width: 44px; height: 44px; }
  .d-answer { padding: 16px; }
  .d-answer__a { padding-left: 0; }
  .d-pager { justify-content: center; text-align: center; }
}

/* Phones: each table row becomes a stacked block (name, details, then the
   button) so nothing is cut off and the page never scrolls sideways */
@media (max-width: 640px) {
  .d-table, .d-table tbody, .d-table tr, .d-table td { display: block; width: 100%; }
  .d-table { border: 0; background: none; }
  .d-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .d-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "main actions" "meta actions";
    align-items: center; gap: 2px 12px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(25,36,54,.08);
  }
  .d-table tbody tr:first-child { padding-top: 0; }
  .d-table tbody tr:last-child { border-bottom: 0; padding-bottom: 0; }
  .d-table tbody tr.is-link:hover { background: none; }
  .d-table td { padding: 0; border: 0; }
  .d-table td.d-hide-mobile { display: none; }
  .d-table .d-cell-main { grid-area: main; font-weight: 500; }
  .d-table .d-cell-meta { grid-area: meta; font-size: 13px; color: var(--color-text-muted); }
  .d-table .d-cell-meta[data-label]::before { content: attr(data-label) ": "; }
  .d-table .d-col-actions { grid-area: actions; width: auto; }
  /* Rows with several buttons (customers): buttons go under the text */
  .d-table tbody tr.d-row--stack { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "meta" "actions"; }
  .d-table tr.d-row--stack .d-col-actions { margin-top: 10px; text-align: left; }
  .d-row--stack .d-row-actions { flex-wrap: wrap; justify-content: flex-start; }
}

@media (max-width: 480px) {
  .d-hero { padding: 132px 16px 36px; }
  .d-hero__inner, .d-hero__copy { gap: 14px; }
  .d-hero__logo { height: 60px; margin-bottom: 14px; }
  .d-hero__title { font-size: 34px; }
  .d-hero__sub { font-size: 15px; }
  /* Detail page buttons: one per row, full width */
  .d-hero .d-actions { flex-direction: column; align-self: stretch; }
  .d-hero .d-actions .d-btn { width: 100%; }
  .d-inline-form .d-btn { width: 100%; }
  .d-segment { width: 100%; }
  .d-segment__item { padding: 10px 8px; }
}

/* Narrow phones: the button goes under the text instead of beside it */
@media (max-width: 400px) {
  .d-header { left: 10px; right: 10px; gap: 8px; padding: 10px; }
  .d-header__brand img { height: 21px; }
  .d-table tbody tr { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "meta" "actions"; }
  .d-table .d-col-actions { margin-top: 10px; text-align: left; }
}
@media (max-width: 320px) {
  .d-header__brand img { height: 18px; }
  .d-hero__title { font-size: 30px; }
  .d-card { padding: 16px 12px; }
}

/* --- PRINT / SAVE AS PDF --- */
@media print {
  body { background: #fff; }
  body::before { display: none; }
  .d-header, .d-crumbs, .d-actions, .d-back, .d-toast, .d-to-top { display: none !important; }
  .d-hero { background: #fff; padding: 0 0 16px; }
  .d-hero__title { font-size: 32px; max-width: none; }
  .d-section { background: #fff; min-height: 0; }
  .d-container { padding-inline: 0; max-width: none; }
  .d-content { padding: 0; }
  .d-answers { border: none; }
  .d-answer { padding: 12px 0; }
  .d-answer__a { padding-left: 32px; }
}
