/* ==========================================================================
   FaultSettle - Design System & Global Stylesheet
   Authoritative Fintech & Insurance Architecture
   Zero External Dependencies | 100% Mobile Responsive | Zero CLS
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens & Root Variables
   -------------------------------------------------------------------------- */
:root {
  /* Brand Palette */
  --primary: #0f2b48;          /* Deep Navy - Trust & Authority */
  --primary-hover: #163e66;
  --primary-light: #eef4f9;
  --primary-dark: #0a1c30;
  
  --accent: #2563eb;           /* Royal Blue - Modern Interaction */
  --accent-hover: #1d4ed8;
  --accent-light: #eff6ff;
  --accent-border: #bfdbfe;

  --secondary: #0d9488;        /* Teal / Success - Financial Health */
  --secondary-hover: #0f766e;
  --secondary-light: #f0fdfa;

  --warning: #d97706;          /* Amber - Caution / Fault alerts */
  --warning-light: #fef3c7;
  --warning-border: #fde68a;

  --danger: #dc2626;           /* Red - Pure Contributory Barred */
  --danger-light: #fef2f2;
  --danger-border: #fecaca;

  /* Neutrals & Surfaces */
  --bg: #f8fafc;               /* Soft Cool Gray / Canvas */
  --card-bg: #ffffff;
  --card-subtle: #f1f5f9;
  --text: #1e293b;             /* Slate 800 - High Contrast Body */
  --text-muted: #64748b;       /* Slate 500 - Secondary Labels */
  --text-light: #94a3b8;
  --border: #e2e8f0;           /* Slate 200 */
  --border-focus: #2563eb;
  --divider: #f1f5f9;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  /* Elevation & Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.06);

  /* Layout & Sizing */
  --max-width: 1200px;
  --max-text-width: 820px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   2. Reset, Document Setup & Viewport Overflow Control
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  width: 100%;
}

/* Offset anchor scrolling so sticky header does not obscure section titles */
section[id], .anchor-target {
  scroll-margin-top: 5rem;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  width: 100%;
  position: relative;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

button, input, select, textarea {
  font: inherit;
}

/* --------------------------------------------------------------------------
   3. Header & Navigation Bar (Mobile-Friendly & Touch Targets)
   -------------------------------------------------------------------------- */
.site-header {
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-xs);
  width: 100%;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.02em;
  line-height: 1;
  min-height: 44px; /* Touch target compliance */
}

.brand-logo:hover {
  text-decoration: none;
  color: var(--primary);
}

/* Single source of truth SVG logo icon */
.brand-logo-icon {
  width: 32px;
  height: 32px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.brand-tag {
  font-size: 0.7rem;
  font-weight: 600;
  background-color: var(--primary-light);
  color: var(--primary);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: 0.25rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem 1.25rem;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0.5rem;
  position: relative;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  text-decoration: none;
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0.5rem;
  right: 0.5rem;
  height: 2px;
  background-color: var(--accent);
}

.nav-cta {
  background-color: var(--primary);
  color: #ffffff !important;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  transition: var(--transition);
}

.nav-cta:hover {
  background-color: var(--primary-hover);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------------------
   4. Layout Containers
   -------------------------------------------------------------------------- */
.main-wrapper {
  flex: 1 0 auto;
  width: 100%;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem;
  width: 100%;
}

.container-narrow {
  max-width: var(--max-text-width);
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
  width: 100%;
}

/* --------------------------------------------------------------------------
   5. Hero & Calculator Layout Section
   -------------------------------------------------------------------------- */
.hero-section {
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 2rem 0 3rem;
  width: 100%;
}

.hero-header {
  text-align: center;
  max-width: 860px;
  margin: 0 auto 2rem;
  padding: 0 0.5rem;
}

.breadcrumb-trail {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  padding: 0;
  list-style: none;
}

.breadcrumb-trail a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.breadcrumb-trail a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.breadcrumb-separator {
  color: var(--border-color, #94a3b8);
  font-size: 0.75rem;
  user-select: none;
  opacity: 0.7;
}

.breadcrumb-current {
  color: var(--text-dark, #0f172a);
  font-weight: 600;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background-color: var(--accent-light);
  color: var(--accent);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--accent-border);
  margin-bottom: 1rem;
}

.hero-title {
  font-size: clamp(1.75rem, 5.5vw, 2.75rem);
  font-weight: 800;
  color: var(--primary);
  line-height: 1.18;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.hero-subtitle {
  font-size: clamp(1rem, 3vw, 1.25rem);
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.45;
  margin-bottom: 1rem;
}

.hero-lead {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Calculator Grid */
.calculator-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.75rem;
  align-items: start;
  width: 100%;
}

/* Calculator Form Card */
.calc-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  width: 100%;
}

.calc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--divider);
}

.calc-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calc-card-title svg {
  color: var(--accent);
  flex-shrink: 0;
}

.calc-badge {
  font-size: 0.75rem;
  font-weight: 600;
  background-color: var(--secondary-light);
  color: var(--secondary);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
}

/* Form Groups & Controls */
.form-section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-muted);
  margin: 1.25rem 0 0.75rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  margin-bottom: 1.125rem;
  width: 100%;
}

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.375rem;
}

