/* =====================================================================
 * Siderise customer-facing brand layer (#307).
 *
 * EVERY rule in this file is gated by `body[data-imbas-customer-slug="siderise"]`
 * so FundBank, future customers, and the unbranded engine surface are
 * completely untouched. Per ADR 005 + feedback_siderise_fundbank_isolation.
 *
 * Brand tokens sourced from siderise.com DevTools extraction 2026-05-18.
 * See docs/proposed/307-siderise-brand-tokens.md for the discovery doc.
 *
 * Font substitution: Montserrat (Google Fonts, free) stands in for Gotham
 * (which Siderise self-hosts under their own license). If/when Dennis
 * supplies the Gotham font file OR BSX licenses Gotham, swap the @import
 * URL and update the font-family stack. Until then Montserrat is the
 * closest geometric-sans free substitute.
 * ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@200;300;400;500;600&display=swap');

/* ----- Brand tokens as CSS variables (single source of truth) ----- */
body[data-imbas-customer-slug="siderise"] {
  /* Typography */
  --siderise-font: "Montserrat", "Gotham", "Helvetica Neue", Arial, sans-serif;
  --siderise-weight-base: 300;
  --siderise-weight-heading: 200;
  --siderise-weight-bold: 500;

  /* Brand palette */
  --siderise-navy: #002751;          /* primary navy — h2, links, footer */
  --siderise-accent: #0090D0;        /* accent blue — hover, secondary CTAs */
  --siderise-text: #475467;          /* body text slate */
  --siderise-text-light: #94A2B3;    /* secondary text */
  --siderise-bg: #FFFFFF;            /* page background */
  --siderise-bg-subtle: #F0F0F0;     /* button bg, subtle sections */
  --siderise-bg-cream: #FAF8F4;      /* warm section accent */
  --siderise-border: #D0D5DD;        /* hairline borders */
  --siderise-border-strong: #98A2B3; /* emphasis borders */
  --siderise-secondary-navy: #2D4156;/* secondary navy for accents */

  /* Component patterns */
  --siderise-radius: 0;              /* SHARP CORNERS EVERYWHERE */

  /* Apply the foundation */
  font-family: var(--siderise-font);
  font-weight: var(--siderise-weight-base);
  color: var(--siderise-text);
  background: var(--siderise-bg);
}

/* Inherit the font on every descendant element — break the wizard's
   default Inter without having to enumerate every selector. */
body[data-imbas-customer-slug="siderise"] *:not(code):not(pre):not(.imbas-mark):not(.siderise-mark):not(.bsx-logo-header):not(.bsx-logo-footer):not(img) {
  font-family: var(--siderise-font);
}

/* ===== HEADER ============================================================ */
/* Siderise.com has a WHITE header with dark navigation. Override the
   wizard's default dark-indigo gradient. */
body[data-imbas-customer-slug="siderise"] header {
  background: var(--siderise-bg) !important;
  background-image: none !important;
  color: var(--siderise-navy);
  border-bottom: 1px solid var(--siderise-border);
}
body[data-imbas-customer-slug="siderise"] header .brand,
body[data-imbas-customer-slug="siderise"] header .brand strong,
body[data-imbas-customer-slug="siderise"] header .brand span,
body[data-imbas-customer-slug="siderise"] header .powered-by,
body[data-imbas-customer-slug="siderise"] header .powered-by * {
  color: var(--siderise-navy) !important;
}
body[data-imbas-customer-slug="siderise"] header nav a {
  color: var(--siderise-navy) !important;
}
body[data-imbas-customer-slug="siderise"] header nav a:hover {
  color: var(--siderise-accent) !important;
}

/* #307 part 3: Next.js layout (apps/ui/app/layout.tsx — the home page
   and any React routes under it) uses Tailwind .text-white and
   .text-indigo-200 instead of the static pages' .brand/.powered-by
   structure. Without this catch-all, the home-page header would be
   white-on-white. Wizard's static-page header is already navy via the
   .brand/.powered-by rules above, so this rule is effectively a no-op
   there — safe to apply to both. */
body[data-imbas-customer-slug="siderise"] header,
body[data-imbas-customer-slug="siderise"] header * {
  color: var(--siderise-navy) !important;
}

