/* ============================================================
   learn-article-components.css
   Reusable components shared by 2 or more articles.
   Load AFTER learn-article.css on articles that need them.

   <link rel="stylesheet" href="/assets/css/learn-article.css">
   <link rel="stylesheet" href="/assets/css/learn-article-components.css">

   WHICH ARTICLES NEED THIS FILE:
   ✅ how-to-compute-13th-month-pay      (formula, step, example, mini-calc, amort)
   ✅ how-to-compute-electric-consumption (formula, step, example, mini-calc)
   ✅ how-to-set-and-reach-savings-goal  (step cards only)
   ============================================================ */

/* ── Formula Box ───────────────────────────────────────────── */
/* Used by: 13th-month-pay, electric-consumption */
.formula-box {
  background: var(--ink); color: #fff;
  border-radius: 14px; padding: 28px;
  text-align: center; margin: 2rem 0;
}
.formula-box .formula-main {
  font-size: 1.5rem; font-weight: 800;
  color: var(--accent); margin-bottom: 10px;
  letter-spacing: .02em; line-height: 1.5;
}
.formula-box .formula-desc {
  font-size: .875rem; color: rgba(255,255,255,.6); line-height: 1.8;
}

/* ── Step Cards ────────────────────────────────────────────── */
/* Used by: 13th-month-pay, electric-consumption, savings-goal */
.step-card {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: 16px; padding: 28px;
  margin: 1.5rem 0; position: relative;
}
.step-badge {
  position: absolute; top: -14px; left: 24px;
  background: var(--ink); color: var(--accent);
  font-size: .68rem; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 14px; border-radius: 999px;
}
.step-card h3 { font-size: 1.1rem; font-weight: 800; color: var(--ink); margin: 0 0 10px; }
.step-card p  { font-size: .9rem; margin-bottom: 0; }

/* ── Worked Example Boxes ──────────────────────────────────── */
/* Used by: 13th-month-pay, electric-consumption */
/* NOTE: percentage article has its own different .example-box — keep separate */
.example-box {
  background: #f9fafb; border-radius: 12px;
  padding: 20px 24px; margin: 1.5rem 0;
}
.example-box .ex-label {
  font-size: .7rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 12px;
}
.ex-line {
  display: flex; justify-content: space-between;
  align-items: center; padding: 6px 0;
  border-bottom: 1px solid var(--border); font-size: .875rem;
}
.ex-line:last-child { border-bottom: none; }
.ex-line.total {
  font-weight: 800; font-size: 1rem;
  border-top: 2px solid var(--ink);
  margin-top: 4px; padding-top: 10px; border-bottom: none;
}
.ex-line .val { font-weight: 600; }
.ex-answer {
  background: #d1fae5; border-radius: 8px;
  padding: 12px 16px; font-weight: 700;
  color: #065f46; margin-top: 12px;
  font-size: .95rem; text-align: center;
}

/* ── Mini Inline Calculator ────────────────────────────────── */
/* Used by: 13th-month-pay, electric-consumption */
.mini-calc {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: 16px; padding: 28px; margin: 2rem 0;
}
.mini-calc h3 { font-size: 1rem; font-weight: 800; color: var(--ink); margin-bottom: 16px; }
.mini-calc .result-box {
  background: #f0fdf4; border: 1.5px solid #22c55e;
  border-radius: 10px; padding: 16px;
  text-align: center; margin-top: 16px; display: none;
}
.mini-calc .result-box .result-label { font-size: .75rem; color: var(--muted); margin-bottom: 4px; }
.mini-calc .result-box .result-value { font-size: 1.75rem; font-weight: 800; color: #15803d; }
.mini-calc .result-box .result-detail { font-size: .8rem; color: var(--muted); margin-top: 6px; }

/* ── Amortization Visual Bars ──────────────────────────────── */
/* Used by: loan-amortization only — kept here since it's a visual component */
.amort-bar {
  height: 32px; border-radius: 6px; overflow: hidden; display: flex;
}
.amort-interest  { background: #ef4444; }
.amort-principal { background: #22c55e; }
.bar-label {
  font-size: .75rem; font-weight: 600;
  display: flex; align-items: center; gap: 6px; margin-top: 6px;
}
.dot {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}