.form-helper {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-prefix {
  position: absolute;
  left: 0.875rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
}

/* 16px font size to strictly prevent iOS auto-zoom */
.form-input, .form-select {
  width: 100%;
  padding: 0.65rem 0.875rem;
  font-size: 16px;
  min-height: 44px;
  color: var(--text);
  background-color: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.form-input.has-prefix {
  padding-left: 2rem;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2.25rem;
}

/* Slider Component */
.slider-container {
  background-color: var(--card-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 0.5rem;
  width: 100%;
}

.slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.slider-val-badge {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  background-color: #ffffff;
  padding: 0.15rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.range-slider {
  width: 100%;
  height: 8px;
  background: #cbd5e1;
  border-radius: var(--radius-full);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  margin: 0.5rem 0;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.range-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  font-weight: 500;
  gap: 0.25rem;
  flex-wrap: wrap;
}

/* State Rule Notice Badge */
.state-rule-info {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.state-rule-info.pure-comparative {
  background-color: var(--accent-light);
  border: 1px solid var(--accent-border);
  color: #1e40af;
}

.state-rule-info.modified-50, .state-rule-info.modified-51 {
  background-color: var(--warning-light);
  border: 1px solid var(--warning-border);
  color: #92400e;
}

.state-rule-info.contributory {
  background-color: var(--danger-light);
  border: 1px solid var(--danger-border);
  color: #991b1b;
}

/* Form Action Buttons */
.calc-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--divider);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  min-height: 44px; /* Touch target compliance */
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--accent);
  color: #ffffff;
  flex: 1;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  color: #ffffff;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn-outline:hover {
  background-color: var(--card-subtle);
  color: var(--text);
  border-color: #cbd5e1;
  text-decoration: none;
}

/* Results Panel (Sticky on Desktop, Static on Mobile) */
.results-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 5rem;
  width: 100%;
}

.results-header {
  border-bottom: 1px solid var(--divider);
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.results-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
}

.results-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--secondary);
  background-color: var(--secondary-light);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
}

.results-status::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--secondary);
}

/* Highlight Primary Estimate */
.estimate-highlight {
  background: linear-gradient(135deg, var(--primary) 0%, #173859 100%);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.estimate-highlight::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.estimate-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.estimate-amount {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #ffffff;
  font-family: var(--font-mono);
  word-break: break-all;
}

.estimate-subtext {
  font-size: 0.8rem;
  color: #cbd5e1;
  margin-top: 0.35rem;
}

/* Settlement Range Bar */
.range-box {
  background-color: var(--card-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.range-box-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.range-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.range-item {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
}

.range-item-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.range-item-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-mono);
  word-break: break-all;
}

/* Itemized Breakdown List */
.breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px dashed var(--border);
  gap: 0.5rem;
}