/* #307 part 4: home-page CTA. The default .cta-bling gradient
   (purple → indigo → emerald in globals.css) is the Imbas brand, not
   Siderise — clashes against the otherwise navy/white palette and the
   lighter mid-stops swallow the white label. Override to solid navy on
   Siderise so the button reads cleanly. White text from Tailwind's
   text-white inherits correctly; we force-restore it here in case any
   parent rule bleeds. */
body[data-imbas-customer-slug="siderise"] .cta-bling {
  background-image: none !important;
  background: var(--siderise-navy) !important;
  color: #ffffff !important;
}
body[data-imbas-customer-slug="siderise"] .cta-bling:hover {
  background: #003975 !important;  /* slightly lighter navy on hover */
}
body[data-imbas-customer-slug="siderise"] .cta-bling > * {
  color: #ffffff !important;
}

/* Top-nav links (visible only on admin pages per the #303 work) */
body[data-imbas-customer-slug="siderise"] .imbas-topnav .imbas-nav-link {
  background: transparent !important;
  border: 1px solid var(--siderise-border) !important;
  color: var(--siderise-navy) !important;
  border-radius: var(--siderise-radius) !important;
  font-weight: 400;
}
body[data-imbas-customer-slug="siderise"] .imbas-topnav .imbas-nav-link:hover {
  background: var(--siderise-bg-subtle) !important;
}
body[data-imbas-customer-slug="siderise"] .imbas-topnav .imbas-nav-link.active {
  background: var(--siderise-navy) !important;
  color: white !important;
  border-color: var(--siderise-navy) !important;
}

/* BSX-logo-header pill — adjust to harmonise with the now-white header */
body[data-imbas-customer-slug="siderise"] .bsx-logo-header {
  background: var(--siderise-bg-subtle) !important;
  border-radius: var(--siderise-radius);
}

/* ===== TYPOGRAPHY ======================================================== */
body[data-imbas-customer-slug="siderise"] h1 {
  font-family: var(--siderise-font);
  font-weight: var(--siderise-weight-base);
  color: var(--siderise-navy);
  font-size: 36px;
  margin: 0 0 24px 0;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
body[data-imbas-customer-slug="siderise"] h2 {
  font-family: var(--siderise-font);
  font-weight: var(--siderise-weight-heading);
  color: var(--siderise-navy);
  font-size: 28px;
  margin: 0 0 18px 0;
  line-height: 1.2;
}
body[data-imbas-customer-slug="siderise"] h3 {
  font-family: var(--siderise-font);
  font-weight: var(--siderise-weight-base);
  color: var(--siderise-navy);
  font-size: 20px;
  line-height: 1.3;
}
body[data-imbas-customer-slug="siderise"] h4,
body[data-imbas-customer-slug="siderise"] h5,
body[data-imbas-customer-slug="siderise"] h6 {
  font-family: var(--siderise-font);
  font-weight: 400;
  color: var(--siderise-navy);
}
body[data-imbas-customer-slug="siderise"] p,
body[data-imbas-customer-slug="siderise"] .lead {
  font-family: var(--siderise-font);
  color: var(--siderise-text);
  font-weight: var(--siderise-weight-base);
}
body[data-imbas-customer-slug="siderise"] .lead {
  font-size: 17px;
  line-height: 1.5;
}

/* ===== LINKS ============================================================ */
body[data-imbas-customer-slug="siderise"] a {
  color: var(--siderise-navy);
  text-decoration: none;
  transition: color 0.15s;
}
body[data-imbas-customer-slug="siderise"] a:hover {
  color: var(--siderise-accent);
}

/* ===== BUTTONS ========================================================== */
/* Universal sharp corners + base button reset */
body[data-imbas-customer-slug="siderise"] button,
body[data-imbas-customer-slug="siderise"] .btn,
body[data-imbas-customer-slug="siderise"] [type="button"],
body[data-imbas-customer-slug="siderise"] [type="submit"],
body[data-imbas-customer-slug="siderise"] .actions a,
body[data-imbas-customer-slug="siderise"] .preset-chips a {
  border-radius: var(--siderise-radius) !important;
  font-family: var(--siderise-font);
  font-weight: 400;
  letter-spacing: 0.01em;
  transition: all 0.15s;
}

/* Secondary buttons (Save edits, Copy as email, Download, etc.) */
body[data-imbas-customer-slug="siderise"] .actions button,
body[data-imbas-customer-slug="siderise"] .actions [type="button"],
body[data-imbas-customer-slug="siderise"] .actions a:not(.primary):not(.fb-cta) {
  background: var(--siderise-bg);
  color: var(--siderise-text);
  border: 1px solid var(--siderise-border);
  padding: 8px 14px;
  font-size: 13px;
}
body[data-imbas-customer-slug="siderise"] .actions button:hover,
body[data-imbas-customer-slug="siderise"] .actions [type="button"]:hover,
body[data-imbas-customer-slug="siderise"] .actions a:not(.primary):hover {
  background: var(--siderise-bg-subtle);
  border-color: var(--siderise-navy);
  color: var(--siderise-navy);
}

/* Primary action buttons (Approve, Send for sign-off, primary CTAs) */
body[data-imbas-customer-slug="siderise"] button.primary,
body[data-imbas-customer-slug="siderise"] .btn-primary,
body[data-imbas-customer-slug="siderise"] [type="submit"].primary,
body[data-imbas-customer-slug="siderise"] .fb-btn-primary {
  background: var(--siderise-navy) !important;
  color: white !important;
  border: 1px solid var(--siderise-navy) !important;
}
body[data-imbas-customer-slug="siderise"] button.primary:hover,
body[data-imbas-customer-slug="siderise"] [type="submit"].primary:hover {
  background: var(--siderise-accent) !important;
  border-color: var(--siderise-accent) !important;
}

/* Reject / destructive button — keep semantic colors but sharp corners */
body[data-imbas-customer-slug="siderise"] button.danger,
body[data-imbas-customer-slug="siderise"] .btn-danger,
body[data-imbas-customer-slug="siderise"] #reject-btn {
  border-radius: var(--siderise-radius) !important;
  font-family: var(--siderise-font);
}

