/* BZ-S0 — Shared components in BV's look. Generic only: Page-1-only styles
   belong to S1's page1.css. Width breakpoints: <=640 / 641-980 / >=981 only. */

/* Header / nav */
.topbar{position:sticky;top:0;z-index:20;background:var(--paper);border-bottom:1px solid var(--line)}
.nav{min-height:72px;display:flex;justify-content:space-between;align-items:center;gap:20px}
.brand{display:flex;align-items:center;gap:10px;line-height:1;white-space:nowrap;text-decoration:none}
.brand-logo{height:56px;width:auto;border-radius:10px;flex:none;display:block}
.brand-name{font-family:var(--font-display);font-weight:600;font-size:clamp(1.45rem,3vw,1.8rem);letter-spacing:-.015em;color:var(--ink);white-space:nowrap}
.navlinks{display:flex;gap:6px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.navlinks a{text-decoration:none;padding:8px;border-radius:8px;color:var(--ink-soft);font-size:14px;font-weight:600}
.navlinks a:hover{background:var(--surface-2);color:var(--ink)}
.navlinks a.active{color:var(--amber);box-shadow:inset 0 -2px 0 var(--amber)}
.navlinks .nav-cta{background:var(--teal);color:var(--paper);padding-inline:12px}
.nav-toggle{display:none;align-items:center;justify-content:center;gap:8px;min-width:48px;min-height:48px;padding:9px 12px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);font-weight:700;cursor:pointer}

/* Account menu */
.nav-auth{position:relative}
.account-menu{position:absolute;right:0;top:calc(100% + 8px);min-width:220px;background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);padding:10px;display:grid;gap:4px;z-index:40}
.account-menu a,.account-menu button{display:block;width:100%;text-align:left;background:none;border:0;padding:9px 10px;border-radius:8px;color:var(--ink);text-decoration:none;font-weight:600;cursor:pointer}
.account-menu a:hover,.account-menu button:hover{background:var(--surface-2)}
.account-menu .account-menu-name{padding:9px 10px;font-weight:800;border-bottom:1px solid var(--line)}

/* Buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:48px;padding:11px 18px;border-radius:12px;border:1px solid transparent;text-decoration:none;font-weight:700;cursor:pointer;transition:background .2s,color .2s,transform .2s;background:var(--surface);color:var(--ink)}
.btn:hover{transform:translateY(-1px)}
.btn[disabled]{opacity:.55;cursor:not-allowed;transform:none}
.btn-primary{background:var(--amber);color:var(--paper)}
.btn-primary:hover{background:var(--amber-deep)}
.btn-dark{background:var(--teal);color:var(--paper)}
.btn-dark:hover{background:var(--teal-2)}
.btn-ghost{border-color:var(--line);color:var(--ink);background:transparent}
.btn-ghost:hover{background:var(--surface-2)}
.btn-outline{border-color:var(--line);background:var(--surface);color:var(--ink)}
.btn-danger{background:var(--danger);color:var(--paper)}

/* Cards */
.card{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:22px;box-shadow:var(--shadow)}
.card h3,.card h4{margin-top:0}
.card p{color:var(--ink-soft)}
.card-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}

/* Stat tiles */
.stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.stat-tile{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:18px}
.stat-tile strong{display:block;font-family:var(--font-display);font-size:2rem;line-height:1.05;color:var(--teal)}
.stat-tile span{color:var(--ink-soft);font-size:13px;font-weight:600}

/* Pills / badges */
.pill,.badge{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;background:var(--teal-pale);color:var(--teal);font-size:12px;font-weight:800;line-height:1.4}
.pill-amber,.badge-amber{background:var(--amber-pale);color:var(--amber-deep)}
.pill-danger,.badge-danger{background:var(--danger-pale);color:var(--danger)}

/* Forms + field errors */
label{display:grid;gap:7px;color:var(--ink-soft);font-size:13px;font-weight:700}
input,select,textarea{min-width:0;width:100%;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:9px;padding:10px 11px}
textarea{min-height:110px;resize:vertical}
input[aria-invalid="true"],select[aria-invalid="true"],textarea[aria-invalid="true"]{border-color:var(--danger)}
.field-error{color:var(--danger);font-size:13px;font-weight:600;min-height:1.2em}
.form-error{background:var(--danger-pale);color:var(--danger);border-radius:9px;padding:11px 13px;font-weight:600}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}

