:root {
  --bg:#0b1020; --card:#121a35; --muted:#94a3b8; --text:#e2e8f0; --accent:#60a5fa; --accent-2:#34d399; --border:#1f2a4a;
  color-scheme: dark; /* Hint browsers to render form controls for dark UI */
}

html { width: 100%; overflow-x: hidden; }

* { box-sizing:border-box; }

body { 
  margin:0; 
  font-family:ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial; 
  background:var(--bg); 
  color:var(--text); 
  overflow-x: hidden; /* prevent horizontal wiggle on mobile */
}

header { 
  position:sticky; 
  top:0; 
  backdrop-filter:saturate(1.2) blur(6px); 
  background:linear-gradient(180deg, rgba(11,16,32,.85), rgba(11,16,32,.6)); 
  border-bottom:1px solid var(--border); 
  z-index:1000; /* Increased from 10 to ensure dropdown appears above content */
  isolation: isolate; /* Create a new stacking context for reliable z-index behavior */
}

.container { max-width:1100px; margin:0 auto; padding:20px; }

/* Mobile optimizations */
@media (max-width: 768px) {
  .container { padding:12px; }
  
  /* Mobile header layout: show site nav and calculator chips, hide dropdown */
  nav { display:none !important; } /* Hide generic navs by default */
  #nav { display:flex !important; flex-wrap: wrap; gap: 8px 10px; } /* Show calculator chips */
  .site-nav { display:flex !important; }
  .nav-mobile { display:none !important; } /* Hide dropdown entirely on mobile */
  
  /* Tighter header */
  header .container:first-child { padding-bottom:0; }
  .brand .site-title { font-size:18px; }
  
  /* Better mobile grid */
  .grid { grid-template-columns:1fr; gap:12px; }
  main { padding:16px 0 32px; }
  
  /* Mobile-friendly cards */
  .card { padding:12px; border-radius:12px; }
  .card h2 { font-size:16px; margin-bottom:6px; }
  
  /* Better mobile inputs */
  input[type="number"], input[type="text"], input[type="email"], select { 
    padding:12px; 
    font-size:16px; /* Prevents zoom on iOS */
    border-radius:8px;
  }
  
  /* Mobile-friendly buttons */
  .btn { 
    padding:12px 16px; 
    border-radius:8px; 
    font-size:14px;
    min-height:44px; /* iOS touch target */
  }
  
  /* Better mobile KPI layout */
  .kpi { 
    grid-template-columns:1fr; 
    gap:8px; 
  }
  .kpi .item { 
    padding:12px; 
    border-radius:8px; 
  }
  .kpi .value { font-size:20px; }
  
  /* Mobile chart adjustments */
  .chart-area { height:200px; }
  
  /* Mobile-friendly row layout */
  .row { 
    flex-direction:column; 
    gap:6px; 
  }
  .row.mobile-row { 
    flex-direction:row; 
    gap:8px; 
  }
  
  /* Better debt/repeater items on mobile */
  .debt { 
    padding:12px; 
    border-radius:8px; 
  }
  .debt-header { 
    flex-direction:column; 
    align-items:flex-start; 
    gap:8px; 
  }
  
  /* Mobile field spacing */
  .field { margin-bottom:16px; }
  .field label { font-size:14px; margin-bottom:4px; }
  
  /* Educational sections mobile */
  .how-to-item {
    padding: 12px;
  }
  
  .how-to-item h3 {
    font-size: 14px;
  }
  
  .math-content {
    padding: 12px;
  }
  
  .math-content h4 {
    font-size: 14px;
  }
  
  .math-content strong {
    font-size: 12px;
  }
}
.brand { display:flex; align-items:center; gap:10px; }
.brand .site-title { margin:0; font-size:20px; letter-spacing:.2px; }

/* Desktop Navigation */
nav { display:flex; gap:10px; flex-wrap:wrap; padding:10px 0; }
nav a { 
  text-decoration:none; 
  color:var(--text); 
  border:1px solid var(--border); 
  padding:8px 12px; 
  border-radius:12px; 
  opacity:.9; 
  font-size:14px;
  white-space:nowrap;
  transition: all 0.2s ease;
  outline: none;
  background: transparent;
}

/* Site Navigation */
.site-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.site-nav a {
  text-decoration: none;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  opacity: 0.9;
  font-size: 14px;
  white-space: nowrap;
  transition: all 0.2s ease;
  background: transparent;
  border: none;
}

