﻿/* ==========================================================================
   Chronological Age Calculator — Industrial Design System
   Aesthetic: Clean Clinical Tech / Premium Modern SaaS (Glassmorphism + Dark/Light Mode)
   AdSense Compliant: Zero Cumulative Layout Shift (CLS) Guaranteed
   ========================================================================== */

:root {
  /* Color Palette - Vibrant Indigo/Cyan Clinical SaaS */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-glow: rgba(79, 70, 229, 0.25);
  
  --accent: #06b6d4;
  --accent-hover: #0891b2;
  --accent-light: #ecfeff;
  
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --danger: #ef4444;

  /* Neutrals & Surfaces (Light Theme Default) */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  --border-focus: #6366f1;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #94a3b8;

  /* Elevations & Glass */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.18);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Ad Slot Placeholders (Strict CLS Prevention) */
  --ad-bg: rgba(148, 163, 184, 0.06);
  --ad-border: rgba(148, 163, 184, 0.18);
}

/* Dark Theme Overrides */
[data-theme="dark"] {
  --bg-main: #090d16;
  --bg-card: #111827;
  --bg-subtle: #1e293b;
  --border-color: #1f293d;
  --border-focus: #818cf8;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #64748b;

  --primary-light: rgba(79, 70, 229, 0.15);
  --accent-light: rgba(6, 182, 212, 0.15);

  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);

  --ad-bg: rgba(30, 41, 59, 0.4);
  --ad-border: rgba(51, 65, 85, 0.4);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Container */
.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

[data-theme="dark"] .site-header {
  background: rgba(17, 24, 39, 0.85);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}
.brand-icon {
  width: 2.25rem;
  height: 2.25rem;
  background: linear-gradient(145deg, #181B2B, #0D0E17);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: white;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.2s ease;
  position: relative;
  padding: 0.25rem 0;
}

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

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: rotate(15deg);
}

/* ==========================================================================
   Zero-CLS Ad Slot Containers
   ========================================================================== */
.ad-slot-leaderboard {
  min-height: 90px;
  width: 100%;
  max-width: 728px;
  margin: 1.5rem auto;
  background: var(--ad-bg);
  border: 1px dashed var(--ad-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  overflow: hidden;
}

.ad-slot-rectangle {
  min-height: 250px;
  width: 300px;
  margin: 1.5rem auto;
  background: var(--ad-bg);
  border: 1px dashed var(--ad-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  overflow: hidden;
}

/* Hero & Main Tool Container */
.hero-section {
  text-align: center;
  padding: 2.5rem 0 1.5rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  border: 1px solid rgba(79, 70, 229, 0.2);
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 3rem;
  }
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 1.5rem;
}

/* The Calculator Card */
.calculator-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.calculator-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

/* Tool Mode Tabs */
.tool-modes-tabs {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-subtle);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.tab-btn {
  flex: 1;
  min-width: 150px;
  padding: 0.65rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.tab-btn:hover:not(.active) {
  color: var(--text-main);
}

/* Calculator Grid */
.calc-inputs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

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

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}

.input-helper {
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: normal;
}

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

.styled-input,
.date-input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s ease;
  outline: none;
}

.styled-input:focus,
.date-input:focus {
  border-color: var(--border-focus);
  background: var(--bg-card);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Native Calendar Picker Indicator Icon */
input[type="date"]::-webkit-calendar-picker-indicator,
.styled-input::-webkit-calendar-picker-indicator,
.date-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 0.2rem;
  transition: all 0.2s ease;
  filter: invert(0.2) opacity(0.85);
}

[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] .styled-input::-webkit-calendar-picker-indicator,
[data-theme="dark"] .date-input::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.3) contrast(1.2);
  opacity: 0.95;
}

[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator:hover,
[data-theme="dark"] .styled-input::-webkit-calendar-picker-indicator:hover,
[data-theme="dark"] .date-input::-webkit-calendar-picker-indicator:hover {
  filter: invert(1) brightness(1.6);
  opacity: 1;
}

/* Date Input Wrapper */
.date-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

/* Label Title Wrap with Today Pill */
.label-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-today-pill,
.btn-today-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg-card);
  color: var(--primary);
  border: 1.5px solid var(--border-color);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.18rem 0.6rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.2;
  box-shadow: var(--shadow-sm);
}

.btn-today-pill:hover,
.btn-today-shortcut:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-1px);
}

