/* RC Property Tool — Design System v1
   Imported by all 11 pages. Defines the one shared token set, the
   unified header/footer, and base UI components.
   ─────────────────────────────────────────────────────────────────── */

/* Final product convergence sprint (2026-10-02): these 11 pages carried
   their OWN pre-Pass-3 palette and typeface (navy #1a2744, gold #b29c6b,
   Cormorant Garamond/Inter/DM Sans) — the exact values DE-016a already
   replaced on the V2 Engine itself (#101A33/#8A6A1F, Geist/Geist Mono/
   Instrument Serif) and DE-128 already overrode page-by-page for
   account.html alone. Retinted here at the ONE shared source instead,
   so guides.html, privacy.html and all 9 SEO guide pages pick up the
   same identity in one change — "one colour/tokens system", not eleven
   pages each carrying their own patch. Font import first: CSS requires
   @import before any other rule. */
@import url('/fonts/rc-fonts.css'); /* self-hosted (Mission 10.2) */
/* The ONE token + component + header/footer system (Frontend Convergence
   Mission 1). Imported first so this file and every page-level sheet read
   its tokens; the header/footer/button/card/chip rules that used to live
   below moved there — one definition, not two drifting copies. */
@import "./rc-system.css";

/* Visually hides content while keeping it in the accessibility tree —
   for a real semantic landmark (e.g. a page's one <h1>) on a surface
   whose visual design has no room or need for a visible page title
   (the full-canvas Map). Standard, well-known pattern; do not use
   `display:none`/`visibility:hidden` for this, both remove the element
   from the accessibility tree too. */
.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;
}

/* ── Design tokens ─────────────────────────────────────────────────── */
:root {
  /* Legacy names used by guide/account/legal pages — ALIASES of the one
     token set in rc-system.css, never values of their own. */
  --navy:        var(--rc-navy);
  --navy-soft:   var(--rc-navy-hover);
  --navy-ink:    var(--rc-navy);
  --gold:        var(--rc-gold);
  --gold-bright: var(--rc-gold);
  --gold-pale:   var(--rc-gold-tint);
  --cream:       var(--rc-canvas);
  --white:       var(--rc-surface);
  --ink:   var(--rc-ink);
  --text:  var(--rc-ink-2);
  --muted: var(--rc-ink-3);
  --faint: var(--rc-ev-unknown);
  --line:      var(--rc-line);
  --line-soft: var(--rc-line-2);

  /* Type — Geist carries the whole product; Instrument Serif is reserved
     for exactly one place (the Stage 0 hero), never general headings, so
     these pages' own h1/h2 use Geist like everything else, not serif. */
  --font-display: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body:    'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  /* Backward-compat aliases (legacy inline styles in authUI/leadCapture) */
  --font-heading: var(--font-display);
  --font:         var(--font-body);

  /* RC redesign type scale — the app UI (map/sidebar/filter surfaces) uses
     these four named treatments instead of picking sizes/weights ad hoc.
     Only two emphasis weights: 300 (light, for the hero price number) and
     500 (medium, for identity/headings) — never 600/700 in these surfaces.
     Consume as `font: var(--rc-type-price);` etc. */
  --rc-type-price:    300 30px/1.1 var(--font-body);
  --rc-type-identity: 500 20px/1.3 var(--font-body);
  --rc-type-body:     400 14px/1.5 var(--font-body);
  --rc-type-meta:     400 12px/1.4 var(--font-body);

  /* Type scale (1.25 ratio) */
  --t-xs: 12px; --t-sm: 14px; --t-base: 16px; --t-lg: 20px;
  --t-xl: 25px; --t-2xl: 31px; --t-3xl: 39px; --t-4xl: 49px; --t-5xl: 61px;

  /* Spacing */
  --s1: 4px;  --s2: 8px;   --s3: 12px; --s4: 16px; --s5: 20px;
  --s6: 24px; --s8: 32px;  --s10: 40px; --s12: 48px; --s16: 64px;
  --s20: 80px; --s24: 96px; --s32: 128px;

  /* Radius — square shape language (rc-system.css); sheets keep 16px */
  --r-sm:   0;
  --r-md:   0;
  --r-lg:   0;
  --r-xl:   var(--rc-radius-sheet);
  --r-pill: 0;

  /* Shadows */
  --ds-shadow-sm:    0 1px 3px rgba(20,29,51,.06);
  --ds-shadow-md:    0 4px 16px rgba(20,29,51,.08);
  --ds-shadow-lg:    0 12px 40px rgba(20,29,51,.12);
  --ds-shadow-float: 0 8px 30px rgba(20,29,51,.10);

  /* Motion: --ease / --ease-out / --dur-fast / --dur / --dur-slow are
     aliases defined with the job tokens in rc-system.css (M1, §W7). */

}

