/* ==========================================================================
   Design Tokens
   ========================================================================== */
:root {
  --bg-color: #06060f;
  --primary-gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
  --secondary-gradient: linear-gradient(135deg, #06b6d4, #3b82f6);
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-blur: 20px;
  --font-body: 'Inter', sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --radius-card: 16px;
  --radius-input: 12px;
  --radius-pill: 24px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

/* Gradient Mesh Background Blobs */
body::before, body::after {
  content: '';
  position: fixed;
  width: 60vw;
  height: 60vw;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
  z-index: -1;
  animation: float 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

body::before {
  top: -10%;
  left: -10%;
  background: var(--primary-gradient);
}

body::after {
  bottom: -10%;
  right: -10%;
  background: var(--secondary-gradient);
  animation-delay: -10s;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
  background: #2d2d3b;
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3f3f5a;
}

/* Selection Color */
::selection {
  background: rgba(99, 102, 241, 0.3);
  color: var(--text-primary);
}

/* Layout Utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.text-center {
  text-align: center;
}

.skip-to-content {
  position: absolute;
  top: -100px;
  left: 0;
  padding: 1rem;
  background: var(--primary-gradient);
  color: #fff;
  z-index: 9999;
  transition: top 0.2s;
}
.skip-to-content:focus {
  top: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(6, 6, 15, 0.8);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--glass-border);
  z-index: 1000;
  padding: 1rem 0;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition-smooth);
}
.logo:hover {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo svg {
  stroke: var(--text-primary);
  transition: var(--transition-smooth);
}
.logo:hover svg {
  stroke: url(#primary-gradient);
}

/* Desktop Navigation */
.desktop-nav ul {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.desktop-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  transition: var(--transition-smooth);
}
.desktop-nav a:hover {
  color: var(--text-primary);
}
.desktop-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-gradient);
  transition: width 0.3s ease;
}
.desktop-nav a:hover::after {
  width: 100%;
}

/* Dropdown Menu */
.nav-dropdown {
  position: relative;
}

.dropdown-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-smooth);
  position: relative;
}
.dropdown-toggle:hover {
  color: var(--text-primary);
}
.dropdown-toggle::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-gradient);
  transition: width 0.3s ease;
}
.dropdown-toggle:hover::after {
  width: 100%;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  min-width: 250px;
  background: rgba(15, 15, 30, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 1001;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
  font-size: 0.9rem;
}
.dropdown-menu a::after {
  display: none;
}
.dropdown-menu a:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--text-primary);
}

/* Hamburger Button */
.mobile-menu-btn {
  display: none;
  width: 30px;
  height: 22px;
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
}
.mobile-menu-btn span {
  display: block;
  width: 100%;
  height: 2.5px;
  background: var(--text-primary);
  position: absolute;
  left: 0;
  transition: 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  border-radius: 2px;
}
.mobile-menu-btn span:nth-child(1) { top: 0; }
.mobile-menu-btn span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.mobile-menu-btn span:nth-child(3) { bottom: 0; }

body.nav-open .mobile-menu-btn span:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}
body.nav-open .mobile-menu-btn span:nth-child(2) {
  opacity: 0;
  transform: translateX(-20px);
}
body.nav-open .mobile-menu-btn span:nth-child(3) {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}

/* Mobile Nav */
.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 300px;
  height: 100vh;
  background: rgba(6, 6, 15, 0.98);
  backdrop-filter: blur(20px);
  z-index: 999;
  padding: 5rem 2rem 2rem;
  overflow-y: auto;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
body.nav-open .mobile-nav {
  right: 0;
}
.mobile-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.mobile-nav a {
  display: block;
  padding: 0.875rem 1rem;
  border-radius: 10px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-smooth);
  font-size: 1rem;
}
.mobile-nav a:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--text-primary);
}
.mobile-nav-label {
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 1.5rem 1rem 0.5rem;
  font-weight: 600;
}

/* Mobile Nav Overlay */
body.nav-open::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding-top: 100px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fadeInUp 1s ease forwards;
  margin-bottom: 1.5rem;
}

.hero .subtext {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  opacity: 0;
  animation: fadeInUp 1s ease 0.2s forwards;
}