/* Mobile-friendly site links in header */
@media (max-width: 768px) {
  .site-nav {
    gap: 6px;
    padding: 8px 0;
    margin-bottom: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .site-nav a {
    font-size: 12px;
    padding: 6px 8px;
    border: 1px solid var(--border);
  }
}

.site-nav a:hover {
  opacity: 1;
  background: rgba(96,165,250,0.1);
  color: #fff;
}

/* Calculator Navigation */
#nav {
  display: flex;
  flex-wrap: wrap;          /* allow wrapping to multiple lines */
  gap: 8px 10px;            /* row-gap, column-gap for cleaner spacing */
  align-items: center;
  padding: 10px 0;
}

@media (max-width: 768px) {
  /* Show calculator chips on mobile; allow horizontal scrolling if needed */
  #nav { 
    display: flex !important; 
    flex-wrap: nowrap; 
    gap: 8px 10px; 
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch; 
    padding: 8px 0; 
    margin-bottom: 8px; 
  }
  #nav::-webkit-scrollbar { height: 6px; }
  #nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
}

/* Ensure desktop navigation is visible on calculator pages */
@media (min-width: 769px) {
  #nav { display: flex !important; }
}

nav a:focus {
  outline: none;
}

/* Remove any potential active states - ensure no blue outline shows current page */
nav a.active,
nav a[aria-current="page"],
nav a[aria-current="true"],
nav a[data-calc-id][href*="calc="],
nav a[data-calc-id],
nav a[href*="calc="],
nav a[href*="#calc="],
nav a[href*="calc="],
nav a[href*="calc"],
nav a[href*="="],
nav a[href*="#"],
nav a[href] {
  background: transparent !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  box-shadow: none !important;
  transform: none !important;
  font-weight: normal !important;
  opacity: 0.9 !important;
}

/* Ensure no focus states show blue outline */
nav a:focus,
nav a:focus-visible {
  outline: none !important;
  border-color: var(--border) !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Override any potential active states with higher specificity */
header nav a,
.container nav a,
nav a[href],
nav a[data-calc-id] {
  background: transparent !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  box-shadow: none !important;
  transform: none !important;
  font-weight: normal !important;
  opacity: 0.9 !important;
}

/* Nuclear option - override ALL possible states for navigation links */
header nav a,
.container nav a,
nav a,
nav a:link,
nav a:visited,
nav a:active,
nav a:focus,
nav a:focus-visible,
nav a[class*="active"],
nav a[class*="current"],
nav a[data-*],
nav a[href*] {
  background: transparent !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  box-shadow: none !important;
  transform: none !important;
  font-weight: normal !important;
  opacity: 0.9 !important;
  text-decoration: none !important;
}

/* Maximum specificity override - use the most specific selectors possible */
body header nav a,
body .container nav a,
body nav a,
html body header nav a,
html body .container nav a,
html body nav a {
  background: transparent !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  box-shadow: none !important;
  transform: none !important;
  font-weight: normal !important;
  opacity: 0.9 !important;
  text-decoration: none !important;
}

/* Ensure no active states can appear on navigation links except on hover */
html body header nav a.active,
html body header nav a[aria-current="page"],
html body header nav a[aria-current="true"],
html body header nav a[class*="active"],
html body header nav a[class*="current"],
html body .container nav a.active,
html body .container nav a[aria-current="page"],
html body .container nav a[aria-current="true"],
html body .container nav a[class*="active"],
html body .container nav a[class*="current"] {
  background: transparent !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  box-shadow: none !important;
  transform: none !important;
  font-weight: normal !important;
  opacity: 0.9 !important;
  text-decoration: none !important;
}

/* Specifically target calculator navigation to prevent any active states */
#nav a,
#nav a.active,
#nav a[aria-current="page"],
#nav a[aria-current="true"],
#nav a[class*="active"],
#nav a[class*="current"] {
  background: transparent !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  box-shadow: none !important;
  transform: none !important;
  font-weight: normal !important;
  opacity: 0.9 !important;
  text-decoration: none !important;
  cursor: pointer !important;
  pointer-events: auto !important;
}