[data-theme="dark"] .btn-today-pill,
[data-theme="dark"] .btn-today-shortcut {
  background: rgba(79, 70, 229, 0.25);
  border: 1px solid rgba(129, 140, 248, 0.4);
  color: #c7d2fe !important;
  font-weight: 700;
}

[data-theme="dark"] .btn-today-pill:hover,
[data-theme="dark"] .btn-today-shortcut:hover {
  background: var(--primary);
  border-color: #818cf8;
  color: #ffffff !important;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

/* Premature Baby Adjusted Options (Collapsible) */
.preemie-container {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: none;
}

.preemie-container.active {
  display: block;
}

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

@media (min-width: 640px) {
  .preemie-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Action Buttons */
.calc-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #3730a3);
  color: white;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.9rem 2rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.5);
}

.btn-primary:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
}

@keyframes btnPulseRipple {
  0% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.6), 0 4px 14px rgba(79, 70, 229, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(79, 70, 229, 0.2), 0 6px 20px rgba(79, 70, 229, 0.5);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0), 0 4px 14px rgba(79, 70, 229, 0.4);
  }
}

.btn-pulse-active {
  animation: btnPulseRipple 0.5s ease-out;
}

.btn-secondary {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.9rem 1.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-secondary:hover {
  background: var(--border-color);
}

/* Results Display Area */
.results-area {
  margin-top: 1.5rem;
  padding-top: 1.75rem;
  border-top: 1px dashed var(--border-color);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.results-hero-card,
.results-area,
#diffResultsArea,
#schoolResultsArea {
  scroll-margin-top: 5.5rem;
}

.results-hero-card {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(6, 182, 212, 0.08));
  border: 1.5px solid rgba(79, 70, 229, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  text-align: center;
  margin-bottom: 1.5rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

@keyframes resultHeroPulse {
  0% {
    transform: scale(0.99);
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.6), 0 4px 14px rgba(79, 70, 229, 0.15);
    border-color: var(--primary);
  }
  35% {
    transform: scale(1.02);
    box-shadow: 0 0 0 10px rgba(79, 70, 229, 0.25), 0 20px 35px -5px rgba(79, 70, 229, 0.4);
    border-color: #6366f1;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.16), rgba(6, 182, 212, 0.14));
  }
  100% {
    transform: scale(1);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.1);
    border-color: rgba(79, 70, 229, 0.25);
  }
}

.result-updated-pulse {
  animation: resultHeroPulse 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes resultValuePop {
  0% {
    opacity: 0.65;
    transform: scale(0.96);
  }
  45% {
    opacity: 1;
    transform: scale(1.03);
    color: var(--primary);
    text-shadow: 0 0 16px rgba(79, 70, 229, 0.35);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    text-shadow: none;
  }
}

.result-value-pop {
  animation: resultValuePop 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

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

.results-age-main {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
  .results-age-main {
    font-size: 2.75rem;
  }
}

.clinical-badge-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.clinical-badge {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.clinical-badge strong {
  font-family: var(--font-mono);
  color: var(--primary);
  font-size: 1.05rem;
}

/* Secondary Breakdown Cards Grid */
.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font-mono);
}

/* Clinical Slip / Report Card */
.clinical-report-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

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

.report-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.copy-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

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

.report-snippet-text {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: pre-line;
  line-height: 1.6;
}

/* SEO Content & Editorial Section */
.content-section {
  padding: 3rem 0;
  border-top: 1px solid var(--border-color);
}

.content-article {
  max-width: 840px;
  margin: 0 auto;
}

.content-article h2 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin: 2rem 0 1rem;
}

.content-article h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 1.5rem 0 0.75rem;
}

.content-article p {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.7;
}

.content-article ul, .content-article ol {
  margin: 0 0 1.5rem 1.5rem;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

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

/* Callout Box */
.callout-box {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.5rem 0;
  color: var(--text-main);
}

[data-theme="dark"] .callout-box {
  background: rgba(79, 70, 229, 0.12);
}

.callout-box strong {
  color: var(--primary);
}

/* FAQ Accordion */
.faq-accordion {
  margin-top: 1.5rem;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  background: var(--bg-card);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 1.15rem 1.25rem;
  background: transparent;
  border: none;
  text-align: left;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-icon {
  transition: transform 0.2s ease;
  color: var(--text-light);
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
  color: var(--primary);
}

.faq-answer {
  display: none;
  padding: 0 1.25rem 1.25rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.faq-item.open .faq-answer {
  display: block;
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0 2rem;
  color: var(--text-muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

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

.footer-brand p {
  font-size: 0.9375rem;
  color: var(--text-light);
  margin-top: 0.5rem;
  max-width: 320px;
}

.footer-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-main);
  margin-bottom: 1rem;
}

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

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  transition: color 0.15s ease;
}

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

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-light);
  flex-wrap: wrap;
  gap: 1rem;
}