.hero-stats {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  opacity: 0;
  animation: fadeInUp 1s ease 0.4s forwards;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.stat-item {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  padding: 1.5rem 2rem;
  border-radius: var(--radius-card);
}
.stat-item h3 {
  font-size: 2rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.stat-item p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.cta-button {
  display: inline-block;
  background: var(--primary-gradient);
  color: #fff;
  padding: 1rem 2.5rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-weight: 600;
  font-family: var(--font-heading);
  letter-spacing: 0.5px;
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
  transition: var(--transition-smooth);
  border: none;
  cursor: pointer;
  opacity: 0;
  animation: fadeInUp 1s ease 0.6s forwards;
}
.cta-button:hover {
  transform: scale(1.05);
  box-shadow: 0 15px 35px rgba(99, 102, 241, 0.6);
}

/* ==========================================================================
   Calculator Tiles Grid
   ========================================================================== */
.calc-tiles-section {
  padding: 4rem 0;
}

.calc-tiles-section h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 3rem;
  font-size: 1.1rem;
}

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

.calc-tile {
  display: block;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 2rem;
  text-align: center;
  transition: var(--transition-smooth);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  opacity: 0;
  animation: fadeInUp 0.8s forwards;
}

/* Stagger animations for tiles */
.calc-tile:nth-child(1) { animation-delay: 0.1s; }
.calc-tile:nth-child(2) { animation-delay: 0.2s; }
.calc-tile:nth-child(3) { animation-delay: 0.3s; }
.calc-tile:nth-child(4) { animation-delay: 0.4s; }
.calc-tile:nth-child(5) { animation-delay: 0.5s; }
.calc-tile:nth-child(6) { animation-delay: 0.6s; }
.calc-tile:nth-child(7) { animation-delay: 0.7s; }
.calc-tile:nth-child(8) { animation-delay: 0.8s; }

.calc-tile:hover {
  transform: translateY(-8px);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(99, 102, 241, 0.1);
}

.tile-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
}

.tile-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.tile-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.tile-arrow {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  opacity: 0;
  transform: translateX(-10px);
  transition: var(--transition-smooth);
  color: #6366f1;
}

.calc-tile:hover .tile-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ==========================================================================
   Calculator Page Layout
   ========================================================================== */
.calculator-page-section {
  padding: 2rem 0 4rem;
}

.calc-page-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.calc-page-header h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.calc-description {
  max-width: 700px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.calc-page-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
}

/* Breadcrumb */
.breadcrumb {
  padding: 1.5rem 0 0;
}
.breadcrumb ol {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  flex-wrap: wrap;
  align-items: center;
}
.breadcrumb li {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.breadcrumb li + li::before {
  content: '›';
  margin-right: 0.5rem;
  color: var(--text-muted);
}
.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-smooth);
}
.breadcrumb a:hover {
  color: var(--text-primary);
}
.breadcrumb [aria-current] {
  color: var(--text-primary);
  font-weight: 500;
}

/* Page Sidebar */
.page-sidebar {
  position: sticky;
  top: 100px;
}

.related-calculators {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  margin-top: 1.5rem;
}
.related-calculators h3 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
}
.related-calculators ul {
  list-style: none;
}
.related-calculators li {
  margin-bottom: 0.5rem;
}
.related-calculators a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-smooth);
  font-size: 0.9rem;
}
.related-calculators a:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--text-primary);
}

/* Ad Spaces */
.ad-container {
  text-align: center;
  padding: 1rem 0;
  margin: 2rem auto;
  max-width: 728px;
}

.ad-slot {
  background: rgba(255, 255, 255, 0.015);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
}

.ad-label {
  color: var(--text-muted);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.5;
}

.ad-slot-sidebar {
  min-height: 250px;
  width: 100%;
  margin-bottom: 1.5rem;
}
.ad-slot-sidebar.tall {
  min-height: 600px;
}

.ad-top-banner .ad-slot,
.ad-bottom-banner .ad-slot {
  min-height: 90px;
}

.ad-in-content .ad-slot {
  min-height: 250px;
}

/* ==========================================================================
   Calculator Panel & Elements
   ========================================================================== */
.calculator-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 2.5rem;
  display: none;
}
.calculator-panel.active {
  display: block;
  animation: fadeIn 0.5s forwards;
}

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