/* ── Reset (guide pages only — app pages have their own) ──────────────*/
.rc-header *, .rc-mobile-nav *, .rc-footer * {
  box-sizing: border-box;
}


/* Dropdown */
.rc-dropdown { position: relative; }

.rc-dropdown-btn svg {
  flex-shrink: 0;
  transition: transform var(--dur-fast) var(--ease);
  margin-left: 2px;
}
.rc-dropdown-btn[aria-expanded="true"] svg { transform: rotate(180deg); }

.rc-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--ds-shadow-lg);
  padding: 6px;
  min-width: 230px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--dur-fast) var(--ease),
              visibility var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
  z-index: 10;
}
.rc-dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.rc-dropdown-item {
  display: block;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  transition: background var(--dur-fast), color var(--dur-fast);
  white-space: nowrap;
  line-height: 1.4;
}
.rc-dropdown-item:hover {
  background: var(--gold-pale);
  color: var(--navy);
  text-decoration: none;
}
.rc-dropdown-hub {
  font-weight: 500;
  color: var(--navy);
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 4px;
  padding-bottom: 10px;
}

/* ── Dialog modals: full-screen sheet on mobile ───────────────────────
   src/authUI.js (#auth-modal), src/expertSupport.js (#expert-support-modal)
   and src/leadCapture.js (#lead-modal) each build an identical structure —
   a backdrop with inline centering styles around a single card child, sized
   for desktop only (centered, max-width ~420-480px, no mobile treatment at
   all). Below 768px that renders as a squeezed desktop dialog floating over
   the page in all three. One shared rule fixes the root cause everywhere it
   occurs rather than patching each modal separately. Override with
   !important (inline styles otherwise always win — same reasoning as the
   consent-banner override above) so the card instead anchors to the bottom
   edge as a rounded-top sheet: full width, safe-area aware, and tall enough
   that form fields stay reachable once the on-screen keyboard opens. */
@media (max-width: 768px) {
  #auth-modal, #expert-support-modal, #lead-modal {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  #auth-modal > div, #expert-support-modal > div, #lead-modal > div {
    max-width: none !important;
    width: 100% !important;
    max-height: calc(100dvh - var(--topbar-h)) !important;
    border-radius: 16px 16px 0 0 !important;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px)) !important;
    animation: rc-modal-sheet-in var(--dur-slow) var(--ease-out);
  }
}
@keyframes rc-modal-sheet-in {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  #auth-modal > div, #expert-support-modal > div, #lead-modal > div { animation: none; }
}

/* Subtle whole-page fade-in on load — removed one frame after paint */
html.rc-page-loading body { opacity: 0; }
body {
  opacity: 1;
  transition: opacity var(--dur-slow) var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  html.rc-page-loading body { opacity: 1; }
  body { transition: none; }
}

/* Touch :active feedback — mirrors :hover lift with a slight press-down scale */
.rc-touch-active,
.g-card.rc-touch-active,
.card.rc-touch-active,
.stat-card.rc-touch-active,
.area-card.rc-touch-active,
.info-card.rc-touch-active,
.rc-card.rc-touch-active {
  transform: scale(.97) !important;
  transition: transform var(--rc-dur-press) var(--ease) !important;
}
@media (prefers-reduced-motion: reduce) {
  .rc-touch-active { transform: none !important; }
}

/* ── Mission D2UX — Account workspace + save-experience components ─────
   Extends the v1 system above rather than starting a second one. Reuses
   the existing tokens (--navy, --gold, the --r- radius scale, the
   --ds-shadow- scale, and the --dur motion tokens) and the
   existing .rc-dropdown/.rc-dropdown-menu/.rc-dropdown-item mechanics —
   only new visual variants and net-new component shapes are added here.
   ─────────────────────────────────────────────────────────────────── */

/* Dropdown divider + destructive item — used by the Account dropdown to
   separate navigation destinations from Sign out (Mission D2UX §6). */