/* Dialogs */
dialog{background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);padding:26px;max-width:min(560px,calc(100vw - 32px));width:100%}
dialog::backdrop{background:rgba(0,0,0,.55)}
.dialog-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:14px}
.dialog-close{background:var(--surface-2);border:1px solid var(--line);border-radius:9px;width:40px;height:40px;cursor:pointer;color:var(--ink);font-weight:800}

/* Toasts */
.toast,#kp-toast{position:fixed;left:50%;bottom:26px;transform:translate(-50%,16px);background:var(--surface);color:var(--ink);border:1px solid var(--line);border-left:4px solid var(--teal);border-radius:12px;box-shadow:var(--shadow);padding:13px 18px;font-weight:700;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;z-index:120;max-width:min(520px,calc(100vw - 32px))}
.toast.show,#kp-toast.show{opacity:1;transform:translate(-50%,0);pointer-events:auto}
.toast-error,#kp-toast.toast-error{border-left-color:var(--danger)}

/* Tables */
.table-wrap{overflow-x:auto}
table{width:100%;border-collapse:collapse;background:var(--surface)}
th,td{text-align:left;padding:11px 12px;border-bottom:1px solid var(--line);vertical-align:top}
th{color:var(--ink-soft);font-size:13px;letter-spacing:.04em;text-transform:uppercase}
tbody tr:hover{background:var(--surface-2)}

/* Empty / loading / error states */
.state{border:1px dashed var(--line);border-radius:18px;background:var(--surface-2);padding:28px;text-align:center;color:var(--ink-soft)}
.state strong{display:block;color:var(--ink);font-family:var(--font-display);font-size:1.4rem;margin-bottom:6px}
.state-error{border-color:var(--danger);background:var(--danger-pale);color:var(--ink)}
.state-loading{border-style:solid}
.spinner{display:inline-block;width:22px;height:22px;border-radius:50%;border:3px solid var(--line);border-top-color:var(--teal);animation:kp-spin .8s linear infinite;vertical-align:middle}
@keyframes kp-spin{to{transform:rotate(360deg)}}