.input-side {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.result-side {
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  padding-left: 2rem;
  display: flex;
  flex-direction: column;
}

/* Inputs & Form Groups */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.input-group label {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.input-prefix, .input-suffix {
  position: absolute;
  color: var(--text-muted);
  font-weight: 500;
}
.input-prefix { left: 1rem; }
.input-suffix { right: 1rem; }

input[type="number"],
input[type="text"],
select {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-input);
  padding: 0.8rem 1rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition-smooth);
}
input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Range Slider */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  margin-top: 0.5rem;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #6366f1;
  cursor: pointer;
  transition: transform 0.1s;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Radio Options */
.radio-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.radio-options label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.9rem;
}
input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--text-muted);
  border-radius: 50%;
  transition: var(--transition-smooth);
  margin: 0;
}
input[type="radio"]:checked {
  border-color: #6366f1;
  background: radial-gradient(circle, #6366f1 40%, transparent 40%);
}

.info-text {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-style: italic;
}

/* Results */
.results-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  flex-grow: 1;
}

.result-item {
  background: rgba(0, 0, 0, 0.2);
  padding: 1.5rem;
  border-radius: var(--radius-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.result-item.highlight {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  border-color: rgba(99, 102, 241, 0.3);
}

.result-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.result-value {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--text-primary);
}
.result-item.highlight .result-value {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Chart */
.chart-container {
  margin-top: 2rem;
  position: relative;
  height: 250px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.donut-chart {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: conic-gradient(#6366f1 70%, #1e1e2d 70%);
  position: relative;
}
.donut-chart::before {
  content: '';
  position: absolute;
  inset: 20px;
  background: #11111a;
  border-radius: 50%;
}

/* ==========================================================================
   Features Section
   ========================================================================== */
.features-section {
  padding: 4rem 0;
  background: rgba(6, 6, 15, 0.5);
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
}

.features-section h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
}

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

.feature-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  padding: 2rem;
  border-radius: var(--radius-card);
  text-align: center;
  transition: var(--transition-smooth);
  opacity: 0;
  animation: fadeInUp 0.8s forwards;
}
.feature-card:hover {
  transform: translateY(-8px);
  background: rgba(255, 255, 255, 0.05);
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ==========================================================================
   FAQ Section
   ========================================================================== */
.faq-section, .calc-faq {
  padding: 4rem 0;
  max-width: 800px;
  margin: 0 auto;
}

.faq-section h2, .calc-faq h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 2rem;
}

details {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  margin-bottom: 1rem;
  overflow: hidden;
}

summary {
  padding: 1.5rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-smooth);
}
summary::-webkit-details-marker {
  display: none;
}
summary::after {
  content: '+';
  font-size: 1.5rem;
  color: #6366f1;
  transition: transform 0.3s;
}
details[open] summary {
  border-bottom: 1px solid var(--glass-border);
}
details[open] summary::after {
  content: '−';
  transform: rotate(180deg);
}

.faq-content, details > p {
  padding: 1.5rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   Legal Pages
   ========================================================================== */
.legal-page {
  padding: 2rem 0 4rem;
}

.legal-content {
  max-width: 800px;
  margin: 0 auto;
}

.legal-content h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.last-updated {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

.legal-content h2 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
  color: var(--text-primary);
}

.legal-content p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.8;
}

.legal-content ul {
  color: var(--text-secondary);
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

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

.legal-content a {
  color: #6366f1;
  text-decoration: none;
}
.legal-content a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  border-top: 1px solid var(--glass-border);
  background: rgba(6, 6, 15, 0.8);
  padding-top: 4rem;
}

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

.footer-about p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 1rem;
  max-width: 300px;
}

.footer-col h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.footer-col ul {
  list-style: none;
}

.footer-col a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  display: block;
  padding: 0.3rem 0;
  text-decoration: none;
  transition: var(--transition-smooth);
}
.footer-col a:hover {
  color: var(--text-primary);
  transform: translateX(5px);
}