.breakdown-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.breakdown-key {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.breakdown-val {
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.breakdown-val.negative {
  color: var(--danger);
}

.breakdown-val.accent {
  color: var(--accent);
}

.breakdown-val.success {
  color: var(--secondary);
}

/* Alert Warning Box */
.calc-alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  line-height: 1.45;
  margin-bottom: 1.25rem;
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.calc-alert-danger {
  background-color: var(--danger-light);
  border: 1px solid var(--danger-border);
  color: #991b1b;
}

.calc-alert-warning {
  background-color: var(--warning-light);
  border: 1px solid var(--warning-border);
  color: #92400e;
}

.calc-alert-info {
  background-color: var(--accent-light);
  border: 1px solid var(--accent-border);
  color: #1e40af;
}

.print-btn-row {
  display: flex;
  gap: 0.5rem;
}

.btn-print {
  width: 100%;
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid #cbd5e1;
  font-size: 0.875rem;
}

.btn-print:hover {
  background-color: #e2e8f0;
  color: var(--primary);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   6. Content Sections & Typography (Deep SEO Content)
   -------------------------------------------------------------------------- */
.content-section {
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--border);
  width: 100%;
}

.content-section:nth-of-type(even) {
  background-color: #ffffff;
}

.content-header {
  margin-bottom: 2rem;
}

.section-eyebrow {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.section-h2 {
  font-size: clamp(1.4rem, 4vw, 2.25rem);
  font-weight: 800;
  color: var(--primary);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 0.85rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.section-intro {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: var(--max-text-width);
}

.article-content {
  color: var(--text);
  line-height: 1.75;
  font-size: 1rem;
}

.article-content p {
  margin-bottom: 1.25rem;
}

.article-content h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
  margin: 2rem 0 0.85rem;
  line-height: 1.3;
}

.article-content ul, .article-content ol {
  margin: 1rem 0 1.5rem 1.5rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

/* Formula Highlight Box */
.formula-card {
  background-color: var(--primary-light);
  border: 1px solid #cbd5e1;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 1.75rem 0;
  width: 100%;
}

.formula-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.formula-code {
  background-color: #ffffff;
  border: 1px solid var(--border);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0.75rem 0;
  display: block;
  overflow-x: auto;
  max-width: 100%;
}

/* Grid of Cards (Multipliers, Evidence Steps) */
.feature-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
  width: 100%;
}

.feature-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-border);
}

.feature-card-icon {
  width: 44px;
  height: 44px;
  background-color: var(--accent-light);
  color: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.feature-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.feature-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   7. Data Comparison Tables (Touch-friendly & Responsive Container)
   -------------------------------------------------------------------------- */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 2rem 0;
  box-shadow: var(--shadow-xs);
  background-color: #ffffff;
}

.settlement-table {
  width: 100%;
  min-width: 640px; /* Prevents text crushing on narrow screens */
  border-collapse: collapse;
  text-align: left;
  font-size: 0.925rem;
}

.settlement-table th {
  background-color: var(--primary);
  color: #ffffff;
  font-weight: 700;
  padding: 0.9rem 1.15rem;
  letter-spacing: 0.02em;
  font-size: 0.85rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.settlement-table td {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.settlement-table tr:last-child td {
  border-bottom: none;
}

.settlement-table tr:nth-child(even) td {
  background-color: #f8fafc;
}

.settlement-table tr:hover td {
  background-color: var(--accent-light);
}

.table-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
}

.tag-blue {
  background-color: var(--accent-light);
  color: var(--accent);
}

.tag-green {
  background-color: var(--secondary-light);
  color: var(--secondary);
}

.tag-amber {
  background-color: var(--warning-light);
  color: #b45309;
}

/* --------------------------------------------------------------------------
   8. FAQ Accordion Component (Schema.org compliant & 44px tap targets)
   -------------------------------------------------------------------------- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
  width: 100%;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: #ffffff;
  overflow: hidden;
  transition: var(--transition);
}

.faq-item:hover {
  border-color: #cbd5e1;
}

.faq-question {
  padding: 1.15rem 1.25rem;
  min-height: 44px; /* Touch target */
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  user-select: none;
  gap: 0.75rem;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--accent);
  transition: transform 0.2s ease;
}

.faq-item[open] .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 1.25rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
  border-top: 1px solid var(--divider);
  padding-top: 1rem;
}