/* ===== FORM INPUTS ====================================================== */
body[data-imbas-customer-slug="siderise"] input,
body[data-imbas-customer-slug="siderise"] select,
body[data-imbas-customer-slug="siderise"] textarea {
  border-radius: var(--siderise-radius) !important;
  font-family: var(--siderise-font);
  font-weight: var(--siderise-weight-base);
  border: 1px solid var(--siderise-border);
  background: var(--siderise-bg);
  color: var(--siderise-text);
}
body[data-imbas-customer-slug="siderise"] input:focus,
body[data-imbas-customer-slug="siderise"] select:focus,
body[data-imbas-customer-slug="siderise"] textarea:focus {
  outline: 2px solid var(--siderise-navy);
  outline-offset: -1px;
  border-color: var(--siderise-navy);
}

/* ===== CARDS / CONTAINERS (sharp corners everywhere) ==================== */
body[data-imbas-customer-slug="siderise"] .card,
body[data-imbas-customer-slug="siderise"] [class*="card"]:not([class*="card-meta"]):not([class*="cards-grid"]),
body[data-imbas-customer-slug="siderise"] .preset-card,
body[data-imbas-customer-slug="siderise"] .ab-picker,
body[data-imbas-customer-slug="siderise"] .ab-stamp,
body[data-imbas-customer-slug="siderise"] .coverage-banner,
body[data-imbas-customer-slug="siderise"] .approval-footer,
body[data-imbas-customer-slug="siderise"] .awaiting-panel,
body[data-imbas-customer-slug="siderise"] .case-timeline,
body[data-imbas-customer-slug="siderise"] .confidence-bar,
body[data-imbas-customer-slug="siderise"] .confidence-meter,
body[data-imbas-customer-slug="siderise"] .citation,
body[data-imbas-customer-slug="siderise"] .sidebar,
body[data-imbas-customer-slug="siderise"] .fb-section,
body[data-imbas-customer-slug="siderise"] .fb-preset,
body[data-imbas-customer-slug="siderise"] .fb-pill {
  border-radius: var(--siderise-radius) !important;
}