.footer-bottom {
  margin-top: 3rem;
  padding: 2rem 0;
  border-top: 1px solid var(--glass-border);
  text-align: center;
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ==========================================================================
   Quick Nav & Breakdown Sections
   ========================================================================== */
.calc-quick-nav {
  padding: 1rem 0;
  margin-bottom: 1rem;
}
.quick-nav-scroll {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0.5rem 0;
}
.quick-nav-scroll::-webkit-scrollbar { display: none; }
.quick-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1.25rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  white-space: nowrap;
  transition: var(--transition-smooth);
  font-size: 0.875rem;
  text-decoration: none;
}
.quick-nav-pill:hover, .quick-nav-pill.active {
  background: var(--primary-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.breakdown-section {
  margin-top: 2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 2rem;
  animation: fadeInUp 0.5s ease;
}
.breakdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.breakdown-header h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--text-primary);
}
.breakdown-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.view-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-pill);
  padding: 3px;
  border: 1px solid var(--glass-border);
}
.view-toggle-btn {
  padding: 0.5rem 1.25rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition-smooth);
  font-family: var(--font-body);
}
.view-toggle-btn.active {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
.view-toggle-btn:hover:not(.active) {
  color: var(--text-primary);
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-pill);
  color: #10b981;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition-smooth);
  font-family: var(--font-body);
}
.download-btn:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}
.download-btn svg {
  width: 16px;
  height: 16px;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.table-wrapper::-webkit-scrollbar {
  height: 4px;
}
.table-wrapper::-webkit-scrollbar-thumb {
  background: #6366f1;
  border-radius: 4px;
}
.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 600px;
}
.breakdown-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}
.breakdown-table th {
  background: rgba(99, 102, 241, 0.15);
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-weight: 600;
  padding: 1rem;
  text-align: right;
  white-space: nowrap;
  border-bottom: 2px solid rgba(99, 102, 241, 0.2);
}
.breakdown-table th:first-child {
  text-align: left;
  border-radius: 12px 0 0 0;
}
.breakdown-table th:last-child {
  border-radius: 0 12px 0 0;
}
.breakdown-table td {
  padding: 0.875rem 1rem;
  text-align: right;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background 0.2s;
}
.breakdown-table td:first-child {
  text-align: left;
  color: var(--text-primary);
  font-weight: 500;
}
.breakdown-table tbody tr:hover td {
  background: rgba(99, 102, 241, 0.05);
}
.breakdown-table tbody tr:last-child td {
  border-bottom: none;
}
.breakdown-table tbody tr:last-child td:first-child {
  border-radius: 0 0 0 12px;
}
.breakdown-table tbody tr:last-child td:last-child {
  border-radius: 0 0 12px 0;
}
/* Highlight total row */
.breakdown-table tr.total-row td {
  background: rgba(99, 102, 241, 0.1);
  color: var(--text-primary);
  font-weight: 600;
  border-top: 2px solid rgba(99, 102, 241, 0.2);
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { transform: translateX(-20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(5%, 5%) scale(1.05); }
}

@keyframes glow {
  0% { box-shadow: 0 0 10px rgba(99, 102, 241, 0.2); }
  50% { box-shadow: 0 0 25px rgba(99, 102, 241, 0.6); }
  100% { box-shadow: 0 0 10px rgba(99, 102, 241, 0.2); }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 1024px) {
  .calc-tiles-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .calc-page-layout {
    grid-template-columns: 1fr;
  }
  .page-sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .desktop-nav {
    display: none;
  }
  .mobile-menu-btn {
    display: block;
  }
  .hero h1 {
    font-size: 2.5rem;
  }
  .calc-tiles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .panel-layout {
    grid-template-columns: 1fr;
  }
  .result-side {
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-left: 0;
    padding-top: 2rem;
  }
  .page-sidebar {
    grid-template-columns: 1fr;
  }
  .breakdown-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .breakdown-controls {
    width: 100%;
    justify-content: space-between;
  }
  .breakdown-section {
    padding: 1.25rem;
  }
  .breakdown-table {
    font-size: 0.8rem;
  }
  .breakdown-table th,
  .breakdown-table td {
    padding: 0.625rem 0.75rem;
  }
}

@media (max-width: 480px) {
  .calc-tiles-grid {
    grid-template-columns: 1fr;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .calculator-panel {
    padding: 1.5rem;
  }
  .hero-stats {
    flex-direction: column;
  }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  body::before, body::after {
    animation: none;
  }
}

:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

/* ======= Mega Dropdown (3-column) ======= */
.dropdown-menu {
  display: flex;
  gap: 0;
  min-width: 520px;
  padding: 1rem;
}
.dropdown-section {
  flex: 1;
  padding: 0 0.5rem;
}
.dropdown-section + .dropdown-section {
  border-left: 1px solid rgba(255,255,255,0.05);
}
.dropdown-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  font-weight: 700;
}

/* ======= How to Use Section ======= */
.how-to-use {
  margin-top: 2rem;
  padding: 2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
}
.how-to-use h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.step {
  text-align: center;
  padding: 1.5rem 1rem;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-input);
  border: 1px solid rgba(255,255,255,0.04);
  transition: var(--transition-smooth);
}
.step:hover {
  border-color: rgba(99,102,241,0.2);
  transform: translateY(-4px);
}
.step-number {
  width: 40px;
  height: 40px;
  background: var(--primary-gradient);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.125rem;
  color: #fff;
  margin-bottom: 1rem;
}
.step h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}
.step p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ======= Contact Form ======= */
.contact-page { padding: 2rem 0 4rem; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; max-width: 1000px; margin: 0 auto; }
.contact-form { display: flex; flex-direction: column; gap: 1.25rem; }
.contact-form .input-group { display: flex; flex-direction: column; gap: 0.5rem; }
.contact-form label { color: var(--text-secondary); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.contact-form input, .contact-form textarea, .contact-form select { width: 100%; padding: 1rem 1.25rem; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-input); color: var(--text-primary); font-family: var(--font-body); font-size: 1rem; transition: var(--transition-smooth); outline: none; }
.contact-form input:focus, .contact-form textarea:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.2); }
.contact-form textarea { min-height: 150px; resize: vertical; }
.submit-btn { padding: 1rem 2.5rem; background: var(--primary-gradient); color: #fff; border: none; border-radius: var(--radius-pill); font-size: 1rem; font-weight: 600; cursor: pointer; transition: var(--transition-smooth); }
.submit-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(99,102,241,0.4); }
.contact-info-card { background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur)); border: 1px solid var(--glass-border); border-radius: var(--radius-card); padding: 2rem; }
.contact-info-card h3 { font-size: 1.25rem; margin-bottom: 1.5rem; }
.contact-info-item { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; color: var(--text-secondary); }
.contact-info-item .icon { font-size: 1.5rem; }

