/* ============================================
   QuickCalcs — shared design system
   Light, cheerful, mobile-first.
   ============================================ */

:root {
  --paper: #F5F9FB;
  --card: #FFFFFF;
  --ink: #23303A;
  --ink-soft: #64737D;
  --line: #E1EAEF;

  --finance: #F2A93B;
  --finance-soft: #FFF3D9;
  --finance-ink: #8A5A00;

  --health: #29B583;
  --health-soft: #DEFBEF;
  --health-ink: #0E7A54;

  --utility: #3E97D1;
  --utility-soft: #E4F3FC;
  --utility-ink: #1D6699;

  --fun: #FF6F91;
  --fun-soft: #FFE4EC;
  --fun-ink: #C43D63;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 4px 16px rgba(35, 48, 58, 0.08);
  --shadow-hover: 0 8px 24px rgba(35, 48, 58, 0.12);

  --font-display: 'Baloo 2', 'Inter', sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.2;
}

p { margin: 0 0 12px; color: var(--ink-soft); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--ink);
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--finance), var(--fun));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--ink);
  padding: 4px 8px;
}

.main-nav {
  display: flex;
  gap: 4px;
}

.main-nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.main-nav a:hover { background: var(--paper); color: var(--ink); }

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.dot-finance { background: var(--finance); }
.dot-health { background: var(--health); }
.dot-utility { background: var(--utility); }
.dot-fun { background: var(--fun); }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 8px 16px 16px;
    display: none;
    gap: 2px;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 14px; border-radius: 12px; }
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  max-width: 720px;
  margin: 16px auto 0;
  padding: 0 20px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.breadcrumb a:hover { text-decoration: underline; }

/* ---------- Ad slot ---------- */
.promo-slot {
  max-width: 720px;
  margin: 20px auto;
  padding: 0 20px;
}
.promo-slot-inner {
  border: 2px dashed #C7D3DA;
  border-radius: var(--radius-sm);
  background: #FBFCFD;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  padding: 10px;
  text-align: center;
}
.promo-slot-inner span { opacity: 0.7; }
.promo-slot.promo-rect .promo-slot-inner { min-height: 250px; }

/* ---------- Page containers ---------- */
.page-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 20px 60px;
}

.tool-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 12px 0 22px;
}

.tool-monogram {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
}

.tool-header p { margin: 0; }

/* ---------- Card / calculator ---------- */
.calc-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 20px;
}

.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: var(--ink);
}
.field-row {
  display: flex;
  gap: 12px;
}
.field-row .field { flex: 1; }

input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--utility);
  background: #fff;
}
textarea { resize: vertical; min-height: 120px; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.92rem;
  font-weight: 500;
}
.checkbox-row input { width: auto; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 100px;
  padding: 14px 24px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
  color: #fff;
  transition: transform 0.08s ease, box-shadow 0.15s ease;
}
.btn:active { transform: scale(0.98); }

.result-box {
  margin-top: 18px;
  border-radius: var(--radius-sm);
  padding: 18px;
  display: none;
}
.result-box.show { display: block; }
.result-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.8;
  margin-bottom: 4px;
}
.result-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.9rem;
  line-height: 1.2;
}
.result-sub {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  margin-top: 6px;
  opacity: 0.85;
}
.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}
.result-grid .result-item .result-label { font-size: 0.7rem; }
.result-grid .result-item .result-value { font-size: 1.2rem; }

.note {
  font-size: 0.82rem;
  color: var(--ink-soft);
  background: var(--paper);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

/* theme helpers reused per category */
.theme-finance .result-box, .theme-finance .btn { background: var(--finance-soft); color: var(--finance-ink); }
.theme-finance .btn { background: var(--finance); color: #fff; }
.theme-finance .tool-monogram { background: var(--finance); }

.theme-health .result-box, .theme-health .btn { background: var(--health-soft); color: var(--health-ink); }
.theme-health .btn { background: var(--health); color: #fff; }
.theme-health .tool-monogram { background: var(--health); }

.theme-utility .result-box, .theme-utility .btn { background: var(--utility-soft); color: var(--utility-ink); }
.theme-utility .btn { background: var(--utility); color: #fff; }
.theme-utility .tool-monogram { background: var(--utility); }

.theme-fun .result-box, .theme-fun .btn { background: var(--fun-soft); color: var(--fun-ink); }
.theme-fun .btn { background: var(--fun); color: #fff; }
.theme-fun .tool-monogram { background: var(--fun); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: #C9D3D8;
  margin-top: 40px;
  padding: 32px 20px;
  text-align: center;
  font-size: 0.85rem;
}
.site-footer .logo { color: #fff; justify-content: center; margin-bottom: 10px; }
.site-footer a:hover { color: #fff; text-decoration: underline; }

/* ---------- Home page ---------- */
.hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 20px 10px;
  text-align: center;
}
.hero h1 { font-size: 2.2rem; }
.hero p { max-width: 480px; margin: 0 auto 20px; font-size: 1.05rem; }

.stat-bar {
  background: var(--ink);
  border-radius: var(--radius);
  max-width: 900px;
  margin: 20px auto 0;
  padding: 18px 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.stat {
  flex: 1;
  min-width: 130px;
  text-align: center;
  padding: 8px 14px;
  border-right: 1px dashed rgba(255,255,255,0.2);
}
.stat:last-child { border-right: none; }
.stat-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.3rem;
  color: #FFD98A;
}
.stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #A9B7C0;
  margin-top: 2px;
}

.section-block { max-width: 1080px; margin: 0 auto; padding: 36px 20px 0; }
.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.section-heading .nav-dot { width: 12px; height: 12px; }
.section-heading h2 { margin: 0; font-size: 1.4rem; }
.section-sub { margin-bottom: 18px; font-size: 0.92rem; }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.tool-card {
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.tool-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.tool-card h3 { font-size: 0.98rem; margin-bottom: 2px; }
.tool-card p { font-size: 0.82rem; margin: 0; }
.tool-card .tool-monogram { width: 40px; height: 40px; font-size: 0.85rem; border-radius: 10px; }

@media (max-width: 480px) {
  .hero h1 { font-size: 1.7rem; }
  .stat { min-width: 45%; border-right: none; }
}