/* ===== PRESET CHIPS ("Try a sample enquiry") ============================ */
body[data-imbas-customer-slug="siderise"] .presets-label {
  font-weight: 400;
  color: var(--siderise-text);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 11px;
}
body[data-imbas-customer-slug="siderise"] .preset-chips a,
body[data-imbas-customer-slug="siderise"] .preset-chips button {
  border-radius: var(--siderise-radius) !important;
  border: 1px solid var(--siderise-border) !important;
  background: var(--siderise-bg) !important;
  color: var(--siderise-navy) !important;
  font-weight: 400;
  padding: 10px 16px;
  font-size: 14px;
  transition: all 0.15s;
}
body[data-imbas-customer-slug="siderise"] .preset-chips a:hover,
body[data-imbas-customer-slug="siderise"] .preset-chips button:hover {
  background: var(--siderise-navy) !important;
  color: white !important;
  border-color: var(--siderise-navy) !important;
}

/* ===== FOOTER ============================================================ */
body[data-imbas-customer-slug="siderise"] footer,
body[data-imbas-customer-slug="siderise"] .page-foot {
  background: var(--siderise-navy);
  color: white;
  padding: 24px;
}
body[data-imbas-customer-slug="siderise"] footer a,
body[data-imbas-customer-slug="siderise"] .page-foot a {
  color: white;
  opacity: 0.85;
}
body[data-imbas-customer-slug="siderise"] footer a:hover {
  opacity: 1;
  color: white;
}

/* BSX splash ("Built by BrainstormX for Siderise") - subtle attribution */
body[data-imbas-customer-slug="siderise"] .bsx-splash {
  font-family: var(--siderise-font);
  font-weight: 300;
  font-size: 12px;
  color: var(--siderise-text-light);
  letter-spacing: 0.02em;
}
body[data-imbas-customer-slug="siderise"] .bsx-splash a {
  color: var(--siderise-text);
}

/* ===== LETTER RENDERING AREA ============================================ */
body[data-imbas-customer-slug="siderise"] .letter {
  font-family: var(--siderise-font);
  font-weight: var(--siderise-weight-base);
  color: var(--siderise-text);
  line-height: 1.55;
}
body[data-imbas-customer-slug="siderise"] .letter h1,
body[data-imbas-customer-slug="siderise"] .letter h2,
body[data-imbas-customer-slug="siderise"] .letter h3,
body[data-imbas-customer-slug="siderise"] .letter strong {
  color: var(--siderise-navy);
}

/* ===== SIDEBAR (evidence / sources) ===================================== */
body[data-imbas-customer-slug="siderise"] .sidebar {
  border-left: 1px solid var(--siderise-border);
  background: var(--siderise-bg-cream);
}
body[data-imbas-customer-slug="siderise"] .sidebar .meta-line {
  color: var(--siderise-text-light);
  font-size: 12px;
}

/* ===== COVERAGE / WARNING BANNERS ======================================= */
body[data-imbas-customer-slug="siderise"] .coverage-banner {
  border: 1px solid var(--siderise-border);
  background: var(--siderise-bg-cream);
  color: var(--siderise-text);
}

/* ===== MAIN CONTAINER ==================================================== */
body[data-imbas-customer-slug="siderise"] main {
  background: var(--siderise-bg);
}

/* Section headings within main — match siderise.com hero treatment */
body[data-imbas-customer-slug="siderise"] main h1 {
  letter-spacing: -0.015em;
}

/* ===== SCREEN-READABLE ANIMATIONS / TRANSITIONS ========================= */
@media (prefers-reduced-motion: reduce) {
  body[data-imbas-customer-slug="siderise"] * {
    transition: none !important;
  }
}


/* ===== OPTION CARDS — stronger hover + selected feedback ================ *
 * The wizard's .opt buttons are the multiple-choice option cards (Fire Safety,
 * Acoustics, Ireland, etc.). Current base styling lives in wizard.html inline
 * CSS — these rules add Siderise-flavoured hover + selected states with
 * clearer visual feedback. Uses box-shadow (not border-width changes) for
 * the "thick border" feel on selected so card dimensions don't shift. */

