/*
 * Estilos propios de la calculadora de renta (stepper, campos,
 * resultado). Las variables (:root), body/.wrap, topnav y footer son
 * compartidos entre herramientas y viven en site.css — esta hoja se
 * carga siempre junto a site.css, nunca sola.
 */

/* Stepper */
.stepper { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 26px; }
.step-pill { display: flex; align-items: center; gap: 8px; }
.step-num {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
  background: var(--card); border: 1.5px solid var(--line); color: var(--ink-faint);
  transition: all .3s;
}
.step-label { font-size: 12.5px; color: var(--ink-faint); font-weight: 500; transition: color .3s; }
.step-pill.active .step-num { background: var(--brand); border-color: var(--brand); color: #fff; }
.step-pill.active .step-label { color: var(--ink); }
.step-pill.done .step-num { background: var(--brand-soft); border-color: var(--brand-soft); color: var(--brand); }
.step-line { width: 26px; height: 1.5px; background: var(--line); margin: 0 8px; }

/* Card */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 28px;
}
.card-eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); margin-bottom: 4px; }
.card-title { font-family: 'Fraunces', serif; font-size: 21px; font-weight: 600; margin-bottom: 4px; letter-spacing: -.01em; }
.card-desc { color: var(--ink-soft); font-size: 14px; margin-bottom: 24px; }