/* Ensure calculator navigation links maintain consistent appearance */
#nav a:visited,
#nav a:active,
#nav a:focus,
#nav a:focus-visible {
  background: transparent !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  box-shadow: none !important;
  transform: none !important;
  font-weight: normal !important;
  opacity: 0.9 !important;
  text-decoration: none !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 1004 !important; /* Ensure links are above everything */
  flex: 0 0 auto;           /* ensure items size to content and wrap cleanly */
}

/* Override any browser default styles that might cause blue highlights */
html body header nav a:any-link,
html body header nav a:link,
html body header nav a:visited,
html body header nav a:active,
html body header nav a:focus,
html body .container nav a:any-link,
html body .container nav a:link,
html body .container nav a:visited,
html body .container nav a:active,
html body .container nav a:focus {
  background: transparent !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  box-shadow: none !important;
  transform: none !important;
  font-weight: normal !important;
  opacity: 0.9 !important;
  text-decoration: none !important;
}

/* Only show blue on hover - no active state indication */
nav a:hover { 
  border-color:var(--accent); 
  color:#fff; 
  box-shadow:0 0 0 2px rgba(96,165,250,.15) inset; 
  transition: all 0.2s ease;
  background: rgba(96,165,250,0.1);
  transform: scale(1.02);
  opacity: 1;
}

/* Mobile Navigation Dropdown */
.nav-mobile { 
  display:none !important; 
  position:relative; 
  max-width:100%;
  margin:0 auto;
  width: 100%;
  z-index: 5000; /* Ensure mobile nav is above page content */
}

@media (max-width: 768px) {
  .nav-mobile { display:none !important; }
}

.nav-toggle { 
  display:flex; 
  align-items:center; 
  gap:8px; 
  padding:12px 16px; 
  background:var(--card); 
  border:1px solid var(--border); 
  border-radius:8px; 
  color:var(--text); 
  cursor:pointer;
  font-size:14px;
  width:100%;
  justify-content:space-between;
  touch-action:manipulation;
  user-select:none;
  -webkit-user-select:none;
}
.nav-toggle:active { 
  border-color:var(--accent); 
  background:rgba(96,165,250,0.05);
}

.nav-dropdown { 
  position:absolute; 
  top:100%; 
  left:0; 
  right:0; 
  background:var(--card); 
  border:1px solid var(--border); 
  border-radius:8px; 
  margin-top:4px; 
  z-index:6000; /* Above mobile nav and all page content */
  display:none;
  box-shadow:0 4px 16px rgba(0,0,0,0.4);
  max-height:300px;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
}

/* Push-down mode on mobile: make dropdown part of normal flow to push content down */
@media (max-width: 768px) {
  header.menu-open { /* push-down mode flag */
    will-change: height;
  }
  header.menu-open .nav-mobile {
    z-index: auto;
  }
  header.menu-open .nav-dropdown {
    position: static !important;
    display: block !important;
    margin-top: 8px;
    z-index: auto !important;
    max-height: none;
    overflow: visible;
    box-shadow: none;
    border: 1px solid var(--border);
  }
}

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

.nav-dropdown a { 
  display:block; 
  padding:14px 16px; 
  color:var(--text); 
  text-decoration:none; 
  border-bottom:1px solid var(--border); 
  font-size:14px;
  touch-action:manipulation;
  min-height:44px;
  display:flex;
  align-items:center;
  cursor: pointer;
  pointer-events: auto;
}
.nav-dropdown a:last-child { border-bottom:none; }


.nav-arrow { 
  transition:transform 0.2s ease;
  width:16px;
  height:16px;
  flex-shrink:0;
}
.nav-toggle.open .nav-arrow { 
  transform:rotate(180deg); 
}

main { 
  padding:24px 0 48px; 
  position: relative;
  z-index: 1; /* Ensure main content stays below header */
}
.grid { display:grid; grid-template-columns:1fr; gap:16px; }
@media (min-width: 960px) { .grid { grid-template-columns: 360px 1fr; } }

.card { 
  background:var(--card); 
  border:1px solid var(--border); 
  border-radius:16px; 
  padding:16px; 
  position: relative;
  z-index: 1; /* Ensure cards stay below header */
}
.card h2 { margin:0 0 8px 0; font-size:18px; }
.desc { color:var(--muted); font-size:14px; margin-top:4px; }

