/* ============================================================
   calculators.css — Calculator-specific styles for forsuccess.today
   Always loaded together with assets/main.css.
   main.css  →  tokens, reset, header, hero, card, buttons, footer
   this file →  two-col layout, forms, results, quiz components,
                insights, FAQ, related tools, specialized lists
   ============================================================ */

/* ── Two-Column Calculator Layout ───────────────────────── */
.two-col { display: grid; gap: 24px; }
@media (min-width: 768px) { .two-col { grid-template-columns: 1fr 1fr; } }

/* ── Form — Base ────────────────────────────────────────── */
.form-group       { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; font-size: .9rem; color: var(--subtle, #374151); margin-bottom: 6px; }
/* Slider groups: flex gap avoids margin-collapse; label spacing is handled by gap, not margin */
.form-group:has(.slider-row),
.form-group:has(.range-row) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}
.form-group:has(.slider-row) > label,
.form-group:has(.range-row) > label { margin-bottom: 0; }
.hint             { font-size: .8rem; color: var(--muted); margin-top: 4px; }

/* .num-input has its own width (pill or narrow field); exclude from full-width number rule */
input[type=number]:not(.num-input),
input[type=text],
input[type=date],
input[type=time],
select {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  color: var(--text);
  background: var(--white);
  transition: border-color .2s;
  -moz-appearance: textfield;
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button { -webkit-appearance: none; }
input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

/* ── Form — Range Slider (shared Health / Money / Productivity style) ── */
/* Health: .range-row + range input + .range-val pill
   Money: .slider-row + .range-input + .num-input (pill matches .range-val below) */
input[type=range] {
  width: 100%;
  max-width: 100%;
  cursor: pointer;
  accent-color: var(--primary);
  min-height: 28px;
  height: auto;
  vertical-align: middle;
  box-sizing: border-box;
}

/* One row layout for all calculator sliders */
.range-row,
.slider-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
  padding-top: 10px;
  padding-bottom: 10px;
  min-height: 36px;
  position: relative;
  z-index: 1;
}
.range-input {
  flex: 1 1 auto;
  min-width: 0;
  accent-color: var(--primary);
}

/* Value pill (Health) — same look as editable numeric pill (Money slider rows) */
.range-val {
  background: #eff6ff;
  color: var(--primary);
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.875rem;
  min-width: 4.5rem;
  max-width: 12rem;
  text-align: center;
  flex-shrink: 0;
  line-height: 1.25;
}

/* Inline number in slider row: same pill as .range-val (Health calculators) */
.slider-row .num-input {
  width: auto !important; /* override inline width on some tools */
  min-width: 4.5rem;
  max-width: 12rem;
  flex-shrink: 0;
  padding: 6px 14px;
  border: none;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 700;
  text-align: center;
  color: var(--primary);
  background: #eff6ff;
  box-shadow: none;
}
.slider-row .num-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
  border-color: transparent;
}
.slider-row .num-input:hover {
  background: #dbeafe;
}

/* Standalone numeric fields (not beside a range) — keep bordered field */
.num-input {
  width: 90px;
  min-width: 90px;
  flex-shrink: 0;
  padding: 9px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  text-align: right;
  color: var(--text);
  background: var(--white);
}
.num-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ── Form — Select Arrow ────────────────────────────────── */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ── Form — Radio Pill Options ──────────────────────────── */
.radio-group  { display: flex; flex-wrap: wrap; gap: 10px; }
.radio-option {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 500;
  transition: all .2s;
  color: #374151;
}
.radio-option:has(input:checked) { border-color: var(--primary); background: #eff6ff; color: var(--primary); font-weight: 600; }
.radio-option input              { accent-color: var(--primary); }
/* Column variant */
.radio-group.col    { flex-direction: column; gap: 8px; }

/* ── Form — Checkbox Grid Options ───────────────────────── */
.checkbox-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.check-opt,
.check-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: .85rem;
  transition: all .2s;
  color: #374151;
}
.check-opt:has(input:checked),
.check-option:has(input:checked) {
  border-color: var(--primary);
  background: #eff6ff;
  color: var(--primary);
  font-weight: 600;
}
.check-opt input,
.check-option input { accent-color: var(--primary); }

