:root {
  --primary-color: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-light: #eff6ff;
  --secondary-color: #0f172a;
  --accent-color: #f8fafc;
  --text-dark: #0f172a;
  --text-light: #64748b;
  --white: #ffffff;
  --border-color: #e2e8f0;
  --success-color: #10b981;
  --success-light: #ecfdf5;
  --warning-color: #f59e0b;
  --warning-light: #fffbeb;
  --danger-color: #ef4444;
  --danger-light: #fef2f2;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --max-width: 1200px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px -2px rgba(0,0,0,0.06), 0 2px 6px -1px rgba(0,0,0,0.03);
  --shadow-lg: 0 12px 30px -4px rgba(0,0,0,0.08), 0 4px 12px -2px rgba(0,0,0,0.03);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  color: var(--text-dark);
  line-height: 1.65;
  background-color: #f8fafc;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .logo {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

/* Header */
header {
  background-color: var(--white);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--secondary-color);
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.logo:hover {
  text-decoration: none;
  opacity: 0.92;
}

.logo-mark {
  width: 34px;
  height: 34px;
  display: block;
  flex-shrink: 0;
  border-radius: 8px;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.logo:hover .logo-mark {
  transform: scale(1.06) rotate(-2deg);
}

.logo-text {
  color: var(--secondary-color);
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.logo-accent {
  color: var(--primary-color);
}

.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-links a {
  color: #334155;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  transition: all 0.2s;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--primary-color);
  background-color: var(--primary-light);
  text-decoration: none;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #1d4ed8 100%);
  color: var(--white);
  padding: 5rem 1.5rem;
  text-align: center;
  position: relative;
}

.hero h1 {
  font-size: 2.85rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  line-height: 1.15;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.92;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  font-family: var(--font-family);
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--white);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  color: var(--white);
}

.btn-secondary {
  background-color: var(--white);
  color: var(--secondary-color);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: #f1f5f9;
  color: var(--primary-color);
}

/* Main Container */
.container {
  max-width: var(--max-width);
  margin: 2.5rem auto;
  padding: 0 1.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .nav-container {
    flex-direction: column;
    text-align: center;
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .nav-links {
    gap: 12px;
    font-size: 0.875rem;
    justify-content: center;
    width: 100%;
    flex-wrap: wrap;
  }

  .hero {
    padding: 3.5rem 1rem;
  }

  .hero h1 {
    font-size: 2rem;
  }
}

/* Cards */
.card {
  background: var(--white);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.card h2 {
  color: var(--secondary-color);
  margin-bottom: 1rem;
  font-size: 1.45rem;
}

/* Sections */
.section {
  margin-bottom: 3.5rem;
}

.section-title {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--secondary-color);
  font-size: 1.85rem;
}

/* Footer */
footer {
  background-color: var(--white);
  padding: 3.5rem 1.5rem;
  margin-top: 5rem;
  border-top: 1px solid var(--border-color);
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.footer-links {
  margin: 1.25rem 0;
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-light);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--primary-color);
}

.disclaimer {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 2rem;
  font-style: italic;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* CPT Page Specifics */
.cpt-header {
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
  padding: 2.25rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  border-left: 6px solid var(--primary-color);
  border-top: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.cpt-price-box {
  background-color: #fff;
  border: 2px solid var(--success-color);
  padding: 1.75rem;
  border-radius: 12px;
  margin: 1.75rem 0;
  text-align: center;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.08);
}

.price-range {
  font-size: 2.25rem;
  font-weight: 800;
  color: #059669;
  display: block;
  font-family: var(--font-heading);
}

.faq-section details {
  background: var(--white);
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.faq-section details:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}

.faq-section summary {
  font-weight: 600;
  color: var(--secondary-color);
  font-size: 1.05rem;
}

.faq-section p {
  margin-top: 1rem;
  color: #475569;
  line-height: 1.6;
}

/* Related Codes Cards */
.related-card {
  background: var(--white);
  padding: 1.5rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.related-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

/* Tool Page Specifics */
textarea.bill-input {
  width: 100%;
  height: 220px;
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea.bill-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.results-area {
  margin-top: 2rem;
  background: var(--white);
  padding: 1.5rem;
  border-radius: 8px;
  min-height: 100px;
  border: 1px solid var(--border-color);
}

/* Sample Bill Buttons */
.sample-btn {
  background: var(--white);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--secondary-color);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-family);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.sample-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* Interactive EOB Calculator Styles */
.calc-card {
  background: var(--white);
  border-radius: 14px;
  padding: 2.25rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (max-width: 768px) {
  .calc-grid {
    grid-template-columns: 1fr;
  }
}

.input-group {
  margin-bottom: 1.25rem;
}

.input-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--secondary-color);
  margin-bottom: 0.4rem;
}

.input-group .helper-text {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 0.35rem;
}

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

.input-wrapper span.prefix {
  position: absolute;
  left: 12px;
  color: #64748b;
  font-weight: 600;
}

.input-wrapper input, .input-wrapper select {
  width: 100%;
  padding: 0.75rem 0.75rem 0.75rem 1.85rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  font-family: var(--font-family);
  transition: all 0.2s;
  background: #fff;
}

.input-wrapper input:focus, .input-wrapper select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

/* Result Box */
.calc-result-box {
  background: #f8fafc;
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.calc-metric {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.6rem 0;
  border-bottom: 1px dashed #e2e8f0;
}

.calc-metric:last-of-type {
  border-bottom: none;
}

.calc-metric .metric-label {
  font-size: 0.925rem;
  color: #475569;
}

.calc-metric .metric-val {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--secondary-color);
}

.calc-metric.highlight-metric {
  background: var(--primary-light);
  padding: 0.85rem 1rem;
  border-radius: 8px;
  margin-top: 0.75rem;
  border: none;
}

.calc-metric.highlight-metric .metric-val {
  font-size: 1.45rem;
  color: var(--primary-color);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.badge-success {
  background: #dcfce7;
  color: #15803d;
}

.badge-warning {
  background: #fef3c7;
  color: #b45309;
}

/* Comparison Table */
.table-responsive {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

table.eob-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  text-align: left;
}

table.eob-table th {
  background: #f1f5f9;
  padding: 1rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--secondary-color);
  border-bottom: 1px solid var(--border-color);
}

table.eob-table td {
  padding: 1rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.95rem;
}

table.eob-table tr:hover {
  background-color: #f8fafc;
}

/* Copy Script Box */
.script-box {
  background: #0f172a;
  color: #f8fafc;
  padding: 1.25rem;
  border-radius: 8px;
  margin-top: 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
  position: relative;
}

.script-box button.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #334155;
  color: #fff;
  border: none;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.2s;
}

.script-box button.copy-btn:hover {
  background: #475569;
}

/* Dispute Letter Generator */
.letter-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.letter-tab {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-family);
}

.letter-tab:hover, .letter-tab.active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

.letter-preview-box {
  background: #ffffff;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 1.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92rem;
  line-height: 1.6;
  white-space: pre-wrap;
  color: #1e293b;
  position: relative;
  box-shadow: var(--shadow-sm);
}

