/* =========================================================================
   AdvisorCRM Design System — Colors & Type
   ---------------------------------------------------------------------------
   Source: AdvisorCRM.com/ryan/shared-styles.css (the canonical shared styles
   used across the "2.0" and "AdviseAI" prototypes)
   ========================================================================= */

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

:root {
  /* ===========================================================
     BRAND — Orange is the single hero color. Use sparingly for
     primary CTAs, active nav, AI moments, focus rings, highlights.
     =========================================================== */
  --brand-orange:           #FB6A18;
  --brand-orange-dark:      #E55A0C;
  --brand-orange-light:     rgba(251, 106, 24, 0.08);  /* tinted bg */
  --brand-orange-glow:      rgba(251, 106, 24, 0.25);  /* shadow tint */

  /* ===========================================================
     INK — Text & headings. Dark navy is the heading color; near-
     black is body; grays for supporting copy.
     =========================================================== */
  --ink-primary:            #0A0A0A;  /* body */
  --dark-navy:              #202F3D;  /* headings */
  --gray-900:               #1A1A1A;
  --gray-700:               #404040;
  --gray-600:               #525252;
  --gray-500:               #6B7280;
  --gray-400:               #9CA3AF;
  --gray-300:               #D1D5DB;

  /* ===========================================================
     SURFACES — neutrals for bg, card, app chrome.
     =========================================================== */
  --bg-white:               #FFFFFF;
  --bg-gray-50:             #F9FAFB;
  --bg-gray-100:            #F3F4F6;
  --bg-sidebar:             #FAFAFA;

  /* ===========================================================
     SEMANTIC — status colors. Blue is informational only.
     =========================================================== */
  --success:                #10B981;
  --success-bg:             rgba(16, 185, 129, 0.10);
  --error:                  #EF4444;
  --error-bg:               rgba(239, 68, 68, 0.10);
  --warning:                #F59E0B;
  --warning-bg:             rgba(245, 158, 11, 0.10);
  --info:                   #3B82F6;
  --info-bg:                rgba(59, 130, 246, 0.10);

  /* Apple-style accents used in login/MFA */
  --apple-blue:             #007AFF;
  --apple-green:            #34C759;
  --apple-red:              #FF3B30;

  /* ===========================================================
     GRADIENTS — the only gradient motif is the orange CTA/header
     gradient; used on primary buttons and drawer headers.
     =========================================================== */
  --gradient-main:          linear-gradient(135deg, #FB6A18 0%, #FF8A4C 100%);
  --gradient-orange-90:     linear-gradient(90deg, #FB6A18 0%, #FF8A4C 100%);
  --gradient-glass:         linear-gradient(135deg, rgba(255,255,255,0.10), rgba(255,255,255,0.05));

  /* ===========================================================
     SHADOWS — soft, close-to-surface; avoid heavy drop shadows.
     =========================================================== */
  --shadow-sm:              0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md:              0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-lg:              0 10px 25px rgba(0, 0, 0, 0.07);
  --shadow-xl:              0 20px 40px rgba(0, 0, 0, 0.10);
  --shadow-glow:            0 0 20px rgba(251, 106, 24, 0.20);
  --shadow-focus-orange:    0 0 0 3px rgba(251, 106, 24, 0.25);

  /* ===========================================================
     RADII — Apple-inspired. Cards live at 16–20px, buttons at 12px.
     =========================================================== */
  --radius-xs:              6px;
  --radius-sm:              8px;
  --radius-md:              12px;  /* buttons, inputs */
  --radius-lg:              16px;  /* small cards, modals */
  --radius-xl:              20px;  /* primary cards, drawers */
  --radius-2xl:             24px;  /* hero surfaces, MFA container */
  --radius-pill:            999px;

  /* ===========================================================
     SPACING — 4px base scale
     =========================================================== */
  --space-1:                4px;
  --space-2:                8px;
  --space-3:                12px;
  --space-4:                16px;
  --space-5:                20px;
  --space-6:                24px;
  --space-8:                32px;
  --space-10:               40px;
  --space-12:               48px;
  --space-16:               64px;

  /* ===========================================================
     MOTION — Apple-style cubic-beziers, short 150–300ms durations.
     =========================================================== */
  --ease-standard:          cubic-bezier(0.4, 0, 0.2, 1);
  --ease-emphasized:        cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --duration-fast:          150ms;
  --duration-base:          200ms;
  --duration-slow:          300ms;
  --duration-drawer:        400ms;

  /* ===========================================================
     TYPOGRAPHY — Inter is the single family, used 400/500/600/700/800.
     Headings go heavier (700–800) and tighten letter-spacing.
     =========================================================== */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
               Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Monaco, 'Cascadia Mono',
               Consolas, monospace;

  /* Type scale */
  --text-xs:                11px;  /* badges, micro labels */
  --text-sm:                13px;  /* table cells, meta */
  --text-base:              14px;  /* default body / UI */
  --text-md:                15px;  /* nav labels, subtitles */
  --text-lg:                16px;  /* lead body, section hdrs */
  --text-xl:                18px;  /* widget titles */
  --text-2xl:               20px;  /* card titles */
  --text-3xl:               24px;  /* drawer title, h2 */
  --text-4xl:               32px;  /* page title (h1) */
  --text-5xl:               40px;  /* display */

  --leading-tight:          1.2;
  --leading-snug:           1.35;
  --leading-normal:         1.5;
  --leading-relaxed:        1.6;  /* default body */

  --tracking-tight:         -0.5px;
  --tracking-normal:        0;

  /* Translucent chrome — sticky topbar / toolbars (Apple-style depth) */
  --hairline:               rgba(0, 0, 0, 0.06);
  --hairline-strong:        rgba(0, 0, 0, 0.10);
  --surface-translucent:    rgba(255, 255, 255, 0.72);
  --backdrop-saturate-blur: saturate(180%) blur(20px);
  --ease-spring:            cubic-bezier(0.32, 0.72, 0, 1);
  --duration-pane:          220ms;
}

/* =========================================================================
   SEMANTIC TYPE ROLES
   Use these class names (or the underlying CSS vars) to express intent.
   ========================================================================= */

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--ink-primary);
  background: var(--bg-gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Display / Page titles ---- */
.t-display,
h1.t-h1 {
  font-family: var(--font-sans);
  font-size: var(--text-4xl);
  font-weight: 800;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--dark-navy);
}

.t-h2 {
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--dark-navy);
}

