/* Finance Tools Hub - fast, mobile-first, no external dependencies */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.6;
  color: #1f2937;
  background: #f8fafc;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header & nav */
header {
  background: #0f172a;
  color: #fff;
  padding: 14px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}
header .wrap {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.logo { font-size: 1.25rem; font-weight: 700; color: #fff; }
.logo span { color: #38bdf8; }
nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
nav a {
  color: #e2e8f0;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}
nav a:hover { color: #fff; text-decoration: none; }

/* Layout */
main { max-width: 960px; margin: 0 auto; padding: 24px 20px 48px; }
.hero { text-align: center; padding: 28px 0 8px; }
.hero h1 { font-size: 2rem; line-height: 1.25; margin-bottom: 10px; }
.hero p { color: #475569; max-width: 640px; margin: 0 auto; font-size: 1.05rem; }
h1 { font-size: 1.8rem; line-height: 1.3; margin-bottom: 10px; }
h2 { font-size: 1.35rem; margin: 32px 0 12px; }
h3 { font-size: 1.05rem; margin: 18px 0 6px; }
p { margin-bottom: 12px; color: #334155; }
ul, ol { margin: 0 0 14px 22px; color: #334155; }
li { margin-bottom: 4px; }

/* Tool cards on homepage */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 28px;
}
.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.card h2, .card h3 { margin-top: 0; }
.card p { font-size: 0.97rem; }
.btn {
  display: inline-block;
  background: #2563eb;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  margin-top: 8px;
}
.btn:hover { background: #1d4ed8; text-decoration: none; }

/* Calculator */
.calc {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  margin: 22px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 0.95rem; }
.field input, .field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 1rem;
}
.field small { color: #64748b; }
.checkbox { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; font-weight: 600; }
.checkbox input { width: 18px; height: 18px; }
.calc button {
  width: 100%;
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 13px;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}
.calc button:hover { background: #1d4ed8; }
.error { color: #dc2626; font-weight: 600; margin-top: 12px; display: none; }

/* Results */
.results { display: none; margin-top: 22px; }
.results.show { display: block; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 14px 0;
}
.stat {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 14px;
}
.stat .label { font-size: 0.85rem; color: #475569; }
.stat .value { font-size: 1.4rem; font-weight: 800; color: #0f172a; }
table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 0.92rem; }
th, td { border: 1px solid #e2e8f0; padding: 8px 10px; text-align: right; }
th { background: #f1f5f9; text-align: right; }
th:first-child, td:first-child { text-align: left; }
.table-wrap { overflow-x: auto; }

/* FAQ */
.faq { margin-top: 14px; }
.faq details {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 10px;
}
.faq summary { font-weight: 600; cursor: pointer; }
.faq p { margin: 8px 0 0; }

/* Footer */
footer {
  border-top: 1px solid #e2e8f0;
  padding: 22px 20px;
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
}
footer a { color: #475569; margin: 0 10px; }
.note { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 12px 16px; font-size: 0.93rem; }
@media (max-width: 600px) {
  .hero h1, h1 { font-size: 1.5rem; }
  nav { gap: 6px; }
  nav a { padding: 6px 11px; font-size: 0.85rem; }
}

/* ---------- UI polish: lightweight CSS-only effects (no JS, no speed cost) ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
main { animation: fadeUp 0.45s ease backwards; }

/* Header depth */
header { box-shadow: 0 2px 10px rgba(0,0,0,0.25); }

/* Nav pill button hover */
nav a { transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease, color 0.2s ease; }
nav a:hover {
  background: rgba(56,189,248,0.18);
  border-color: rgba(56,189,248,0.5);
  transform: translateY(-1px);
}

/* Cards lift on hover + staggered fade-in */
.card { transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.10);
  border-color: #bfdbfe;
}
.grid .card { animation: fadeUp 0.5s ease backwards; }
.grid .card:nth-child(2) { animation-delay: 0.05s; }
.grid .card:nth-child(3) { animation-delay: 0.1s; }
.grid .card:nth-child(4) { animation-delay: 0.15s; }
.grid .card:nth-child(5) { animation-delay: 0.2s; }
.grid .card:nth-child(6) { animation-delay: 0.25s; }

/* Buttons */
.btn, .calc button { transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease; }
.btn:hover, .calc button:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(37,99,235,0.25); }
.calc button:active, .btn:active { transform: scale(0.98); }

/* Inputs glow on focus */
.field input:focus, .field select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

/* Results fade/slide in */
.results.show { animation: fadeUp 0.4s ease backwards; }

/* Stats + table rows */
.stat { transition: transform 0.2s ease; }
.stat:hover { transform: translateY(-2px); }
tbody tr { transition: background 0.15s ease; }
tbody tr:hover { background: #f8fafc; }

/* FAQ */
.faq summary { transition: color 0.2s ease; }
.faq summary:hover { color: #2563eb; }
.faq details[open] summary { color: #1d4ed8; }

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Card buttons: bottom-centered alignment (cards are equal height in a row,
   so margin-top:auto pushes every button to the same bottom line) */
.card { display: flex; flex-direction: column; }
.card .btn { align-self: center; margin-top: auto; }
