/* Child Support Income Finder - Shared Stylesheet */

:root {
  --color-primary: #1e3a5f;
  --color-primary-light: #2d5a8e;
  --color-primary-dark: #152d4a;
  --color-accent: #0d9488;
  --color-accent-light: #14b8a6;
  --color-accent-dark: #0f766e;
  --color-bg: #ffffff;
  --color-bg-alt: #f8fafc;
  --color-bg-dark: #f1f5f9;
  --color-text: #1e293b;
  --color-text-secondary: #4b5563;
  --color-text-muted: #6b7280;
  --color-border: #e2e8f0;
  --color-success: #059669;
  --color-warning: #d97706;
  --color-error: #dc2626;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, h4, h5, h6, p, ul, ol { margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
a { color: var(--color-primary-light); text-decoration: none; }
a:hover { color: var(--color-accent); text-decoration: underline; }

body {
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbars */
::-webkit-scrollbar { width: 16px; height: 16px; }
::-webkit-scrollbar-track { background: var(--color-bg-alt); }
::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 8px; border: 3px solid var(--color-bg-alt); background-clip: padding-box; min-height: 40px; }
::-webkit-scrollbar-thumb:hover { background: #64748b; border: 3px solid var(--color-bg-alt); background-clip: padding-box; }

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: 800px; margin: 0 auto; padding: 0 1.5rem; }

/* Typography */
h1 { font-size: 2.25rem; font-weight: 700; line-height: 1.2; color: var(--color-primary); }
h2 { font-size: 1.75rem; font-weight: 700; line-height: 1.3; color: var(--color-primary); }
h3 { font-size: 1.375rem; font-weight: 600; line-height: 1.4; color: var(--color-text); }
h4 { font-size: 1.125rem; font-weight: 600; line-height: 1.4; }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

@media (min-width: 640px) {
  h1 { font-size: 2.75rem; }
  h2 { font-size: 2rem; }
}

/* Navigation */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: 0;
}
.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}
.site-nav-logo {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--color-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.site-nav-logo:hover { text-decoration: none; color: var(--color-primary); }
.site-nav-logo svg { width: 28px; height: 28px; flex-shrink: 0; }
.site-nav-links {
  display: none;
  list-style: none;
  gap: 0;
  flex-direction: column;
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
  box-shadow: var(--shadow-lg);
}
.site-nav-links.open { display: flex; }
.site-nav-links li { position: relative; }
.site-nav-links a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: var(--color-text);
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s;
}
.site-nav-links a:hover { background: var(--color-bg-alt); color: var(--color-accent); text-decoration: none; }
.site-nav-links a.active { color: var(--color-accent); }

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  display: none;
  list-style: none;
  padding: 0.5rem 0;
  background: var(--color-bg);
}
.nav-dropdown-menu.open { display: block; }
.nav-dropdown-menu a { padding-left: 2.5rem; font-size: 0.9375rem; }
.nav-dropdown-toggle { cursor: pointer; display: flex; align-items: center; gap: 0.25rem; }
.nav-dropdown-toggle::after { content: '\25BE'; font-size: 0.75rem; }

/* Hamburger */
.nav-hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  min-width: 48px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
}
.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: 0.3s;
}

@media (min-width: 1024px) {
  .nav-hamburger { display: none; }
  .site-nav-links {
    display: flex;
    flex-direction: row;
    position: static;
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
    gap: 0.25rem;
    align-items: center;
  }
  .site-nav-links a { padding: 0.5rem 1rem; border-radius: var(--radius); }
  .nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 260px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 50;
  }
  .nav-dropdown-menu a { padding: 0.75rem 1.25rem; border-radius: 0; }
}

/* Hero */
.hero {
  padding: 4rem 0;
  text-align: center;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: #fff;
}
.hero h1 { color: #fff; margin-bottom: 1rem; }
.hero p { color: rgba(255,255,255,0.9); font-size: 1.25rem; max-width: 680px; margin: 0 auto 2rem; }

@media (min-width: 640px) {
  .hero { padding: 5rem 0; }
  .hero p { font-size: 1.375rem; }
}

/* Sections */
.section { padding: 4rem 0; }
.section-alt { background: var(--color-bg-alt); }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header p { color: var(--color-text-secondary); font-size: 1.125rem; max-width: 640px; margin: 0.75rem auto 0; }

/* Cards */
.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: var(--shadow-lg); }
.card h3 { margin-bottom: 0.75rem; }
.card p { color: var(--color-text-secondary); }
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}

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

/* CTA Card */
.cta-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--color-accent);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.cta-card h3 { margin-bottom: 0.75rem; }
.cta-card p { color: var(--color-text-secondary); margin-bottom: 1.5rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  text-decoration: none;
  min-height: 48px;
  gap: 0.5rem;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-light); color: #fff; }
.btn-accent { background: var(--color-accent); color: #fff; }
.btn-accent:hover { background: var(--color-accent-light); color: #fff; }
.btn-outline { background: transparent; color: var(--color-primary); border: 2px solid var(--color-primary); }
.btn-outline:hover { background: var(--color-primary); color: #fff; }
.btn-lg { padding: 16px 32px; font-size: 1.125rem; min-height: 56px; }
.btn-sm { padding: 8px 16px; font-size: 0.875rem; min-height: 40px; }
.btn-block { width: 100%; }

/* Forms */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-text);
  font-size: 0.9375rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-bg);
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 48px;
}
.form-group textarea { min-height: 120px; resize: vertical; }
.form-group select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234b5563' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(13,148,136,0.15);
}
.form-group .form-hint { font-size: 0.8125rem; color: var(--color-text-muted); margin-top: 0.35rem; }
.form-group .form-error { font-size: 0.8125rem; color: var(--color-error); margin-top: 0.35rem; display: none; }
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea { border-color: var(--color-error); }
.form-group.has-error .form-error { display: block; }