body[data-imbas-customer-slug="siderise"] .opt {
  border: 2px solid var(--siderise-border) !important;
  background: var(--siderise-bg) !important;
  border-radius: var(--siderise-radius) !important;
  transition: border-color 0.15s, background 0.15s, transform 0.15s, box-shadow 0.15s !important;
  position: relative;
}

body[data-imbas-customer-slug="siderise"] .opt:hover {
  border-color: var(--siderise-navy) !important;
  background: #F0F5FA !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(0, 39, 81, 0.12) !important;
}

body[data-imbas-customer-slug="siderise"] .opt:hover .label {
  color: var(--siderise-navy) !important;
}

body[data-imbas-customer-slug="siderise"] .opt.selected {
  border-color: var(--siderise-navy) !important;
  background: #E1ECF5 !important;
  box-shadow: inset 0 0 0 1px var(--siderise-navy),
              0 2px 8px rgba(0, 39, 81, 0.10) !important;
  transform: none !important;
}

body[data-imbas-customer-slug="siderise"] .opt.selected .label {
  color: var(--siderise-navy) !important;
  font-weight: 600 !important;
}

body[data-imbas-customer-slug="siderise"] .opt.selected .desc {
  color: var(--siderise-text) !important;
}

body[data-imbas-customer-slug="siderise"] .opt:focus-visible {
  outline: 2px solid var(--siderise-accent) !important;
  outline-offset: 2px !important;
}


/* #307 part 5: hide engine logos on customer-facing static pages that use
   the .imbas class (upload, certs, attachments, approvals, rejection-trends).
   These pages predate the visibility-flag refactor and the bootstrap's
   existing .imbas-mark hide rule doesn't catch them. Wizard + Next.js home
   are unaffected — they use .imbas-mark which is hidden via imbas-brand.js. */
body[data-imbas-customer-slug="siderise"] header img.imbas,
body[data-imbas-customer-slug="siderise"] header .imbas {
  display: none !important;
}


/* #317 confidence bar legibility: the in-letter <footer> (.letter footer)
   holds the confidence bar / sources count / proposal ID. It was being
   caught by the broad `body[data-imbas-customer-slug="siderise"] footer`
   navy-bg rule above, making the muted-grey labels and dark value text
   unreadable on a navy background. Revert this specific footer to its
   original transparent treatment so the status bar sits cleanly inside
   the white letter card. */
body[data-imbas-customer-slug="siderise"] .letter footer {
  background: transparent !important;
  background-image: none !important;
  color: var(--siderise-text) !important;
  padding: 18px 0 0 0 !important;
  border-top: 1px solid var(--siderise-border) !important;
}
body[data-imbas-customer-slug="siderise"] .letter footer .value,
body[data-imbas-customer-slug="siderise"] .letter footer strong,
body[data-imbas-customer-slug="siderise"] .letter footer #letter-id,
body[data-imbas-customer-slug="siderise"] .letter footer #letter-id-b {
  color: var(--siderise-navy) !important;
}
body[data-imbas-customer-slug="siderise"] .letter footer .confidence-meter {
  color: var(--siderise-text) !important;
}

/* #268 Cinematic autoplay — spotlight ring
   Positioned absolutely over the element being clicked so the
   audience can track which action is being taken in real time.
   Customer-agnostic: lives here because the autoplay feature is
   currently Siderise-only, but the keyframe has no customer colours. */
@keyframes imbas-spotlight-pulse {
  0%   { opacity: 0.9; box-shadow: 0 0 0 0   rgba(34, 197, 94, 0.7); }
  55%  { opacity: 0.5; box-shadow: 0 0 0 10px rgba(34, 197, 94, 0.2); }
  100% { opacity: 0;   box-shadow: 0 0 0 20px rgba(34, 197, 94, 0);   }
}
.imbas-spotlight-ring {
  position: absolute;
  border: 2px solid rgba(34, 197, 94, 0.85);
  border-radius: 8px;
  pointer-events: none;
  z-index: 99998;
  animation: imbas-spotlight-pulse 0.65s ease-out forwards;
}