.t-h3 {
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: var(--leading-snug);
  color: var(--dark-navy);
}

.t-h4 {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--dark-navy);
}

.t-section-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--dark-navy);
}

/* ---- Body ---- */
.t-body {
  font-size: var(--text-base);
  color: var(--ink-primary);
  line-height: var(--leading-relaxed);
}

.t-body-lg {
  font-size: var(--text-lg);
  color: var(--gray-600);
  line-height: var(--leading-relaxed);
}

.t-meta {
  font-size: var(--text-sm);
  color: var(--gray-600);
}

.t-subtitle {
  font-size: var(--text-md);
  color: var(--gray-600);
}

/* ---- Labels & micro-copy ---- */
.t-eyebrow,
.t-nav-title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-600);
}

.t-badge {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1px;
}

/* ---- Code ---- */
code, .t-code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-gray-100);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  color: var(--dark-navy);
}

/* ---- Brand logo mark ---- */
.t-logo {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
}
.t-logo .logo-advisor { color: var(--brand-orange); font-weight: 700; }
.t-logo .logo-crm     { color: var(--dark-navy);    font-weight: 800; }

/* =========================================================================
   Fusion 3.0 — firm.js boot overlay
   Covers the page until `rest/v3/firm/firm.js` finishes and theme CSS/logos
   are applied so default placeholder logos do not flash.
   ========================================================================= */

html.fe30-firm-pending body {
  overflow: hidden;
}

/**
 * Hide every direct child of `body` except the boot layer so placeholder `<img>`
 * logos (login header + sidebar) do not paint under or around the overlay.
 * `visibility` avoids stacking-context fights with `.fe30-sidebar { z-index: 20 }`.
 */
html.fe30-firm-pending body > *:not(.fe30-firm-boot) {
  visibility: hidden;
}

.fe30-firm-boot {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Double declaration: solid fallback if a custom token ever resolves oddly */
  background-color: #f9fafb;
  background-color: var(--bg-gray-50);
  color: var(--gray-600);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
}

.fe30-firm-boot-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.fe30-firm-boot-spinner {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--gray-300);
  border-top-color: var(--brand-orange);
  animation: fe30-firm-boot-spin 0.75s linear infinite;
}

.fe30-firm-boot-text {
  font-weight: 500;
  color: var(--gray-700);
}

@keyframes fe30-firm-boot-spin {
  to {
    transform: rotate(360deg);
  }
}