.panel { display: none; }
.panel.active { display: block; animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Fields */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 7px; }
.field .hint { font-size: 12.5px; color: var(--ink-faint); font-weight: 400; margin-top: 5px; }
.input-money { position: relative; }
.input-money::before {
  content: '$'; position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--ink-faint); font-size: 15px; font-weight: 500;
}
input[type=text], input[type=email], input[type=number] {
  width: 100%; padding: 12px 14px 12px 26px;
  border: 1.5px solid var(--line); border-radius: 10px;
  font-family: 'Inter', sans-serif; font-size: 15px; color: var(--ink);
  background: var(--paper); transition: border-color .2s, background .2s;
}
input[type=email] { padding-left: 14px; }
input:focus { outline: none; border-color: var(--brand); background: #fff; }

/* Toggle (elige forma de aportes) */
.toggle-row { display: flex; gap: 8px; margin-bottom: 8px; }
.toggle-opt {
  flex: 1; text-align: center; padding: 10px; border: 1.5px solid var(--line);
  border-radius: 10px; font-size: 13px; font-weight: 500; cursor: pointer; background: var(--paper);
  transition: all .2s;
}
.toggle-opt.sel { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }

.stepper-num { display: flex; align-items: center; gap: 12px; }
.stepper-num button {
  width: 38px; height: 38px; border-radius: 9px; border: 1.5px solid var(--line);
  background: var(--paper); font-size: 18px; cursor: pointer; color: var(--ink-soft);
  transition: all .2s;
}
.stepper-num button:hover { border-color: var(--brand); color: var(--brand); }
.stepper-num button:disabled { opacity: .4; cursor: not-allowed; }
.stepper-num .count { font-size: 18px; font-weight: 600; min-width: 30px; text-align: center; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Nav buttons */
.nav { display: flex; justify-content: space-between; align-items: center; margin-top: 26px; gap: 12px; }
.btn {
  padding: 12px 22px; border-radius: 10px; font-family: 'Inter', sans-serif;
  font-size: 14.5px; font-weight: 600; cursor: pointer; border: none; transition: all .2s;
}
.btn-primary { background: var(--brand); color: #fff; flex: 1; }
.btn-primary:hover { background: #0b4b3c; }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.btn-ghost { background: transparent; color: var(--ink-soft); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink-faint); }

/* Resultado doble: impuesto a cargo + saldo final */
.result-duo { display: flex; align-items: stretch; gap: 12px; margin: 8px 0 16px; }
.result-box { flex: 1; border-radius: 12px; padding: 18px 16px; text-align: center; }
.result-box.secondary { background: var(--paper); border: 1px solid var(--line); }
.result-box.primary { background: var(--gold-soft); border: 1.5px solid var(--gold); }
.result-box.primary.a-favor { background: var(--brand-soft); border-color: var(--brand); }
.result-box.primary.cero { background: var(--paper); border-color: var(--line); }
.rb-label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; color: var(--ink-soft); margin-bottom: 8px; }
.result-box.primary .rb-label { color: var(--gold); }
.result-box.primary.a-favor .rb-label { color: var(--brand); }
.result-box.primary.cero .rb-label { color: var(--ink-soft); }
.rb-value { font-family: 'Fraunces', serif; font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1; color: var(--ink); }
.result-box.primary .rb-value { color: var(--gold); }
.result-box.primary.a-favor .rb-value { color: var(--brand); }
.result-box.primary.cero .rb-value { color: var(--ink-soft); }
.rb-note { font-size: 11.5px; color: var(--ink-faint); margin-top: 8px; line-height: 1.35; }
.result-arrow { display: flex; align-items: center; font-size: 11px; color: var(--ink-faint); font-weight: 600; white-space: nowrap; }
.result-meta { display: flex; justify-content: center; gap: 20px; font-size: 13px; color: var(--ink-soft); margin-bottom: 8px; font-family: 'JetBrains Mono', monospace; }
.result-meta b { color: var(--brand); }

/* Aviso educativo (sin impuesto / saldo en cero) */
.result-callout {
  display: none; align-items: flex-start; gap: 10px; padding: 12px 14px; margin-bottom: 14px;
  background: var(--brand-soft); border-radius: 10px; font-size: 13px; color: var(--ink-soft); line-height: 1.45;
}
.result-callout.show { display: flex; }

/* Desglose (accordion) */
.accordion { border: 1px solid var(--line); border-radius: 10px; margin-top: 22px; overflow: hidden; }
.accordion-head {
  padding: 14px 18px; display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; font-size: 14px; font-weight: 600; background: var(--paper);
}
.accordion-head .chev { transition: transform .3s; color: var(--ink-faint); }
.accordion.open .chev { transform: rotate(180deg); }
.accordion-body { max-height: 0; overflow: hidden; transition: max-height .4s ease; }
.accordion.open .accordion-body { max-height: 700px; }
.breakdown { padding: 4px 18px 18px; }
.breakdown-row { display: flex; justify-content: space-between; padding: 9px 0; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.breakdown-row:last-child { border-bottom: none; }
.breakdown-row .lbl { color: var(--ink-soft); }
.breakdown-row .val { font-family: 'JetBrains Mono', monospace; font-weight: 500; }
.breakdown-row.neg .val { color: var(--danger); }
.breakdown-row.total { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 12px; font-weight: 600; }
.breakdown-row.total .lbl { color: var(--ink); font-weight: 600; }

/* Email capture */
.capture { margin-top: 22px; padding: 22px; background: var(--brand-soft); border-radius: 12px; }
.capture-title { font-family: 'Fraunces', serif; font-size: 17px; font-weight: 600; margin-bottom: 5px; }
.capture-desc { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 16px; }
textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  font-family: 'Inter', sans-serif; font-size: 14px; resize: vertical; min-height: 70px; background: #fff;
}
textarea:focus { outline: none; border-color: var(--brand); }
.capture .confirm-msg, .help-box .confirm-msg {
  display: none; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--brand);
}
.capture .confirm-msg.show, .help-box .confirm-msg.show { display: flex; }

/* Disclaimer */
.disclaimer {
  margin-top: 20px; padding: 14px 16px; background: #FBF6EC; border: 1px solid #EFE3CC;
  border-radius: 10px; font-size: 12.5px; color: #7A6836; line-height: 1.5; display: flex; gap: 10px;
}
.disclaimer svg { flex-shrink: 0; margin-top: 1px; }

/* Tooltip */
.lbl-row { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; }
.lbl-row label { margin-bottom: 0; }
.req { color: var(--danger); font-weight: 600; }
.tip {
  position: relative; width: 15px; height: 15px; border-radius: 50%;
  background: var(--line); color: var(--ink-soft); font-size: 10px; font-weight: 700;
  display: inline-grid; place-items: center; cursor: help; flex-shrink: 0;
}
.tip:hover { background: var(--brand); color: #fff; }
.tip .tip-box {
  visibility: hidden; opacity: 0; position: absolute; bottom: 145%; left: 50%;
  transform: translateX(-50%) translateY(4px); width: 220px; padding: 10px 12px;
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 400; line-height: 1.45;
  border-radius: 8px; z-index: 20; transition: all .2s; box-shadow: 0 6px 20px rgba(0,0,0,.18);
  text-align: left;
}
.tip .tip-box::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--ink);
}
.tip:hover .tip-box { visibility: visible; opacity: 1; transform: translateX(-50%) translateY(0); }

/* Validación */
input.invalid { border-color: var(--danger); background: var(--danger-soft); }
.err-msg { font-size: 12px; color: var(--danger); margin-top: 5px; display: none; }
.warn-msg { font-size: 12px; color: var(--warn); margin-top: 5px; display: none; }

/* Banda UVT */
.uvt-band {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  padding: 10px 16px; background: var(--brand-soft); border-radius: 10px;
  margin-bottom: 24px; font-size: 12.5px; flex-wrap: wrap;
}
.uvt-band .item { display: flex; align-items: center; gap: 6px; }
.uvt-band .k { color: var(--ink-soft); }
.uvt-band .v { font-family: 'JetBrains Mono', monospace; font-weight: 600; color: var(--brand); }
.uvt-band .lock { font-size: 10px; opacity: .6; }

/* Casilla contáctanos / no sé */
.help-box {
  display: flex; gap: 11px; align-items: flex-start; padding: 14px 16px; margin-top: 4px;
  background: #F4F7F6; border: 1px dashed var(--brand); border-radius: 10px;
}
.help-box .hb-icon { flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px; background: var(--brand-soft); display: grid; place-items: center; }
.help-box .hb-title { font-size: 13.5px; font-weight: 600; margin-bottom: 2px; }
.help-box .hb-desc { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 8px; }
.help-box .hb-row { display: flex; gap: 8px; }
.help-box input { padding: 8px 12px; font-size: 13px; }
.help-box .btn { padding: 8px 14px; font-size: 13px; white-space: nowrap; }

/* Hub discreto */
.hub-hint {
  text-align: center; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-faint);
}
.hub-hint a { color: var(--brand); text-decoration: none; font-weight: 500; }
.hub-hint a:hover { text-decoration: underline; }

/* Banner de anuncio (UTM) */
.utm-banner {
  display: none; align-items: center; gap: 8px; justify-content: center;
  padding: 8px 14px; background: var(--gold-soft); border-radius: 8px; margin-bottom: 16px;
  font-size: 12.5px; color: #7A6836;
}
.utm-banner.show { display: flex; }

/* Error de red/servidor (sección 12 de la spec) */
.fetch-error {
  display: none; align-items: center; gap: 8px; padding: 12px 14px; margin-bottom: 16px;
  background: var(--danger-soft); border: 1px solid #F0D3CC; border-radius: 10px;
  font-size: 13px; color: var(--danger);
}
.fetch-error.show { display: flex; }

@media (max-width: 520px) {
  .grid-2 { grid-template-columns: 1fr; }
  .step-label { display: none; }
  h1 { font-size: 25px; }
  .result-number { font-size: 38px; }
  .tip .tip-box { width: 180px; }
  .help-box .hb-row { flex-direction: column; }
  .result-duo { flex-direction: column; }
  .result-arrow { justify-content: center; transform: rotate(90deg); padding: 4px 0; }
}
