/* DolWise - Shared Styles */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent: #0ea5e9;
  --success: #059669;
  --warning: #b45309;
  --danger: #dc2626;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.10);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  --max-width: 1200px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Typography */
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); font-weight: 700; line-height: 1.3; }
h4 { font-size: 1rem; font-weight: 700; }

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

/* Layout */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
}
.logo { font-size: 1.4rem; font-weight: 800; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.logo svg { width: 28px; height: 28px; }
.logo:hover { text-decoration: none; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
}
.nav a:hover, .nav a.active { color: var(--primary); background: var(--primary-light); text-decoration: none; }
.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; padding: 8px; }

/* Hero */
.hero {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #0ea5e9 100%);
  color: #fff;
  padding: 80px 0 64px;
  text-align: center;
}
.hero h1 { margin-bottom: 16px; color: #fff; }
.hero p { font-size: 1.15rem; max-width: 640px; margin: 0 auto 32px; opacity: 0.92; line-height: 1.7; }
.hero-search {
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}
.hero-search input {
  width: 100%;
  padding: 16px 56px 16px 20px;
  font-size: 1.05rem;
  border: 2px solid transparent;
  border-radius: 50px;
  background: rgba(255,255,255,0.95);
  color: var(--text);
  outline: none;
  transition: all 0.2s;
}
.hero-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(14,165,233,0.25); }
.hero-search input::placeholder { color: var(--text-muted); }
.hero-search button {
  position: absolute;
  right: 4px;
  top: 4px;
  bottom: 4px;
  width: 48px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.hero-search button:hover { background: var(--primary-dark); }
.hero-tools { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-tools a {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  color: #fff;
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 0.88rem;
  transition: all 0.15s;
  border: 1px solid rgba(255,255,255,0.2);
}
.hero-tools a:hover { background: rgba(255,255,255,0.25); text-decoration: none; }

/* Sections */
.section { padding: 64px 0; }
.section-header { text-align: center; margin-bottom: 40px; }
.section-header h2 { margin-bottom: 8px; }
.section-header p { color: var(--text-secondary); font-size: 1.05rem; max-width: 560px; margin: 0 auto; }

/* Tool Cards */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}
.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}
.tool-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 16px;
}
.tool-card-icon.finance { background: #dbeafe; color: #2563eb; }
.tool-card-icon.business { background: #dcfce7; color: #059669; }
.tool-card-icon.home { background: #fef3c7; color: #d97706; }
.tool-card-icon.tax { background: #fce7f3; color: #db2777; }
.tool-card-icon.career { background: #e0e7ff; color: #4f46e5; }
.tool-card-icon.loan { background: #ffe4e6; color: #e11d48; }

.tool-card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.tool-card p { color: var(--text-secondary); font-size: 0.88rem; flex: 1; margin-bottom: 12px; }
.tool-card .tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
}

/* Category Section */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 16px;
}
.cat-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); text-decoration: none; }
.cat-card .icon { font-size: 2rem; }
.cat-card .info h4 { font-size: 0.95rem; }
.cat-card .info span { font-size: 0.8rem; color: var(--text-secondary); }

/* Trust Section */
.trust-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.trust-item { text-align: center; padding: 20px; }
.trust-item .icon { font-size: 2rem; margin-bottom: 8px; }
.trust-item h4 { font-size: 0.95rem; margin-bottom: 4px; }
.trust-item p { color: var(--text-secondary); font-size: 0.85rem; }

/* Footer */
.site-footer {
  background: #1e293b;
  color: #cbd5e1;
  padding: 48px 0 24px;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 32px; margin-bottom: 32px; }
.footer-col h4 { color: #fff; font-size: 0.9rem; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.footer-col a { display: block; color: #94a3b8; font-size: 0.85rem; padding: 4px 0; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid #475569;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.82rem;
  color: #94a3b8;
}

/* Calculator Tool Page */
.tool-page { padding: 40px 0 64px; }
.tool-layout { display: grid; grid-template-columns: 1fr 340px; gap: 32px; max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.tool-main { min-width: 0; }
.tool-sidebar { min-width: 0; }
.tool-intro { margin-bottom: 28px; }
.tool-intro h1 { margin-bottom: 12px; }
.tool-intro p { color: var(--text-secondary); font-size: 1.05rem; max-width: 700px; }

/* Calc Form */
.calc-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 28px;
}
.calc-form h3 { margin-bottom: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-weight: 600; font-size: 0.88rem; color: var(--text); }
.form-group .hint { font-size: 0.78rem; color: var(--text-muted); }
.form-group input, .form-group select {
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: var(--font);
  transition: border-color 0.15s;
  background: var(--bg);
}
.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.form-group .input-prefix, .form-group .input-suffix {
  position: relative;
}
.form-group .input-prefix::before,
.form-group .input-suffix::after {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  pointer-events: none;
}
.form-group .input-prefix input { padding-left: 32px; }
.form-group .input-prefix.dollar::before { content: '$'; left: 14px; }
.form-group .input-suffix.percent::after { content: '%'; right: 14px; }
.form-group .input-suffix input { padding-right: 32px; }
.form-group input.error { border-color: var(--danger); }
.form-group .error-msg { font-size: 0.78rem; color: var(--danger); display: none; }
.form-group input.error + .error-msg { display: block; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font);
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-actions { display: flex; gap: 12px; margin-top: 20px; }

/* Results */
.results {
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  border-radius: var(--radius);
  padding: 28px;
  color: #fff;
  margin-bottom: 28px;
  display: none;
}
.results.show { display: block; }
.results h3 { color: #fff; margin-bottom: 16px; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.result-item {
  background: rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  padding: 16px;
}
.result-item .label { font-size: 0.78rem; opacity: 0.8; margin-bottom: 4px; }
.result-item .value { font-size: 1.4rem; font-weight: 800; }
.result-breakdown th,.result-breakdown td,.result-item .label { color: rgba(255,255,255,0.9); }
.result-breakdown td { color: #fff; font-weight: 600; }
.result-breakdown { margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.2); }
.result-breakdown table { width: 100%; color: #fff; font-size: 0.9rem; }
.result-breakdown th, .result-breakdown td { padding: 6px 0; text-align: left; }
.result-breakdown th { font-weight: 600; opacity: 0.8; }

/* Disclaimers */
.disclaimer {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 0.82rem;
  color: #9a3412;
  margin-top: 16px;
}
.disclaimer strong { color: #7c2d12; }

/* Content sections */
.content-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
}
.content-block h2 { font-size: 1.25rem; margin-bottom: 12px; }
.content-block h3 { font-size: 1.1rem; margin-bottom: 10px; }
.content-block p { color: var(--text-secondary); margin-bottom: 12px; line-height: 1.7; }
.content-block p:last-child { margin-bottom: 0; }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--border); padding: 16px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-item h3 { font-size: 1rem; margin-bottom: 6px; cursor: pointer; }
.faq-item p { color: var(--text-secondary); font-size: 0.9rem; }

/* Ad Placeholder */
.ad-placeholder {
  background: #f1f5f9;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  margin: 24px 0;
}
.ad-placeholder.sidebar { margin: 0 0 20px; padding: 180px 24px; }

/* Breadcrumb */
.breadcrumb { display: flex; gap: 8px; align-items: center; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; flex-wrap: wrap; }
.breadcrumb a { color: var(--primary); }
.breadcrumb span { color: var(--text-secondary); }

/* Related Tools */
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.related-item { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; transition: all 0.15s; }
.related-item:hover { border-color: var(--primary); text-decoration: none; }
.related-item h4 { font-size: 0.92rem; }
.related-item p { font-size: 0.8rem; color: var(--text-secondary); }

/* Static Pages */
.static-page { max-width: 800px; margin: 0 auto; padding: 48px 20px 64px; }
.static-page h1 { margin-bottom: 8px; }
.static-page h2 { margin: 32px 0 12px; }
.static-page p, .static-page li { color: var(--text-secondary); margin-bottom: 12px; line-height: 1.7; }
.static-page .last-updated { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 24px; }

/* Responsive */
@media (max-width: 900px) {
  .tool-layout { grid-template-columns: 1fr; }
  .tool-sidebar .ad-placeholder.sidebar { display: none; }
}
@media (max-width: 768px) {
  .ad-placeholder { min-height: 90px; }
  .ad-placeholder.sidebar { min-height: 250px; }
  .hero { padding: 48px 0 40px; }
  .hero h1 { font-size: 1.75rem; }
  .nav a { padding: 6px 10px; font-size: 0.82rem; }
  .form-row { grid-template-columns: 1fr; }
  .section { padding: 40px 0; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .result-grid { grid-template-columns: 1fr; }
  .header-inner { height: 56px; }
  .site-header .nav { display: none; }
  .static-page .nav, .static-page .mobile-menu-btn { display: none; }
  .site-header .nav.open { 
    display: flex; 
    flex-direction: column; 
    position: absolute; 
    top: 56px; 
    left: 0; 
    right: 0; 
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px;
    box-shadow: var(--shadow-lg);
  }
  .mobile-menu-btn { display: block; }
}

@media (max-width: 480px) {
  .hero-tools { display: none; }
  .tool-grid { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: 1fr; }
  .trust-grid { grid-template-columns: 1fr; }
  .calc-form { padding: 20px; }
}

/* Print */
@media print {
  .site-header, .site-footer, .ad-placeholder, .tool-sidebar, .btn, .hero { display: none !important; }
  body { background: #fff; }
  .tool-layout { grid-template-columns: 1fr; }
}

/* Focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Static pages — mobile menu button */
@media (max-width: 768px) {
  .static-page .mobile-menu-btn { display: block; }
}

/* Caption — visually hidden but accessible */
.caption-sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Assessment text inside blue gradient results — white text */
.results .result-breakdown td,
.results .result-breakdown th,
#assessment { color: #fff; }
#assessment span { color: #fff !important; }