/* Checkbox group */
.checkbox-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .checkbox-group { grid-template-columns: repeat(2, 1fr); }
}
.checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  min-height: 48px;
}
.checkbox-item:hover { border-color: var(--color-accent); background: var(--color-bg-alt); }
.checkbox-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--color-accent);
}
.checkbox-item span { font-size: 0.9375rem; }

/* Trust badges */
.trust-badges { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255,255,255,0.15);
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 500;
}
.trust-badge svg { width: 16px; height: 16px; }
.hero .trust-badge { color: #fff; }
.trust-badge-light {
  background: var(--color-bg-alt);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

/* Disclaimer */
.disclaimer {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  font-style: italic;
  border-left: 3px solid var(--color-accent);
  padding-left: 1rem;
  margin: 1.5rem 0;
}
.disclaimer-banner {
  background: #fffbeb;
  border: 1px solid #fde68a;
  padding: 0.75rem 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: #92400e;
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  counter-reset: step;
}
@media (min-width: 640px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
}
.step { text-align: center; counter-increment: step; }
.step-number {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 auto 1rem;
}
.step-number::before { content: counter(step); }
.step h3 { margin-bottom: 0.5rem; font-size: 1.125rem; }
.step p { color: var(--color-text-secondary); font-size: 0.9375rem; }

/* Alerts */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* Loading spinner */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.85);
  z-index: 200;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
}
.loading-overlay.active { display: flex; }
.loading-overlay p { font-weight: 600; color: var(--color-primary); }

/* Results */
.results-section {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.results-section h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.results-item {
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  transition: background 0.2s;
}
.results-item:hover { background: var(--color-bg-alt); }
.results-item:last-child { margin-bottom: 0; }
.results-item h4 { margin-bottom: 0.25rem; }
.results-item p { font-size: 0.875rem; color: var(--color-text-secondary); margin-bottom: 0.25rem; }

.results-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent);
  color: #fff;
  border-radius: 100px;
  padding: 0.125rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}
.tag-active { background: #ecfdf5; color: #065f46; }
.tag-inactive { background: #fef2f2; color: #991b1b; }
.tag-info { background: #eff6ff; color: #1e40af; }

/* Tables */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--color-border); }
th { font-weight: 600; background: var(--color-bg-alt); font-size: 0.875rem; color: var(--color-text-secondary); }
tr:hover td { background: var(--color-bg-alt); }

/* Breadcrumb */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  padding: 1rem 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  list-style: none;
}
.breadcrumb li::after { content: '/'; margin-left: 0.5rem; color: var(--color-border); }
.breadcrumb li:last-child::after { content: ''; }
.breadcrumb a { color: var(--color-text-secondary); }
.breadcrumb a:hover { color: var(--color-accent); }

/* Footer */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,0.85);
  padding: 3rem 0 0;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
}
@media (min-width: 640px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}
.footer-col h4 { color: #fff; margin-bottom: 1rem; font-size: 1rem; }
.footer-col p { font-size: 0.875rem; color: rgba(255,255,255,0.7); }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col ul a { color: rgba(255,255,255,0.7); font-size: 0.875rem; text-decoration: none; }
.footer-col ul a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.5);
}
.footer-bottom a { color: rgba(255,255,255,0.5); }

/* Content pages */
.content-page { padding: 2rem 0 4rem; }
.content-page h1 { margin-bottom: 1.5rem; }
.content-page h2 { margin-top: 2.5rem; margin-bottom: 1rem; font-size: 1.5rem; }
.content-page h3 { margin-top: 2rem; margin-bottom: 0.75rem; }
.content-page ul, .content-page ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.content-page li { margin-bottom: 0.5rem; color: var(--color-text-secondary); }
.content-page li strong { color: var(--color-text); }
.content-page blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background: var(--color-bg-alt);
  border-left: 4px solid var(--color-accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--color-text-secondary);
}

/* FAQ Accordion */
.faq-item { border-bottom: 1px solid var(--color-border); }
.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
  cursor: pointer;
  font-weight: 600;
  color: var(--color-text);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-size: 1rem;
  font-family: var(--font-family);
  min-height: 48px;
}
.faq-question::after { content: '+'; font-size: 1.25rem; color: var(--color-accent); flex-shrink: 0; margin-left: 1rem; }
.faq-item.open .faq-question::after { content: '-'; }
.faq-answer { display: none; padding-bottom: 1.25rem; color: var(--color-text-secondary); }
.faq-item.open .faq-answer { display: block; }

/* Utility */
.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; }
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Print */
@media print {
  .site-nav, .site-footer, .btn, .nav-hamburger, .loading-overlay { display: none !important; }
  body { color: #000; background: #fff; font-size: 12pt; }
  .hero { background: none !important; color: #000 !important; padding: 1rem 0; }
  .hero h1, .hero p { color: #000 !important; }
  .card, .results-section, .results-item { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
  a { color: #000; text-decoration: underline; }
  a[href]::after { content: ' (' attr(href) ')'; font-size: 0.8em; }
}