/* ==========================================================================
   Clinical & IEP Printable Assessment Slip Styles (Screen & Print)
   ========================================================================== */

/* Screen mode: Hide dedicated print slip completely */
#clinicalPrintSlip,
.clinical-print-slip {
  display: none;
}

/* Dedicated Print Mode: Zero Web Clutter, 1-Page Official Clinical Protocol */
@media print {
  /* Hide the ENTIRE web layout, navigation, inputs, buttons, cookies, and ads */
  html, body {
    background: #ffffff !important;
    color: #0f172a !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 10.5pt !important;
    line-height: 1.35 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  @page {
    size: letter portrait;
    margin: 0;
  }

  /* Force hide all standard page elements */
  .site-header,
  .hero-section,
  .calculator-card,
  .calc-layout,
  .calc-inputs-grid,
  .calc-actions,
  .cookie-banner,
  #cookieConsent,
  .theme-toggle-btn,
  .btn-today-pill,
  .btn-today-shortcut,
  .content-section,
  .site-footer,
  .ad-slot-leaderboard,
  .ad-slot-rectangle,
  .btn-scroll-top,
  .tool-modes-tabs {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  /* Reveal ONLY the Official Clinical Assessment Slip */
  #clinicalPrintSlip,
  .clinical-print-slip {
    display: block !important;
    visibility: visible !important;
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 10mm 14mm !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
    color: #0f172a !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .slip-container {
    border: 2px solid #1e293b;
    border-radius: 8px;
    padding: 16px 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #ffffff;
  }

  .slip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 8px;
  }

  .slip-meta {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 8.5pt;
    color: #334155;
    line-height: 1.4;
  }

  .slip-examinee-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 18px;
    padding: 4px 0;
  }

  .slip-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .slip-field label {
    font-size: 7.5pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569;
  }

  .slip-line {
    border-bottom: 1px solid #94a3b8;
    height: 16px;
  }

  .slip-result-banner {
    background: #f8fafc !important;
    border: 2px solid #1e293b;
    border-radius: 6px;
    padding: 10px 14px;
    text-align: center;
    margin: 2px 0;
  }

  .slip-result-label {
    font-size: 8pt;
    font-weight: 800;
    letter-spacing: 1px;
    color: #475569;
    text-transform: uppercase;
  }

  .slip-result-value {
    font-size: 20pt;
    font-weight: 900;
    color: #0f172a;
    margin: 3px 0;
    letter-spacing: -0.5px;
  }

  .slip-result-notation {
    font-size: 9.5pt;
    color: #1e293b;
    font-weight: 600;
  }

  .slip-result-notation strong {
    font-size: 11.5pt;
    color: #0284c7;
    font-family: monospace;
    font-weight: 800;
  }

  .slip-preterm-box {
    border: 1px dashed #d97706;
    background: #fffbeb !important;
    border-radius: 6px;
    padding: 6px 10px;
    margin: 2px 0;
  }

  .slip-preterm-title {
    font-size: 7.5pt;
    font-weight: 800;
    color: #b45309;
    text-transform: uppercase;
    margin-bottom: 2px;
  }

  .slip-preterm-grid {
    display: flex;
    justify-content: space-between;
    font-size: 8pt;
  }

  .slip-section-heading {
    font-size: 8.5pt;
    font-weight: 800;
    text-transform: uppercase;
    color: #0f172a;
    margin: 0 0 4px 0;
    letter-spacing: 0.5px;
  }

  .slip-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 8.5pt;
  }

  .slip-table th,
  .slip-table td {
    border: 1px solid #cbd5e1;
    padding: 4px 8px;
    text-align: left;
  }

  .slip-table th {
    background: #f1f5f9 !important;
    font-weight: 700;
    font-size: 7.5pt;
    text-transform: uppercase;
    color: #334155;
  }

  .slip-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }

  .slip-metric-cell {
    border: 1px solid #cbd5e1;
    background: #f8fafc !important;
    border-radius: 4px;
    padding: 5px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .slip-metric-cell .metric-label {
    font-size: 7pt;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
  }

  .slip-metric-cell .metric-val {
    font-size: 10pt;
    font-weight: 800;
    color: #0f172a;
  }

  .slip-signature-block {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-top: 10px;
    padding-top: 4px;
  }

  .slip-sig-line {
    border-bottom: 1.5px solid #0f172a;
    height: 20px;
  }

  .slip-sig-caption {
    font-size: 7.5pt;
    color: #475569;
    font-weight: 600;
    margin-top: 3px;
  }

  .slip-legal {
    font-size: 6.5pt;
    color: #64748b;
    line-height: 1.3;
    margin: 0;
  }

  .slip-powered {
    font-size: 6.5pt;
    color: #94a3b8;
    text-align: right;
    margin-top: 2px;
  }
}