.field { display:flex; flex-direction:column; gap:6px; margin-bottom:12px; }
.field label { font-size:13px; color:#cbd5e1; }
.row { display:flex; gap:8px; }
.row > * { flex:1; }

input[type="number"], input[type="text"], input[type="email"], select { 
  width:100%; 
  padding:10px 12px; 
  background:#0f162e; 
  color:var(--text); 
  border:1px solid var(--border); 
  border-radius:10px; 
  appearance: none;
  -webkit-appearance: none;
  background-clip: padding-box;
}
input[type="number"]::-webkit-outer-spin-button, 
input[type="number"]::-webkit-inner-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}

.btn { 
  border:1px solid var(--border); 
  background:#0f162e; 
  color:#fff; 
  padding:10px 12px; 
  border-radius:10px; 
  cursor:pointer; 
}
.btn:hover { border-color:var(--accent); }
.btn.secondary { background:transparent; }

.kpi { display:grid; grid-template-columns: repeat(3, 1fr); gap:10px; }
.kpi .item { 
  background:#0f162e; 
  border:1px solid var(--border); 
  border-radius:12px; 
  padding:12px; 
}
.kpi .label { color:var(--muted); font-size:12px; }
.kpi .value { font-size:18px; margin-top:4px; }

.muted { color:var(--muted); font-size:13px; }

/* Fixed-height chart wrapper to prevent infinite growth */
.chart-area { position:relative; height:260px; max-height:60vh; }
.chart-area canvas { display:block; width:100% !important; max-width:100%; height:100% !important; }

/* Clamp any potential overflow from containers */
header, main, footer, .container { max-width: 100%; overflow-x: hidden; }

.debts { display:flex; flex-direction:column; gap:10px; }
.debt { 
  border:1px dashed var(--border); 
  border-radius:12px; 
  padding:10px; 
  background:#0e1530; 
}
.debt .row { align-items:end; }
.debt-header { 
  display:flex; 
  justify-content:space-between; 
  align-items:center; 
  margin-bottom:8px; 
}
.link { color:var(--accent); cursor:pointer; text-decoration:none; }

footer { 
  border-top:1px solid var(--border); 
  color:var(--muted); 
  font-size:12px; 
  padding:24px 0; 
}

/* Educational sections */
.educational-sections {
  margin-top: 16px;
}

.how-to-grid {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.how-to-item {
  padding: 16px;
  background: #374151;
  border-radius: 8px;
  border: 1px solid #4b5563;
}

.how-to-item h3 {
  margin: 0 0 8px 0;
  color: #60a5fa;
  font-size: 16px;
  font-weight: 600;
}

.how-to-item p {
  margin: 0;
  color: #d1d5db;
  line-height: 1.5;
}

.math-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 0;
  transition: color 0.2s ease;
}

.math-toggle:hover {
  color: #60a5fa;
}

.math-arrow {
  transition: transform 0.3s ease;
}

.math-content {
  padding: 16px;
  background: #374151;
  border-radius: 8px;
  border: 1px solid #4b5563;
}

.math-content h4 {
  margin: 0 0 8px 0;
  color: #60a5fa;
  font-size: 16px;
  font-weight: 600;
}

.math-content p {
  margin: 8px 0;
  color: #d1d5db;
  line-height: 1.5;
}

.math-content ul {
  margin: 8px 0;
  padding-left: 20px;
  color: #d1d5db;
}

.math-content li {
  margin: 4px 0;
  line-height: 1.4;
}

.math-content strong {
  color: #f3f4f6;
  font-family: 'Courier New', monospace;
  font-size: 14px;
}

/* Calculator Grid Styles */
.calculator-grid {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.calc-link {
  display: block;
  padding: 16px;
  background: #0e1530;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s ease;
}

.calc-link:hover {
  border-color: var(--accent);
  background: rgba(96,165,250,0.05);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.calc-link h3 {
  margin: 0 0 8px 0;
  color: var(--accent);
  font-size: 16px;
}

.calc-link p {
  margin: 0 0 8px 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}

.calc-features {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.feature {
  padding: 16px;
  background: #0e1530;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.feature h3 {
  margin: 0 0 8px 0;
  color: var(--accent);
  font-size: 16px;
}

.feature p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}

/* Contact Form Styles */
/* Removed duplicate rules - see improved styles below */

.success-message {
  padding: 16px;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid var(--accent-2);
  border-radius: 10px;
  margin-top: 16px;
}

.success-message p {
  margin: 0;
  color: var(--accent-2);
  text-align: center;
}

/* Contact Options */
.contact-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.contact-option {
  padding: 16px;
  background: #0e1530;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.contact-option h3 {
  margin: 0 0 8px 0;
  color: var(--accent);
  font-size: 16px;
}

.contact-option p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}

/* FAQ Styles */
.faq {
  margin-top: 16px;
}

.faq-item {
  padding: 16px;
  background: #0e1530;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
}

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

.faq-item h3 {
  margin: 0 0 8px 0;
  color: var(--accent);
  font-size: 16px;
}

.faq-item p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}