@media (max-width:640px){
  .nav{min-height:62px;flex-wrap:wrap;gap:10px 14px}
  .brand{flex:1 1 0;min-width:0;order:1}
  .brand-text{min-width:0}
  .brand-logo{height:46px}
  .brand-name{font-size:1.3rem;white-space:normal}
  .nav-auth{order:2}
  .nav-toggle{display:inline-flex;margin-left:auto;flex:0 0 auto;order:3}
  .navlinks{display:none}
  .navlinks.open,.topbar .navlinks.open{position:absolute;top:calc(100% + 8px);right:14px;left:auto;width:min(264px,calc(100vw - 28px));display:flex;flex-direction:column;align-items:stretch;gap:2px;background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);padding:8px;z-index:60}
  .navlinks.open a{padding:12px 14px;border-radius:9px;font-size:15px;text-align:left}
  .card-grid,.form-grid,.stats-grid{grid-template-columns:1fr}
  dialog{padding:20px}
}
@media (min-width:641px) and (max-width:980px){
  .card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (min-width:981px){
  .card-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}

/* Brand tagline (Care Ambassador batch, Oct 17, 2026): the positioning
   line under the wordmark, on every webpage headliner (AT13). */
.brand-text{display:flex;flex-direction:column;gap:3px;line-height:1.12}
.brand-tag{font-size:.68rem;font-weight:600;letter-spacing:.045em;color:var(--ink-soft);white-space:nowrap}
@media (max-width:640px){.brand-tag{white-space:normal;max-width:17rem}}

/* Turnstile containment (BI, Oct 18, 2026): the Cloudflare widget chooses
   its own width — on phones its success-state bar renders far wider than the
   standard 300px and wider than its form column, spilling out of the contact
   card and stretching the sign-in form. The widget is capped at its column's
   width on every surface; its own box clips anything beyond. */
/* BO (Oct 19, 2026): the widget's box is fixed — above Cloudflare
   flexible's 272px floor, inside every form column — and centered in its
   column; Cloudflare autofits the bar in it. */
/* BQ (Oct 20, 2026): the box is 275px — the width AMANDO and Princess
   agreed (Oct 19) to accommodate the bar's automatic placement. BO shipped
   280px; on AMANDO's Galaxy S26 the rendered bar (success state) outgrew
   that box and its right end was clipped. 275px restores the agreement.
   The width alone does not cure the crop — the drawing itself is ~300px
   wide (see the scale rule below); the two ship together. */
/* BT (Oct 20, 2026) — the 275px box is a PHONE fit only. AMANDO's
   ruling this morning ("Keep it phone-only as built") scoped the scale
   rule below to phone widths, but the box rule itself sat outside any
   media query, so on desktop it still fenced the ~300px drawing into
   275px with no scale rule to save it — his desktop Contact screenshot
   showed the bar's right end (CLOUDFLARE logo, Privacy · Help) cropped
   in the Success state. The base rule is therefore restored to its
   pre-BQ form — as it stood from BI through BN, before BO introduced
   the fixed box — so at desktop widths the holder takes its column
   and the bar renders whole at its natural width. The whole BQ fit
   (275px box + the zoom tiers below) now lives inside the phone
   queries; at <=640px the cascade computes exactly what BQ shipped
   and AMANDO confirmed on his Galaxy S26. */
.cf-turnstile{max-width:100%;overflow:hidden}
.cf-turnstile iframe{display:block;max-width:100%}


/* BQ (Oct 20, 2026) — shrink the DRAWING, not just the box. Measured on
   the live sites (bq-overflow-diagnosis-20261020): the widget's artwork is
   drawn ~300px wide whatever the holder; in a block holder the API's box
   tracks the holder 1:1, so a 275px box crops the drawing's right end
   (CLOUDFLARE logo, Privacy · Help) inside the box. BO's guard here
   targeted `.cf-turnstile iframe` — the current widget renders inside a
   closed shadow root and the document holds no iframe at all, so that rule
   matched nothing at any width; it is replaced, not extended. The rule
   below zooms the box the API actually inserts (the holder's child div):
   at 275/300 = .9167 the box's internal layout space becomes exactly
   300px — the drawing's own width — while the box renders at the holder's
   275px, whole. Pixel-verified at 384 and 360 in the BQ test suite.
   The ≤356px tier covers phones narrow enough that the form column caps
   the holder below 275px (the ground BO's ≤340px guard was meant for):
   at .78 the internal space stays ≥300px down to a ~238px column. */
@media (max-width:640px){.cf-turnstile{width:275px;max-width:100%;margin-inline:auto;overflow:hidden}.cf-turnstile > div{zoom:.9167}}
@media (max-width:356px){.cf-turnstile > div{zoom:.78}}

/* Back to top (BQ, Oct 20, 2026 — AMANDO's request): a floating return-to-top
   arrow for the long public pages. Created by ui.js; pure overlay, never part
   of page layout, so it shifts nothing on phone or desktop. Hidden at the top
   of the page, appears after scrolling (ui.js toggles .show past 400px — the
   same threshold as the dashboards' return-up). On the Ambassadors page ui.js
   also adds .kp-top-hide while the roster strip's arrow/counter row is on
   screen, so this button can never cover those controls. */
#kpSiteTopBtn{position:fixed;right:16px;bottom:calc(20px + env(safe-area-inset-bottom,0px));width:48px;height:48px;border-radius:50%;border:1px solid var(--amber);background:var(--surface-2);color:var(--amber);font-size:1.45rem;line-height:1;display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:var(--shadow);z-index:90;opacity:0;visibility:hidden;pointer-events:none;transform:translateY(8px);transition:opacity .25s ease,transform .25s ease,visibility .25s}
#kpSiteTopBtn.show{opacity:1;visibility:visible;pointer-events:auto;transform:none}
#kpSiteTopBtn.kp-top-hide{opacity:0;visibility:hidden;pointer-events:none;transform:translateY(8px)}