/* ==========================================================================
   Table & Reference Styles (High E-E-A-T Data Displays)
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}

.reference-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9375rem;
}

.reference-table th {
  background: var(--bg-subtle);
  color: var(--text-main);
  font-weight: 700;
  padding: 0.875rem 1rem;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.reference-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
}

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

.reference-table tr:hover td {
  background: var(--primary-light);
  color: var(--text-main);
}

.grade-badge {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
}

/* ==========================================================================
   Cookie Consent Banner (GDPR & CCPA Compliant - High Contrast WCAG AAA)
   ========================================================================== */
.cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 24px;
  max-width: 420px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.cookie-banner.show {
  transform: translateY(0);
  opacity: 1;
}

.cookie-banner-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.cookie-banner-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.cookie-banner-text p {
  font-size: 0.875rem;
  color: #f1f5f9;
  line-height: 1.5;
  margin: 0;
}

.cookie-banner-text a {
  color: #38bdf8;
  text-decoration: underline;
  transition: color 0.15s ease;
}

.cookie-banner-text a:hover {
  color: #7dd3fc;
}

.cookie-banner-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.cookie-btn {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.cookie-btn-accept {
  background: #4f46e5;
  color: #ffffff;
  font-weight: 700;
  border: 1px solid #4338ca;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
}

.cookie-btn-accept:hover {
  background: #4338ca;
  transform: translateY(-1px);
}

.cookie-btn-decline {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, 0.15);
}

.cookie-btn-decline:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

@media (max-width: 576px) {
  .cookie-banner {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }
}


/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* Mobile & Tablet Navigation (< 992px) */
@media (max-width: 991px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 4.25rem;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 2px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.75rem 1.25rem 1.25rem;
    transform: translateY(-150%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, visibility 0.3s ease;
    z-index: 49;
    max-height: calc(100vh - 4.5rem);
    overflow-y: auto;
  }

  .nav-menu.is-active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-menu li {
    width: 100%;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-menu li:last-child {
    border-bottom: none;
  }

  .nav-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
  }

  .nav-link.active::after {
    display: none;
  }

  .nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    padding-left: 0.75rem;
  }
}

/* Small Mobile Screens (< 640px) */
@media (max-width: 640px) {
  .hero-title, .calc-hero-header h1 {
    font-size: 1.85rem !important;
    line-height: 1.25 !important;
  }

  .hero-subtext, .hero-subtitle {
    font-size: 0.95rem !important;
  }

  .calculator-card {
    padding: 1.25rem 1rem !important;
  }

  .calc-actions {
    flex-direction: column !important;
    width: 100% !important;
  }

  .calc-actions .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  .main-age-display, .results-age-main {
    font-size: 1.75rem !important;
    word-break: break-word !important;
  }

  .metrics-grid {
    grid-template-columns: 1fr !important;
  }

  .form-grid {
    grid-template-columns: 1fr !important;
  }

  .tool-modes-tabs {
    flex-direction: column !important;
  }

  .tab-btn {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* Friendly Date In Words (Eliminates Day/Month ambiguity) */
.date-friendly-display {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.45rem;
  padding-left: 0.25rem;
  min-height: 1.25rem;
  transition: all 0.2s ease;
}

.date-friendly-display .friendly-icon {
  font-size: 0.75rem;
}

.date-friendly-display .friendly-date {
  color: var(--primary);
  font-weight: 700;
}

[data-theme="dark"] .date-friendly-display .friendly-date {
  color: #38bdf8;
}

/* Button Success State & Calculation Confirmation */
.btn-calculated-success {
  background: linear-gradient(135deg, #059669, #10b981) !important;
  color: white !important;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.45) !important;
  transform: translateY(-1px) scale(1.02) !important;
  transition: all 0.2s ease !important;
}

.calc-instant-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
  margin-left: 0.5rem;
  vertical-align: middle;
  animation: badgePop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .calc-instant-badge {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.4);
}

@keyframes badgePop {
  0% { transform: scale(0.75); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