/* Enhanced List Styles */
ul {
  margin: 8px 0;
  padding-left: 20px;
  color: var(--text);
}

li {
  margin: 4px 0;
  line-height: 1.4;
}

/* Enhanced Card Styles for New Pages */
.card h1 {
  margin: 0 0 16px 0;
  font-size: 28px;
  color: var(--text);
}

.card h2 {
  margin: 16px 0 8px 0;
  font-size: 20px;
  color: var(--text);
}

.card h3 {
  margin: 12px 0 6px 0;
  font-size: 16px;
  color: var(--accent);
}

.card p {
  margin: 8px 0;
  line-height: 1.6;
  color: var(--text);
}

/* Mobile Optimizations for New Components */
@media (max-width: 768px) {
  .calculator-grid {
    gap: 12px;
  }
  
  .calc-link {
    padding: 12px;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .contact-options {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .card h1 {
    font-size: 24px;
  }
  
  .card h2 {
    font-size: 18px;
  }
  
  .card h3 {
    font-size: 16px;
  }
}

/* Performance Optimizations */
.chart-area {
  contain: layout style paint;
  will-change: transform;
}

.ad-placeholder {
  contain: layout style paint;
  min-height: 90px;
}

/* Critical CSS for above-the-fold content */
@media (max-width: 768px) {
  .container {
    padding: 12px;
  }
  
  header {
    position: sticky;
    top: 0;
    z-index: 4000; /* Keep header (and dropdown) above main content on mobile */
  }

  /* When mobile menu overlay is open, force header to be top-most and disable filters to avoid iOS compositing bugs */
  body.menu-overlay-open header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2147483646;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: var(--bg);
  }
  
  .brand .site-title {
    font-size: 18px;
  }
  
  .card {
    padding: 12px;
    border-radius: 12px;
  }
}

/* Lazy loading optimizations */
.chart-area canvas {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.chart-area canvas.loaded {
  opacity: 1;
}

/* Fixed heights to prevent CLS */
.chart-area {
  height: 260px;
  min-height: 260px;
  max-height: 60vh;
}

.ad-placeholder {
  height: 90px;
  min-height: 90px;
  max-height: 90px;
}

/* Home Page Specific Styles */
.welcome-section {
  text-align: center;
  padding: 40px 20px;
}

.welcome-section h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-section p {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto 30px;
}

/* Enhanced Button Styles */
.btn {
  display: inline-block;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(96, 165, 250, 0.3);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(96, 165, 250, 0.4);
  background: linear-gradient(135deg, #4f46e5, var(--accent));
}

.btn:active {
  transform: translateY(0);
}

/* Enhanced Card Styles */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

/* Enhanced Calculator Grid for Home Page */
.calculator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.calculator-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.calculator-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.calculator-card:hover::before {
  transform: scaleX(1);
}

.calculator-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.calculator-content h3 {
  margin: 0 0 12px 0;
  font-size: 18px;
  color: var(--text);
}

.calculator-content p {
  margin: 0 0 20px 0;
  color: var(--muted);
  line-height: 1.5;
}

.calculator-actions {
  display: flex;
  gap: 10px;
}

.calculator-actions .btn {
  flex: 1;
  text-align: center;
  padding: 12px 16px;
  font-size: 14px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calculator-actions .btn:hover {
  background: #4f8be8;
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .calculator-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .calculator-card {
    padding: 16px;
  }
  
  .calculator-content h3 {
    font-size: 16px;
  }
  
  .calculator-actions .btn {
    padding: 10px 14px;
    font-size: 13px;
  }
}

/* Enhanced Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.feature {
  padding: 20px;
  background: linear-gradient(135deg, #0e1530, #1a2332);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: all 0.3s ease;
  position: relative;
}

.feature:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  border-color: var(--accent);
}

.feature h3 {
  margin: 0 0 12px 0;
  color: var(--accent);
  font-size: 18px;
  font-weight: 600;
}

.feature p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* Enhanced List Styles */
.card ul {
  margin: 16px 0;
  padding-left: 24px;
}

.card li {
  margin: 8px 0;
  line-height: 1.6;
  color: var(--text);
}

.card li strong {
  color: var(--accent);
  font-weight: 600;
}

/* Mobile Optimizations for Home Page */
@media (max-width: 768px) {
  .welcome-section h1 {
    font-size: 2rem;
  }
  
  .welcome-section p {
    font-size: 1rem;
  }
  
  .calculator-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .calc-link {
    padding: 16px;
  }
  
  .feature {
    padding: 16px;
  }
  
  .card {
    padding: 20px;
  }
}

/* Netlify form honeypot */
.hidden {
  display: none;
}

/* Message form (replaces legacy .contact-form) */
.message-form { max-width: 640px; margin: 0 auto; }
.message-form .mf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 768px) { .message-form .mf-row { grid-template-columns: 1fr; } }
.message-form .mf-group { display: flex; flex-direction: column; gap: 8px; }
.message-form label { font-weight: 500; color: var(--text); font-size: 14px; }
.message-form input,
.message-form select,
.message-form textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0f162e;
  color: var(--text);
  font-size: 16px;
  transition: all 0.2s ease;
  min-height: 44px;
  appearance: none; -webkit-appearance: none; background-clip: padding-box;
}
.message-form input::placeholder, .message-form textarea::placeholder { color: var(--muted); }
.message-form input:focus, .message-form select:focus, .message-form textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(96,165,250,0.1);
}
.message-form input:-webkit-autofill,
.message-form input:-webkit-autofill:hover,
.message-form input:-webkit-autofill:focus,
.message-form textarea:-webkit-autofill,
.message-form select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0px 1000px #0f162e inset;
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  transition: background-color 5000s ease-in-out 0s;
}
.message-form input:-moz-autofill,
.message-form textarea:-moz-autofill,
.message-form select:-moz-autofill {
  box-shadow: 0 0 0px 1000px #0f162e inset;
  -moz-text-fill-color: var(--text);
}
.message-form textarea { resize: vertical; min-height: 140px; font-family: inherit; line-height: 1.5; }
.message-form .mf-actions { margin-top: 4px; }
.message-form .mf-actions .btn { width: 100%; }