/* ======= 404 Page ======= */
.error-page { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 4rem 2rem; }
.error-code { font-size: 8rem; font-family: var(--font-heading); font-weight: 800; background: var(--primary-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1; margin-bottom: 1rem; }
.error-page h1 { font-size: 2rem; margin-bottom: 1rem; }
.error-page p { color: var(--text-secondary); margin-bottom: 2rem; max-width: 500px; }
.error-links { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }

/* ======= HTML Sitemap Page ======= */
.sitemap-page { padding: 2rem 0 4rem; }
.sitemap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.sitemap-col h3 { font-size: 1.125rem; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid rgba(99,102,241,0.3); }
.sitemap-col ul { list-style: none; }
.sitemap-col li { margin-bottom: 0.5rem; }
.sitemap-col a { color: var(--text-secondary); font-size: 0.9rem; transition: var(--transition-smooth); }
.sitemap-col a:hover { color: #6366f1; }

/* ======= Mobile Nav Labels ======= */
.mobile-nav-label { padding: 0.5rem 1.5rem; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); font-weight: 700; pointer-events: none; margin-top: 0.5rem; }

/* ======= New Responsive Rules ======= */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
  .dropdown-menu { flex-direction: column; min-width: 250px; }
  .dropdown-section + .dropdown-section { border-left: none; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 0.5rem; }
  .contact-grid { grid-template-columns: 1fr; }
  .sitemap-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .steps-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}

.radio-group { display: flex; gap: 1.5rem; }
.radio-label { display: flex; align-items: center; gap: 0.5rem; color: var(--text-secondary); cursor: pointer; font-size: 0.9rem; }
.radio-label input[type="radio"] { accent-color: #6366f1; width: 18px; height: 18px; cursor: pointer; }
.input-note { font-size: 0.8rem; color: var(--text-muted); font-style: italic; margin-top: 0.5rem; }
