/* FormFactor Design Tokens — loaded in <head> to prevent FOUC
   Component styles live in the CSS Tokens content snippet (rendered via Header).
   This file provides only tokens + base styles that must load before first paint. */

:root {
  /* Brand */
  --ff-primary: #1553a0;
  --ff-primary-hover: #0d3f7e;
  --ff-primary-light: #e9f0fa;

  /* Semantic */
  --ff-secondary: #0a7b6c;
  --ff-success: #0a7b6c;
  --ff-success-light: #e6f5f2;
  --ff-warning: #9a4d00;
  --ff-warning-light: #fef4e8;
  --ff-error: #c41a2e;
  --ff-error-light: #fce8eb;

  /* Surfaces */
  --ff-bg: #f7f8fa;
  --ff-surface: #ffffff;
  --ff-surface-hover: #f3f5f8;
  --ff-border: #dce0e6;
  --ff-border-strong: #a0a8b4;

  /* Text */
  --ff-text: #1a1d23;
  --ff-text-secondary: #474d58;
  --ff-text-muted: #5c6370;
  --ff-text-inverse: #ffffff;

  /* Typography */
  --ff-font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ff-font-size-xs: 0.8125rem;
  --ff-font-size-sm: 0.875rem;
  --ff-font-size-base: 1rem;
  --ff-font-size-md: 1.0625rem;
  --ff-font-size-lg: 1.25rem;
  --ff-font-size-xl: 1.5rem;
  --ff-font-size-2xl: 2rem;

  /* Spacing */
  --ff-spacing-xs: 0.25rem;
  --ff-spacing-sm: 0.5rem;
  --ff-spacing-md: 1rem;
  --ff-spacing-lg: 1.5rem;
  --ff-spacing-xl: 2rem;
  --ff-spacing-2xl: 3rem;

  /* Layout */
  --ff-container-max-width: 1400px;

  /* Radii */
  --ff-radius: 6px;
  --ff-radius-lg: 10px;
  --ff-radius-sm: 4px;

  /* Shadows */
  --ff-shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --ff-shadow-md: 0 2px 8px rgba(0,0,0,0.07);
  --ff-shadow-lg: 0 8px 24px rgba(0,0,0,0.09);

  /* Footer */
  --ff-footer-bg: #1a1d23;
  --ff-footer-text: #9ca3af;
  --ff-footer-heading: #e8eaed;
  --ff-footer-link: #93b4e0;
  --ff-footer-border: #2d3139;
}

/* ----- Base Styles (FOUC prevention) ----- */
html { font-size: 16px !important; }

body {
  font-family: var(--ff-font-family) !important;
  font-size: var(--ff-font-size-base) !important;
  line-height: 1.6 !important;
  color: var(--ff-text) !important;
  background: var(--ff-bg) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body p, body span, body div, body label, body input, body textarea, body select, body button, body a,
body h1, body h2, body h3, body h4, body h5, body h6,
body li, body td, body th,
.navbar, .nav-link, .dropdown-item, .username,
.btn, .form-control, .form-select,
.page-copy, .wrapper-body {
  font-family: var(--ff-font-family) !important;
}

/* portalbasictheme.css sets `a, .a { font-size: 14px }` globally, which sticks to
   <a> tags inside MUI Typography (PCF RTF content) because Typography sizes the
   container, not descendant anchors. Force inheritance so RTF links match
   surrounding body text. Scoped to .MuiTypography-root to avoid touching
   nav/footer/portal-chrome links, which rely on their own component sizing. */
.MuiTypography-root a,
.MuiTypography-root a:link,
.MuiTypography-root a:visited {
  font-size: inherit !important;
}

h1, h2, h3, h4 { line-height: 1.2; }

/* ----- Frame pages: hide all chrome early to prevent flash ----- */
body[data-sitemap-state*="form-submission-frame"] .navbar,
body[data-sitemap-state*="form-submission-frame"] footer,
body[data-sitemap-state*="form-submission-frame"] .ff-footer,
body[data-sitemap-state*="form-submission-frame"] .ff-breadcrumb-bar,
body[data-sitemap-state*="form-submission-frame"] .private-mode-banner,
body[data-sitemap-state*="Form-Submission-Frame"] .navbar,
body[data-sitemap-state*="Form-Submission-Frame"] footer,
body[data-sitemap-state*="Form-Submission-Frame"] .ff-footer,
body[data-sitemap-state*="Form-Submission-Frame"] .ff-breadcrumb-bar,
body[data-sitemap-state*="Form-Submission-Frame"] .private-mode-banner {
  display: none !important;
}

body[data-sitemap-state*="form-submission-frame"],
body[data-sitemap-state*="Form-Submission-Frame"] {
  background: var(--ff-surface) !important;
  padding: 0 !important;
  margin: 0 !important;
}

body[data-sitemap-state*="form-submission-frame"] .content-wrapper,
body[data-sitemap-state*="form-submission-frame"] .wrapper-body,
body[data-sitemap-state*="form-submission-frame"] .page-copy,
body[data-sitemap-state*="form-submission-frame"] .container,
body[data-sitemap-state*="form-submission-frame"] .row,
body[data-sitemap-state*="form-submission-frame"] .col-lg-12,
body[data-sitemap-state*="form-submission-frame"] .sectionBlockLayout,
body[data-sitemap-state*="Form-Submission-Frame"] .content-wrapper,
body[data-sitemap-state*="Form-Submission-Frame"] .wrapper-body,
body[data-sitemap-state*="Form-Submission-Frame"] .page-copy,
body[data-sitemap-state*="Form-Submission-Frame"] .container,
body[data-sitemap-state*="Form-Submission-Frame"] .row,
body[data-sitemap-state*="Form-Submission-Frame"] .col-lg-12,
body[data-sitemap-state*="Form-Submission-Frame"] .sectionBlockLayout {
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  max-width: 100% !important;
}

/* Anonymous form: hide chrome */
body[data-sitemap-state*="form-submission-anonymous"] .ff-footer,
body[data-sitemap-state*="form-submission-anonymous"] .navbar {
  display: none !important;
}

/* Optional body-class toggles */
body.ff-hide-header .navbar { display: none !important; }
body.ff-hide-breadcrumb .ff-breadcrumb-bar { display: none !important; }
body.ff-hide-footer .ff-footer { display: none !important; }

/* Hide PCF loading overlay so portal skeleton shows */
.MuiBackdrop-root,
.MuiBackdrop-root[style] {
  background-color: transparent !important;
  background: transparent !important;
  color: transparent !important;
  opacity: 0 !important;
}

.MuiBackdrop-root > .MuiCircularProgress-root {
  display: none !important;
}
