/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6; color: #1a1a2e; background: #f8f9fc;
  display: flex; flex-direction: column; min-height: 100vh;
}
img { max-width: 100%; height: auto; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== CONTAINER ===== */
.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

/* ===== HEADER ===== */
.header {
  background: #fff; border-bottom: 1px solid #e5e7eb;
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; max-width: 1140px; margin: 0 auto;
}
.logo { font-size: 1.25rem; font-weight: 700; color: #1a1a2e; display: flex; align-items: center; gap: 8px; }
.logo:hover { text-decoration: none; color: #2563eb; }
.logo-icon { width: 32px; height: 32px; background: #2563eb; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.1rem; font-weight: 800; }
.nav { display: flex; gap: 24px; align-items: center; }
.nav a { color: #4b5563; font-size: 0.9rem; font-weight: 500; }
.nav a:hover { color: #2563eb; text-decoration: none; }

/* ===== FOOTER ===== */
.footer {
  background: #1a1a2e; color: #9ca3af; padding: 40px 0; margin-top: auto;
}
.footer-inner { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; margin-bottom: 32px; }
.footer h3 { color: #fff; font-size: 0.95rem; margin-bottom: 12px; }
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 8px; }
.footer ul li a { color: #9ca3af; font-size: 0.85rem; }
.footer ul li a:hover { color: #fff; text-decoration: none; }
.footer-bottom { border-top: 1px solid #374151; padding-top: 20px; font-size: 0.8rem; text-align: center; }

/* ===== HOMEPAGE ===== */
.hero { text-align: center; padding: 48px 20px 32px; }
.hero h1 { font-size: 2rem; color: #1a1a2e; margin-bottom: 12px; }
.hero p { font-size: 1.05rem; color: #6b7280; max-width: 600px; margin: 0 auto; }

/* Category groups — visual sections that separate tool categories */
.category-group {
  background: #f4f5f9;
  border-radius: 16px;
  padding: 36px 28px 28px;
  margin: 0 auto 28px;
  max-width: 1140px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.category-header {
  margin-bottom: 24px;
  padding-left: 16px;
  border-left: 4px solid #2563eb;
}
.category-header.financial { border-color: #2563eb; }
.category-header.health { border-color: #10b981; }
.category-header.utility { border-color: #8b5cf6; }

.category-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 4px;
}
.category-subtitle {
  color: #6b7280;
  font-size: 0.92rem;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.tool-grid--centered {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}
.tool-grid--centered .tool-card {
  flex: 0 1 280px;
  min-width: 240px;
}
.tool-card {
  background: #fff; border-radius: 12px; padding: 24px;
  border: 1px solid #e5e7eb; transition: all 0.25s ease;
  display: flex; flex-direction: column; align-items: flex-start;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.tool-card:hover { border-color: #2563eb; box-shadow: 0 4px 16px rgba(37,99,235,0.1); transform: translateY(-3px); text-decoration: none; }
.tool-card-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; font-weight: 700; margin-bottom: 14px;
}
.tool-card h2 { font-size: 1rem; color: #1a1a2e; margin-bottom: 6px; }
.tool-card p { font-size: 0.84rem; color: #6b7280; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ===== TOOL PAGE LAYOUT ===== */
.tool-page { max-width: 1140px; margin: 0 auto; padding: 32px 20px; }
.tool-page h1 { font-size: 1.75rem; margin-bottom: 8px; color: #1a1a2e; }
.tool-intro { color: #6b7280; font-size: 1rem; margin-bottom: 28px; max-width: 720px; }

.tool-layout { display: grid; grid-template-columns: 1fr 360px; gap: 32px; align-items: start; }
@media (max-width: 860px) { .tool-layout { grid-template-columns: 1fr; } }

.tool-main { min-width: 0; }
.tool-sidebar { position: sticky; top: 88px; }

/* ===== CALCULATOR FORM ===== */
.calc-card {
  background: #fff; border-radius: 12px; border: 1px solid #e5e7eb; padding: 28px;
  margin-bottom: 28px;
}
.calc-card h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 20px; color: #1a1a2e; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.88rem; font-weight: 500; color: #374151; margin-bottom: 4px; }
.form-group .input-wrap { position: relative; }
.form-group input, .form-group select {
  width: 100%; padding: 10px 14px; border: 1px solid #d1d5db; border-radius: 8px;
  font-size: 0.95rem; font-family: inherit; color: #1a1a2e; background: #fff;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.form-group .prefix { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #6b7280; font-size: 0.9rem; pointer-events: none; }
.form-group input.prefixed { padding-left: 28px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 24px; border-radius: 8px; font-size: 0.95rem; font-weight: 600;
  font-family: inherit; border: none; cursor: pointer; transition: all 0.2s;
}
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #f3f4f6; color: #374151; }
.btn-secondary:hover { background: #e5e7eb; }
.btn-success { background: #059669; color: #fff; }
.btn-success:hover { background: #047857; }
.btn-group { display: flex; gap: 10px; margin-top: 4px; flex-wrap: wrap; }

/* ===== RESULTS ===== */
.result-box {
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; padding: 20px;
  margin-top: 16px; display: none;
}
.result-box.visible { display: block; }
.result-value { font-size: 1.75rem; font-weight: 700; color: #059669; margin-bottom: 4px; }
.result-label { font-size: 0.85rem; color: #6b7280; }
.result-details { margin-top: 12px; padding-top: 12px; border-top: 1px solid #bbf7d0; }
.result-details div { display: flex; justify-content: space-between; padding: 4px 0; font-size: 0.9rem; }
.result-details .label { color: #6b7280; }
.result-details .value { font-weight: 600; color: #1a1a2e; }

.ad-placeholder {
  background: #f3f4f6; border-radius: 8px; min-height: 250px;
  display: flex; align-items: center; justify-content: center;
  color: #9ca3af; font-size: 0.85rem; margin-bottom: 20px;
  border: 1px dashed #d1d5db;
}

/* ===== CONTENT SECTIONS ===== */
.content-section {
  background: #fff; border-radius: 12px; border: 1px solid #e5e7eb; padding: 28px;
  margin-bottom: 20px;
}
.content-section h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: 14px; color: #1a1a2e; }
.content-section h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 10px; color: #1a1a2e; margin-top: 20px; }
.content-section h3:first-child { margin-top: 0; }
.content-section p { color: #4b5563; margin-bottom: 12px; font-size: 0.95rem; }
.content-section ul, .content-section ol { color: #4b5563; margin-bottom: 12px; padding-left: 20px; font-size: 0.95rem; }
.content-section li { margin-bottom: 6px; }
.content-section .formula-box {
  background: #f8f9fc; border: 1px solid #e5e7eb; border-radius: 8px;
  padding: 16px; font-family: 'Courier New', monospace; font-size: 0.9rem;
  margin: 12px 0; overflow-x: auto;
}

/* ===== FAQ ACCORDION ===== */
.faq-item { border-bottom: 1px solid #e5e7eb; }
.faq-question {
  width: 100%; padding: 14px 0; display: flex; justify-content: space-between;
  align-items: center; background: none; border: none; cursor: pointer;
  font-size: 0.95rem; font-weight: 500; color: #1a1a2e; text-align: left; font-family: inherit;
}
.faq-question:hover { color: #2563eb; }
.faq-question .arrow { transition: transform 0.2s; font-size: 0.85rem; }
.faq-item.open .faq-question .arrow { transform: rotate(180deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.faq-item.open .faq-answer { max-height: 500px; }
.faq-answer-inner { padding: 0 0 14px; color: #6b7280; font-size: 0.9rem; line-height: 1.6; }

/* ===== INFO PAGES ===== */
.info-page { max-width: 800px; margin: 0 auto; padding: 40px 20px; }
.info-page h1 { font-size: 1.75rem; margin-bottom: 24px; }
.info-page h2 { font-size: 1.2rem; margin-top: 28px; margin-bottom: 12px; }
.info-page p { color: #4b5563; margin-bottom: 14px; line-height: 1.7; }
.info-page ul { color: #4b5563; margin-bottom: 14px; padding-left: 20px; }
.info-page li { margin-bottom: 6px; }

/* ===== BREADCRUMB ===== */
.breadcrumb { font-size: 0.82rem; color: #9ca3af; margin-bottom: 12px; }
.breadcrumb a { color: #6b7280; }
.breadcrumb a:hover { color: #2563eb; }
.breadcrumb span { color: #9ca3af; }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .hero h1 { font-size: 1.5rem; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-grid--centered .tool-card { flex: 1 1 100%; min-width: 0; }
  .tool-page h1 { font-size: 1.4rem; }
  .calc-card { padding: 20px; }
  .content-section { padding: 20px; }
  .header-inner { padding: 10px 16px; }
  .nav { gap: 14px; }
  .nav a { font-size: 0.82rem; }
  .result-value { font-size: 1.35rem; }
  .category-group { padding: 24px 16px 20px; margin: 0 12px 20px; border-radius: 12px; }
  .category-header { margin-bottom: 16px; padding-left: 12px; }
  .category-title { font-size: 1.15rem; }
  .hero { padding: 32px 16px 24px; }
}