/* Contact options */
.contact-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.contact-option {
  padding: 20px;
  background: rgba(96, 165, 250, 0.05);
  border: 1px solid rgba(96, 165, 250, 0.1);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.contact-option:hover {
  background: rgba(96, 165, 250, 0.08);
  border-color: rgba(96, 165, 250, 0.2);
  transform: translateY(-2px);
}

.contact-option h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
  color: var(--accent);
}

.contact-option p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

/* FAQ section */
.faq {
  margin-top: 20px;
}

.faq-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
  color: var(--text);
}

.faq-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

/* Mobile optimizations for contact page */
@media (max-width: 768px) {
  .contact-options {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .contact-option {
    padding: 16px;
  }
  
  .message-form input,
  .message-form select,
  .message-form textarea {
    padding: 12px 14px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .message-form .btn {
    padding: 14px 20px;
    font-size: 16px;
  }
  
  .faq-item {
    padding: 16px 0;
  }
}

/* Calculator Grid */
.calculators-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.calculator-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.calculator-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.calculator-card:hover::before {
  transform: scaleX(1);
}

.calculator-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.calculator-content h3 {
  margin: 0 0 12px 0;
  font-size: 18px;
  color: var(--text);
}

.calculator-content p {
  margin: 0 0 20px 0;
  color: var(--muted);
  line-height: 1.5;
}

.calculator-actions {
  display: flex;
  gap: 10px;
}

.calculator-actions .btn {
  flex: 1;
  text-align: center;
  padding: 12px 16px;
  font-size: 14px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calculator-actions .btn:hover {
  background: #4f8be8;
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .calculators-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .calculator-card {
    padding: 16px;
  }
  
  .calculator-content h3 {
    font-size: 16px;
  }
  
  .calculator-actions .btn {
    padding: 10px 14px;
    font-size: 13px;
  }
}