.rc-dropdown-divider {
  height: 1px;
  background: var(--line-soft);
  margin: 4px 6px;
}
.rc-dropdown-item--danger { color: #b3402f; }
.rc-dropdown-item--danger:hover { background: rgba(179,64,47,0.08); color: #8f3325; }
.rc-dropdown-item, button.rc-dropdown-item {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
}

/* Account nav button reuses .rc-nav-link/.rc-header-link sizing; the label
   span lets JS swap "Log in" <-> "Account" without touching the chevron. */
.rc-account-label { line-height: 1; }
.rc-account-dropdown-menu { min-width: 200px; }

/* Section tabs — Account workspace (Overview / My Cases / Saved Results)
   and any future horizontally-tabbed surface. Underline style, not pill/
   card, so it reads as navigation within one page, not a set of buttons. */
.rc-tabs {
  display: flex;
  gap: var(--s2);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.rc-tab {
  font-family: var(--font-body);
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 12px 4px;
  margin-right: var(--s5);
  min-height: 44px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.rc-tab:hover { color: var(--navy); }
.rc-tab[aria-current="page"] { color: var(--navy); border-bottom-color: var(--gold); }


/* Result card / list row — one shape for Saved Results, My Cases, and
   Overview's "recent" list, instead of each screen inventing its own
   card. Compact by default; roomier on desktop via the container query
   below (fallback: identical to compact if the browser lacks support). */
.rc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  padding: var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--white);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.rc-row:hover { border-color: var(--gold); box-shadow: var(--ds-shadow-sm); }
.rc-row-main { min-width: 0; flex: 1; }
.rc-row-eyebrow {
  font: var(--rc-type-label);
  color: var(--rc-gold); margin-bottom: 2px;
}
.rc-row-title {
  font-family: var(--font-body); font-weight: 500; font-size: var(--t-sm);
  color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rc-row-meta { font-size: 12px; color: var(--faint); margin-top: 2px; }
.rc-row-actions { display: flex; gap: var(--s2); flex-shrink: 0; flex-wrap: wrap; }

/* Mission V1 addendum §5 — real mobile bug found via screenshot: .rc-row
   never wrapped at all, and .rc-row-actions has flex-shrink:0 by design
   (so its buttons never get crushed) — on narrow phone widths, once real
   text-labeled action buttons (Rename/Delete/Duplicate/Open) exist (this
   mission moved every row action to real text labels, away from icon-
   only), the actions block simply had nowhere to go: it overlapped the
   title/meta text and overflowed past the viewport edge. An
   .account-row-actions-stack opt-in class already existed in account.css
   for exactly this, but was never actually applied to any row markup —
   dead CSS. Fixed at the base .rc-row level instead of a per-caller class
   so every current and future user of this shared row component (My
   Cases, Saved Searches, Saved Results) gets it automatically. */
@media (max-width: 480px) {
  .rc-row { flex-direction: column; align-items: stretch; }
  .rc-row-actions { width: 100%; }
}

/* Compact icon button — for row-level actions where a full .rc-btn would
   be too heavy, but the control still needs a real accessible name via
   aria-label (never icon-only with no name, per the mission's explicit
   accessibility requirement). */
.rc-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; min-width: 44px; min-height: 44px;
  border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--white); color: var(--navy); cursor: pointer;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.rc-icon-btn:hover { background: var(--gold-pale); border-color: var(--gold); }
.rc-icon-btn--danger { color: #b3402f; }
.rc-icon-btn--danger:hover { background: rgba(179,64,47,0.08); border-color: #b3402f; }

/* Empty state + field error: one definition each, in rc-system.css's
   feedback set (M1, audit §W2.0). */
.rc-field-success { font-size: 12px; color: #2f7d5c; margin-top: 4px; }
.rc-input, .rc-select {
  width: 100%; box-sizing: border-box; font-family: var(--font-body); font-size: 14px;
  padding: 10px 12px; min-height: 44px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--white); color: var(--text);
  transition: border-color var(--dur-fast) var(--ease);
}
.rc-input:focus, .rc-select:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(26,39,68,0.08); }
.rc-input[aria-invalid="true"] { border-color: #b3402f; }

/* Sticky action bar — the fix for "save action buried at the bottom" on
   long panels (audit §5, §8): a persistent, always-visible bottom strip
   inside a scrollable panel, one primary action, never blocking the
   panel's own close control (which stays in the header, outside this
   bar). Not a modal, not `position:fixed` to the viewport — anchored to
   its own scroll container so it never escapes the panel it belongs to. */
.rc-sticky-actions {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--line);
  padding: var(--s3) var(--s4);
  box-shadow: 0 -4px 16px rgba(26,39,68,0.06);
  z-index: 5;
}

/* Destructive confirmation — clearly identified, never visually identical
   to a routine action (native confirm() dialogs already get this from the
   OS chrome; this class is for any future in-app confirmation surface). */
.rc-confirm-danger { border-color: #b3402f !important; color: #b3402f !important; }

/* Success feedback pulse — used for "Saved" state changes; respects
   reduced-motion via the existing global rule pattern. */
@keyframes rc-save-pulse { 0% { transform: scale(1); } 40% { transform: scale(1.04); } 100% { transform: scale(1); } }
.rc-save-pulse { animation: rc-save-pulse var(--rc-dur-stage) var(--ease-out); }
@media (prefers-reduced-motion: reduce) {
  .rc-save-pulse { animation: none; }
}

/* Focus-visible ring — one consistent treatment for every new control in
   this section (existing components keep their own established focus
   styles; this is additive for the new ones only). */
.rc-tab:focus-visible,
.rc-chip:focus-visible,
.rc-icon-btn:focus-visible,
.rc-row:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
