/* =========================================================
   Test de calificación + Calculadora
   ========================================================= */
.tool-sec {
  --ink: #10261b; --ink-2: #4a5e53; --soft: #eaf5ee; --edge: rgba(6, 118, 71, .14);
  background: rgb(244, 250, 246); color: var(--ink);
  padding: clamp(64px, 9vw, 112px) var(--gutter) 0;
  scroll-margin-top: 40px;
}
.tool-alt { padding-bottom: clamp(24px, 4vw, 48px); }
.sec-head { max-width: 640px; margin-bottom: 28px; }
.sec-head h2 { margin: 0; font-size: clamp(32px, 4.4vw, 52px); letter-spacing: -0.035em; line-height: 1.05; }
.sec-lead { margin: 14px 0 0; font-size: clamp(17px, 1.4vw, 19px); line-height: 1.55; color: var(--ink-2); }
.panel {
  background: #fff; border: 1px solid var(--edge); border-radius: 26px;
  box-shadow: 0 30px 60px -40px rgba(6, 80, 50, .35);
}
.tool-sec button { font-family: inherit; cursor: pointer; }

/* ---------- Quiz ---------- */
.quiz { padding: clamp(22px, 3.4vw, 40px); max-width: 860px; }
.quiz-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.q-progress { flex: 1; max-width: 420px; }
.q-step { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.q-bar { margin-top: 10px; height: 8px; border-radius: 8px; background: var(--soft); overflow: hidden; }
.q-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--green); }
.q-relief { display: flex; align-items: center; gap: 10px; }
.q-relief svg { width: 52px; height: 52px; transform: rotate(-90deg); }
.q-relief circle { fill: none; stroke-width: 5; }
.ring-track { stroke: var(--soft); }
.ring-fill { stroke: var(--red); stroke-linecap: round; stroke-dasharray: 100 100; stroke-dashoffset: 100; }
.q-relief strong { display: block; font-size: 24px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.q-relief small { font-size: 12px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .08em; }

.q-title { margin: 0 0 20px; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.15; letter-spacing: -0.025em; }
.q-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.q-opt {
  display: flex; align-items: center; gap: 14px; text-align: left;
  min-height: 72px; padding: 16px 20px; border-radius: 18px;
  border: 1.5px solid var(--edge); background: #fbfefc; color: var(--ink);
  font-size: 18px; font-weight: 700; letter-spacing: -0.01em;
  transition: border-color .15s, background .15s, transform .15s;
}
.q-opt::before {
  content: ""; flex: none; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(6, 118, 71, .35); background: #fff; transition: all .15s;
}
.q-opt:hover { border-color: var(--green); background: #f1faf4; transform: translateY(-1px); }
.q-opt.is-on { border-color: var(--green); background: #eaf7ef; }
.q-opt.is-on::before { border-color: var(--green); background: var(--green); box-shadow: inset 0 0 0 4px #fff; }
.q-opt:focus-visible { outline: 3px solid rgba(18, 183, 106, .4); outline-offset: 2px; }
.q-back { margin-top: 18px; border: 0; background: none; color: var(--ink-2); font-size: 15px; font-weight: 700; padding: 8px 0; }
.q-back:hover { color: var(--ink); }

/* result */
.q-result { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: start; }
.r-badge {
  width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center;
  background: var(--green); box-shadow: 0 0 0 8px rgba(18, 183, 106, .14);
}
.r-badge svg { width: 30px; height: 30px; fill: none; stroke: #fff; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.r-kicker { margin: 0; font-size: 13px; font-weight: 800; color: var(--green-deep); text-transform: uppercase; letter-spacing: .08em; }
.r-title { margin: 6px 0 10px; font-size: clamp(28px, 3.2vw, 40px); line-height: 1.08; letter-spacing: -0.03em; }
.r-text { margin: 0 0 18px; font-size: 18px; line-height: 1.55; color: var(--ink-2); max-width: 56ch; }
.r-list { margin: 0 0 24px; padding: 0; list-style: none; display: grid; gap: 10px; }
.r-list li { display: flex; gap: 10px; font-size: 17px; font-weight: 600; }
.r-list li::before { content: "✓"; color: var(--green); font-weight: 800; }
.r-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn-ghost {
  display: inline-flex; align-items: center; padding: 15px 22px; border-radius: 999px;
  border: 1.5px solid var(--edge); background: #fff; color: var(--ink); font-weight: 800; font-size: 16px;
}
.btn-ghost:hover { border-color: var(--green); }
.r-redo { border: 0; background: none; color: var(--ink-2); font-weight: 700; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
.r-fine { margin: 18px 0 0; font-size: 13px; color: var(--ink-2); }

/* ---------- Calculator ---------- */
.calc { display: grid; grid-template-columns: 1.15fr 0.85fr; overflow: hidden; }
.calc-in { padding: clamp(22px, 3.4vw, 40px); min-width: 0; }
.calc-out { padding: clamp(22px, 3.4vw, 40px); background: #0f2a1d; color: #eafaf1; display: flex; flex-direction: column; gap: 22px; min-width: 0; }

.field { display: block; margin-bottom: 22px; }
.f-label { display: flex; justify-content: space-between; font-size: 15px; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; }
.f-label b { color: var(--ink); font-size: 17px; }
.money {
  display: flex; align-items: center; gap: 6px; padding: 0 16px; height: 56px; border-radius: 14px;
  border: 1.5px solid var(--edge); background: #fbfefc; font-size: 20px; font-weight: 800; min-width: 0;
}
.money:focus-within { border-color: var(--green); box-shadow: 0 0 0 4px rgba(18, 183, 106, .14); }
.money > span { color: var(--ink-2); }
.money input {
  border: 0; outline: 0; background: transparent; width: 100%; min-width: 0;
  font: inherit; color: var(--ink); font-variant-numeric: tabular-nums;
}

.debts-head, .debt { display: grid; grid-template-columns: 1.5fr 1fr 1fr 36px; gap: 10px; }
.debts-head { font-size: 12px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.debt { margin-bottom: 10px; align-items: center; }
.debt .money { height: 52px; font-size: 17px; padding: 0 12px; }
.d-del {
  width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--soft); color: var(--ink-2);
  font-size: 20px; line-height: 1;
}
.d-del:hover { background: #fde8ea; color: #c9343f; }
.add-debt {
  margin: 4px 0 26px; padding: 12px 16px; border-radius: 12px; border: 1.5px dashed rgba(6, 118, 71, .35);
  background: transparent; color: var(--green-deep); font-weight: 800; font-size: 15px;
}
.add-debt:hover { background: #f1faf4; }

input[type="range"] { width: 100%; accent-color: var(--green); height: 28px; }
.range-ends { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); }

.o-total { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,.12); }
.o-total span { font-size: 15px; color: rgba(234, 250, 241, .7); font-weight: 600; }
.o-total strong { font-size: 24px; font-weight: 800; }
.cmp { display: grid; gap: 16px; }
.cmp-label { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.cmp-label span { font-size: 15px; color: rgba(234, 250, 241, .75); font-weight: 600; }
.cmp-label strong { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cmp-bar { height: 14px; border-radius: 8px; background: rgba(255,255,255,.08); overflow: hidden; }
.cmp-bar i { display: block; height: 100%; width: 0; border-radius: inherit; }
.cmp-bar .now { background: linear-gradient(90deg, #ff7a85, #e8505b); }
.cmp-bar .new { background: linear-gradient(90deg, #4be29a, #12b76a); }
.o-save { padding: 18px 20px; border-radius: 18px; background: rgba(18, 183, 106, .16); border: 1px solid rgba(75, 226, 154, .3); }
.o-save span { display: block; font-size: 15px; font-weight: 600; color: rgba(234, 250, 241, .8); }
.o-save strong { display: block; margin-top: 4px; font-size: clamp(36px, 4vw, 48px); font-weight: 800; letter-spacing: -0.035em; color: #6ff0b0; font-variant-numeric: tabular-nums; }
.o-load span { font-size: 15px; color: rgba(234, 250, 241, .75); font-weight: 600; }
.load-vals { display: flex; align-items: center; gap: 12px; margin-top: 6px; font-size: 28px; font-weight: 800; }
.load-vals .bad { color: #ff8a93; }
.load-vals .good { color: #6ff0b0; }
.load-vals i { font-style: normal; color: rgba(234, 250, 241, .5); }
.calc-out .cta { justify-content: center; }
.fine { margin: 0; font-size: 13px; line-height: 1.5; color: rgba(234, 250, 241, .6); }

@media (max-width: 860px) {
  .q-options { grid-template-columns: 1fr; }
  .q-opt { min-height: 64px; }
  .quiz-top { margin-bottom: 20px; }
  .q-result { grid-template-columns: 1fr; gap: 16px; }
  .r-actions .cta, .r-actions .btn-ghost { width: 100%; justify-content: center; }
  .calc { grid-template-columns: 1fr; }
  .debts-head { display: none; }
  .debt {
    grid-template-columns: 1fr 1fr 36px; grid-template-areas: "n n x" "m c c";
    row-gap: 16px; padding: 12px; border-radius: 16px; background: #f6fbf8; border: 1px solid var(--edge);
  }
  .debt .d-name { grid-area: n; }
  .debt .d-amt { grid-area: m; }
  .debt .d-fee { grid-area: c; }
  .debt .d-del { grid-area: x; }
  .debt .d-amt, .debt .d-fee { position: relative; }
  .debt .d-amt::after, .debt .d-fee::after {
    position: absolute; top: -9px; left: 10px; padding: 0 4px; background: #fbfefc; border-radius: 4px;
    font-size: 11px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em;
  }
  .debt .d-amt::after { content: "Monto"; }
  .calc-in { padding: 20px 14px; }
  .debt { padding: 10px; column-gap: 8px; }
  .debt .money { font-size: 16px; padding: 0 10px; gap: 4px; }
  .debt .d-fee::after { content: "Cuota/mes"; }
}