.faq-answer p {
  margin-bottom: 0.75rem;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   9. Educational Disclaimer Banner
   -------------------------------------------------------------------------- */
.disclaimer-banner {
  background-color: var(--card-subtle);
  border: 1px solid var(--border);
  border-left: 4px solid var(--warning);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 3rem 0 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
  width: 100%;
}

.disclaimer-banner strong {
  color: var(--text);
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   10. Footer Architecture
   -------------------------------------------------------------------------- */
.site-footer {
  background-color: var(--primary-dark);
  color: #94a3b8;
  padding: 3.5rem 0 2rem;
  margin-top: auto;
  font-size: 0.875rem;
  width: 100%;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
  width: 100%;
}

.footer-brand .brand-logo {
  color: #ffffff;
  margin-bottom: 0.85rem;
}

.footer-bio {
  color: #94a3b8;
  font-size: 0.875rem;
  line-height: 1.6;
  max-width: 320px;
  margin-bottom: 1rem;
}

.footer-title {
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  color: #cbd5e1;
  text-decoration: none;
  display: inline-block;
  padding: 0.25rem 0;
  transition: var(--transition);
}

.footer-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-disclaimer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.6;
}

.footer-bottom {
  border-top: 1px solid #1e3a5f;
  padding-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  width: 100%;
}

.footer-bottom a {
  color: #cbd5e1;
  padding: 0.25rem 0;
}

/* --------------------------------------------------------------------------
   11. Static Page Specific Styles (About, Privacy, Terms, Contact)
   -------------------------------------------------------------------------- */
.page-header {
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 3rem 0;
  text-align: center;
  width: 100%;
}

.page-title {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.5rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.page-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.contact-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-sm);
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}

/* --------------------------------------------------------------------------
   12. Comprehensive Mobile Overhaul & Responsive Breakpoints
   -------------------------------------------------------------------------- */

/* Tablet & Smaller Desktops (<= 960px) */
@media (max-width: 960px) {
  .calculator-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .results-card {
    position: static;
    top: auto;
    width: 100%;
    margin-top: 0.5rem;
  }
}

/* Mobile Devices (<= 768px) */
@media (max-width: 768px) {
  .header-inner {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .site-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    padding-bottom: 0.35rem;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    font-size: 0.875rem;
    padding: 0.5rem 0.65rem;
    flex-shrink: 0;
  }

  .nav-cta {
    font-size: 0.85rem;
    padding: 0.5rem 0.85rem;
    flex-shrink: 0;
  }

  .container {
    padding: 1.5rem 1rem;
  }

  .container-narrow {
    padding: 1.75rem 1rem;
  }

  .calculator-grid {
    grid-template-columns: 1fr;
    width: 100%;
    gap: 1.5rem;
  }

  .calc-card {
    padding: 1.25rem 1rem;
  }

  .results-card {
    padding: 1.25rem 1rem;
  }

  .form-grid-2 {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .estimate-amount {
    font-size: clamp(1.85rem, 8vw, 2.4rem);
  }

  /* Footer switches to single column or stacked flex with gap */
  .footer-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .contact-card {
    padding: 1.5rem 1.15rem;
  }
}

/* Small Smartphone Viewports (<= 480px) */
@media (max-width: 480px) {
  .brand-logo {
    font-size: 1.15rem;
  }

  .brand-tag {
    display: none; /* Hide auxiliary badge to save header real estate */
  }

  .range-values {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .calc-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .article-content ul, .article-content ol {
    margin-left: 1.15rem;
  }
}

/* --------------------------------------------------------------------------
   13. Print Stylesheet (@media print)
   -------------------------------------------------------------------------- */
@media print {
  .site-header,
  .site-footer,
  .calc-actions,
  .print-btn-row,
  .btn,
  .faq-list,
  .content-section:not(#summary-print-section) {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt;
  }

  .calculator-grid {
    display: block !important;
  }

  .calc-card, .results-card {
    border: 1px solid #000000 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    margin-bottom: 1.5rem;
    position: static !important;
  }

  .estimate-highlight {
    background: #f1f5f9 !important;
    color: #000000 !important;
    border: 1px solid #000000 !important;
  }

  .estimate-amount {
    color: #000000 !important;
  }

  .estimate-subtext, .estimate-label {
    color: #333333 !important;
  }
}