/* ── Result Card ────────────────────────────────────────── */
.result-card {
  border-radius: var(--radius);
  border: 2px solid #bfdbfe;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  padding: 28px;
  margin-bottom: 24px;
  transition: all .3s;
}
.result-card.hidden { display: none !important; }
.result-card h2     { font-size: 1.1rem; color: var(--accent); font-weight: 700; margin-bottom: 16px; }

.result-main   { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
#resultValue   { font-size: 3.5rem; font-weight: 800; color: var(--primary); line-height: 1; }
.result-unit   { font-size: 1rem; color: var(--muted); font-weight: 600; margin-bottom: 16px; }
.result-number { font-size: 3.5rem; font-weight: 800; color: var(--primary); line-height: 1; margin-bottom: 4px; }

.progress-bar  { background: #bfdbfe; border-radius: 100px; height: 10px; overflow: hidden; margin: 16px 0; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 100px; transition: width .8s ease; width: 0; }

#resultExplanation { color: #374151; font-size: .95rem; line-height: 1.7; margin-top: 8px; }

.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 16px 0; }
.result-stat { background: rgba(255,255,255,.75); border-radius: 8px; padding: 12px; text-align: center; }
.result-stat .s-label,
.result-stat .s-lab   { font-size: .72rem; color: #6b7280; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.result-stat .s-value,
.result-stat .s-val   { font-size: 1.3rem; font-weight: 800; color: var(--accent); margin-top: 2px; }

/* Highlight pulse on result reveal */
@keyframes highlight {
  0%   { box-shadow: 0 0 0 0   rgba(37,99,235,.4); }
  70%  { box-shadow: 0 0 0 12px rgba(37,99,235,0); }
  100% { box-shadow: 0 0 0 0   rgba(37,99,235,0); }
}
.result-card.highlight { animation: highlight .7s ease; }

/* ── Dimension Bars (burnout, promotion, decision-fatigue) ── */
.dim-section { margin-top: 14px; }
.dim-label {
  display: flex;
  justify-content: space-between;
  font-size: .8rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
  margin-top: 10px;
}
.dim-bar  { background: #e0e7ff; border-radius: 999px; height: 7px; overflow: hidden; }
.dim-fill { height: 100%; border-radius: 999px; transition: width .7s ease; }

/* Burnout-test bar variant */
.dim-bars              { margin: 16px 0; }
.dim-bars .dim-bar     { margin-bottom: 10px; }
.dim-bars .dim-name    { font-size: .8rem; font-weight: 600; color: #374151; margin-bottom: 4px; display: flex; justify-content: space-between; }
.dim-bars .bar-track   { background: #bfdbfe; border-radius: 100px; height: 8px; overflow: hidden; }
.dim-bars .bar-fill    { height: 100%; background: var(--primary); border-radius: 100px; transition: width .6s ease; }

/* ── Likert Scale Buttons (burnout / focus quiz) ─────────── */
.likert-group { display: flex; gap: 8px; flex-wrap: wrap; }
.likert-btn {
  flex: 1;
  min-width: 80px;
  padding: 10px 6px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 500;
  text-align: center;
  transition: all .2s;
  color: #374151;
}
.likert-btn:has(input:checked) { border-color: var(--primary); background: #eff6ff; color: var(--primary); font-weight: 700; }
.likert-btn input { display: none; }
.risk-label { display: inline-block; padding: 6px 16px; border-radius: 20px; font-weight: 700; font-size: 1rem; margin-bottom: 12px; }

/* ── Routine / Schedule List ────────────────────────────── */
.routine-list { list-style: none; padding: 0; margin: 12px 0; }
.routine-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  background: rgba(255,255,255,.8);
  border-radius: 8px;
  margin-bottom: 8px;
  border-left: 3px solid var(--primary);
}
.time-tag      { background: var(--primary); color: #fff; font-weight: 700; font-size: .8rem; padding: 3px 10px; border-radius: 6px; white-space: nowrap; flex-shrink: 0; }
.activity-name { font-weight: 600; font-size: .9rem; color: var(--text); }
.activity-desc { font-size: .8rem; color: var(--muted); margin-top: 2px; }

/* ── Side Hustle Cards ──────────────────────────────────── */
.hustle-list { list-style: none; padding: 0; margin: 8px 0; }
.hustle-item {
  background: rgba(255,255,255,.85);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 10px;
  border-left: 4px solid var(--primary);
}
.h-title { font-weight: 700; font-size: 1rem; color: var(--text); margin-bottom: 4px; }
.h-meta  { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.h-badge { background: #eff6ff; color: var(--primary); font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.h-step  { font-size: .82rem; color: var(--muted); font-style: italic; }

/* ── Savings Milestones ─────────────────────────────────── */
.milestones     { list-style: none; padding: 0; margin: 10px 0; }
.milestone-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255,255,255,.7);
  border-radius: 7px;
  margin-bottom: 5px;
  font-size: .82rem;
  font-weight: 600;
  color: #374151;
}
.milestone-item .m-date { color: var(--primary); }

/* ── Income / Breakdown List ────────────────────────────── */
.breakdown-list { list-style: none; padding: 0; margin: 10px 0; }
.breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255,255,255,.7);
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: .875rem;
  font-weight: 600;
}
.breakdown-item .b-label { color: #374151; }
.breakdown-item .b-val   { color: var(--primary); font-weight: 700; }

/* ── Goal Breakdown — Task List ─────────────────────────── */
.task-list { list-style: none; padding: 0; margin: 12px 0; }
.task-item {
  background: rgba(255,255,255,.8);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
  border-left: 3px solid var(--primary);
  font-size: .9rem;
  color: var(--text);
}
.task-item strong { color: var(--primary); }

/* ── Freelance — Price Range Display ────────────────────── */
.price-range { background: rgba(255,255,255,.8); border-radius: 8px; padding: 14px; margin-bottom: 12px; text-align: center; }
.range-text  { font-size: .85rem; color: #374151; margin-top: 4px; }

/* ── Insights Section ───────────────────────────────────── */
.insights-grid { display: grid; gap: 16px; margin-bottom: 24px; }
@media (min-width: 640px) { .insights-grid { grid-template-columns: repeat(3, 1fr); } }

.insight-card { background: var(--white); border-radius: var(--radius); padding: 22px; box-shadow: 0 4px 12px rgba(0,0,0,.05); border-top: 3px solid var(--primary); }
.insight-card .i-title { font-size: .8rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.insight-card p { font-size: .875rem; color: var(--muted); line-height: 1.6; }

/* ── FAQ Section ────────────────────────────────────────── */
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: var(--white); border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.04); overflow: hidden; }
.faq-q {
  width: 100%;
  text-align: left;
  padding: 16px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: background .2s;
}
.faq-q:hover                      { background: #f9fafb; }
.faq-q .chevron                   { font-style: normal; flex-shrink: 0; transition: transform .3s; }
.faq-q[aria-expanded=true] .chevron { transform: rotate(45deg); }
.faq-a      { max-height: 0; overflow: hidden; transition: max-height .35s ease, padding .3s; }
.faq-a.open { max-height: 500px; padding: 0 20px 16px; }
.faq-a p    { color: #374151; line-height: 1.7; font-size: .9rem; }

/* ── Related Tools Grid ─────────────────────────────────── */
.related-grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .related-grid { grid-template-columns: repeat(3, 1fr); } }

.tool-card { background: var(--white); border-radius: var(--radius); padding: 22px; box-shadow: 0 4px 12px rgba(0,0,0,.05); transition: transform .2s, box-shadow .2s; color: inherit; display: block; }
.tool-card:hover   { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,.1); }
.tool-card .t-icon { font-size: 1.75rem; margin-bottom: 10px; display: block; }
.tool-card h3      { font-size: .95rem; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.tool-card p       { font-size: .825rem; color: var(--muted); line-height: 1.5; }
.tool-card .arrow  { color: var(--primary); font-weight: 700; margin-top: 10px; display: inline-block; font-size: .875rem; }

/* ── Responsive — Calculator-specific tweaks ────────────── */
@media (max-width: 640px) {
  #resultValue,
  .result-number   { font-size: 2.5rem; }
  .checkbox-group  { grid-template-columns: 1fr; }
  .result-grid     { grid-template-columns: 1fr 1fr; }
  .likert-group    { gap: 5px; }
  .likert-btn      { min-width: 56px; font-size: .75rem; padding: 8px 4px; }
}

/* ── Dark Mode — Calculator Overrides ───────────────────── */
/* Radio / checkbox options */
[data-theme="dark"] .radio-option                    { color: var(--subtle); }
[data-theme="dark"] .radio-option:has(input:checked) { background: #1e3a5f; }
[data-theme="dark"] .check-opt,
[data-theme="dark"] .check-option                    { color: var(--subtle); }
[data-theme="dark"] .check-opt:has(input:checked),
[data-theme="dark"] .check-option:has(input:checked) { background: #1e3a5f; }

/* Slider value pills (Health .range-val + Money .slider-row .num-input) */
[data-theme="dark"] .range-val {
  background: #1e3a5f;
  color: #93c5fd;
}
[data-theme="dark"] .slider-row .num-input {
  background: #1e3a5f;
  color: #93c5fd;
}
[data-theme="dark"] .slider-row .num-input:hover {
  background: #243a5c;
}
[data-theme="dark"] .slider-row .num-input:focus {
  box-shadow: 0 0 0 2px rgba(147, 197, 253, 0.35);
}

/* Result card */
[data-theme="dark"] .result-card {
  background: linear-gradient(135deg, #1e3a5f 0%, #1e3058 100%);
  border-color: #3b5998;
}
[data-theme="dark"] .progress-bar            { background: #334155; }
[data-theme="dark"] #resultExplanation       { color: var(--subtle); }
[data-theme="dark"] .result-stat             { background: rgba(255,255,255,.06); }
[data-theme="dark"] .result-stat .s-label,
[data-theme="dark"] .result-stat .s-lab      { color: var(--muted); }
[data-theme="dark"] .result-stat .s-value,
[data-theme="dark"] .result-stat .s-val      { color: #93c5fd; }

/* Dimension bars */
[data-theme="dark"] .dim-label                { color: var(--subtle); }
[data-theme="dark"] .dim-bar                  { background: #334155; }
[data-theme="dark"] .dim-bars .dim-name       { color: var(--subtle); }
[data-theme="dark"] .dim-bars .bar-track      { background: #334155; }

/* Likert scale */
[data-theme="dark"] .likert-btn                      { background: var(--white); color: var(--subtle); }
[data-theme="dark"] .likert-btn:has(input:checked)   { background: #1e3a5f; }

/* List-item surfaces */
[data-theme="dark"] .routine-item,
[data-theme="dark"] .hustle-item    { background: rgba(255,255,255,.05); }
[data-theme="dark"] .milestone-item,
[data-theme="dark"] .breakdown-item,
[data-theme="dark"] .task-item,
[data-theme="dark"] .price-range    { background: rgba(255,255,255,.05); }
[data-theme="dark"] .milestone-item         { color: var(--subtle); }
[data-theme="dark"] .breakdown-item .b-label { color: var(--subtle); }
[data-theme="dark"] .range-text              { color: var(--subtle); }
[data-theme="dark"] .h-badge                 { background: #1e3a5f; }

/* FAQ */
[data-theme="dark"] .faq-q:hover { background: #273449; }
[data-theme="dark"] .faq-a p     { color: var(--subtle); }

/* ── Language Dropdown — styles live in main.css (loaded on every page) ── */
