/* ============================================================================
   HERRAMIENTAS SPG — Suite de Calculadoras Educativas
   Estilos de calculadora bajo .herr-scope para no colisionar con main.css
   ============================================================================ */

/* ── Hero de página ───────────────────────────────────────────────────────── */
.herr-hero {
  background: #10233A;
  padding: 28px 16px 34px;
}
.herr-hero-inner {
  max-width: 660px;
  margin: 0 auto;
}
.herr-volver {
  display: inline-block;
  color: #C9D4E2;
  text-decoration: none;
  font-size: 13.5px;
  margin-bottom: 10px;
  transition: color .15s;
}
.herr-volver:hover { color: #fff; }
.herr-h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  color: #fff;
  font-size: clamp(24px, 5vw, 32px);
  line-height: 1.18;
  text-wrap: balance;
  margin: 0;
}
.herr-sub {
  color: #C9D4E2;
  font-size: 15px;
  margin: 8px 0 0;
}

/* ── Contenedor principal ─────────────────────────────────────────────────── */
.herr-main {
  background: #FAF6F0;
  min-height: 60vh;
  padding: 26px 16px 64px;
}
.herr-wrap {
  max-width: 620px;
  margin: 0 auto;
}

/* ── Scope: todos los estilos de la suite ────────────────────────────────── */
.herr-scope {
  --navy:       #10233A;
  --navy-2:     #1B3350;
  --coral-dark: #E5532F;
  --cream:      #FAF6F0;
  --card:       #FFF;
  --ink:        #14202E;
  --muted:      #5C6B7C;
  --line:       #E7E1D6;
  --ok:         #2E9E6B;
  --ok-bg:      #EFF8F3;
  --gold:       #E8B54D;
  --radius:     18px;
  --shadow:     0 10px 30px rgba(16,35,58,.12);
  font-family: 'Instrument Sans', system-ui, sans-serif;
  color: var(--ink);
}

/* ── Tarjeta base ── */
.herr-scope .card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 24px;
}

/* ── Menú de entrada (index) ── */
.herr-scope .menu-item {
  display: flex;
  gap: 14px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  font: inherit;
  cursor: pointer;
  transition: border-color .15s, transform .08s;
  margin-bottom: 12px;
  text-decoration: none;
  color: var(--ink);
}
.herr-scope .menu-item:hover  { border-color: var(--coral); }
.herr-scope .menu-item:active { transform: scale(.99); }
.herr-scope .menu-item:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.herr-scope .mi-ico {
  font-size: 26px;
  flex: none;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: var(--cream);
  border-radius: 12px;
}
.herr-scope .mi-t { font-weight: 700; font-size: 16.5px; }
.herr-scope .mi-d { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.herr-scope .mi-fl { margin-left: auto; color: var(--coral); font-weight: 700; }
.herr-scope .menu-seccion {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 4px 0 4px;
}
.herr-scope .promesa {
  display: flex;
  gap: 8px;
  background: var(--ok-bg);
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 13.5px;
  color: #20614A;
  margin-top: 6px;
  line-height: 1.45;
}

/* ── Progreso ── */
.herr-scope .progress {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}
.herr-scope .casa { width: 24px; height: 24px; opacity: .22; transition: opacity .2s, transform .2s; }
.herr-scope .casa.act { opacity: 1; transform: scale(1.1); }
.herr-scope .plinea { flex: 1; height: 2px; background: var(--line); border-radius: 2px; }
.herr-scope .plinea i {
  display: block; height: 100%; width: 0;
  background: var(--coral); border-radius: 2px; transition: width .35s;
}

/* ── Pasos / wizard steps ── */
.herr-scope .paso     { display: none; }
.herr-scope .paso.act { display: block; animation: herr-entra .25s ease; }
@keyframes herr-entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .herr-scope .paso.act { animation: none; } }

/* ── Pregunta + pista ── */
.herr-scope .pregunta {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(20px, 4vw, 25px);
  font-weight: 600;
  margin-bottom: 4px;
  text-wrap: balance;
}
.herr-scope .pista { color: var(--muted); font-size: 14px; margin-bottom: 16px; }

/* ── Input dinero ── */
.herr-scope .dinero {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 13px 15px;
  transition: border-color .15s;
}
.herr-scope .dinero:focus-within { border-color: var(--coral); }
.herr-scope .dinero b { font-size: 22px; color: var(--muted); }
.herr-scope .dinero input {
  border: 0; outline: 0;
  font: inherit;
  font-size: clamp(24px, 6vw, 30px);
  font-weight: 700;
  width: 100%;
  font-variant-numeric: tabular-nums;
  background: transparent;
}

/* ── Chips ── */
.herr-scope .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.herr-scope .chip {
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 13px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .12s;
}
.herr-scope .chip:hover { border-color: var(--coral); }
.herr-scope .chip.act   { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ── Label / etiqueta ── */
.herr-scope label.eti {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  margin: 15px 0 6px;
}

/* ── Mini input (select, porcentaje) ── */
.herr-scope .mini {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  transition: border-color .15s;
}
.herr-scope .mini:focus-within { border-color: var(--coral); }
.herr-scope .mini input,
.herr-scope .mini select {
  border: 0; outline: 0;
  font: inherit;
  font-size: 16.5px;
  font-weight: 600;
  width: 100%;
  background: transparent;
}
.herr-scope .mini b { color: var(--muted); font-size: 14px; flex: none; }

/* ── Grid 2 col ── */
.herr-scope .dos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 440px) { .herr-scope .dos { grid-template-columns: 1fr; } }

/* ── Texto estimado ── */
.herr-scope .estimado { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.herr-scope .estimado b { color: var(--coral-dark); }

/* ── Caja educativa ── */
.herr-scope .dato {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: var(--ok-bg);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13.5px;
  color: #20614A;
  margin-top: 14px;
  line-height: 1.45;
}
.herr-scope .dato b { color: #14503B; }

/* ── Tooltip "?" ── */
.herr-scope .q {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--muted);
  color: var(--muted);
  background: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  flex: none;
  padding: 0;
}
.herr-scope .q:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }
.herr-scope .tip {
  display: none;
  font-size: 13px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  margin-top: 6px;
  line-height: 1.5;
}
.herr-scope .tip.abre { display: block; }

/* ── Botones ── */
.herr-scope .acciones { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.herr-scope .btn {
  flex: 1;
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  font: inherit;
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .12s, transform .08s;
}
.herr-scope .btn:active      { transform: scale(.985); }
.herr-scope .btn:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.herr-scope .btn-coral       { background: var(--coral); color: #fff; }
.herr-scope .btn-coral:hover { background: var(--coral-dark); }
.herr-scope .btn-gris        { background: #EEF1F5; color: var(--ink); flex: 0 0 auto; padding-inline: 16px; }
.herr-scope a.btn-gris       { text-decoration: none; text-align: center; display: inline-flex; align-items: center; justify-content: center; }

/* ── Toggle 2 opciones ── */
.herr-scope .toggle2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.herr-scope .toggle2 .chip { text-align: center; padding: 11px; border-radius: 12px; }

/* ── Resultado ── */
.herr-scope .res-num { text-align: center; margin: 2px 0; }
.herr-scope .res-eti {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.herr-scope .res-cifra {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: clamp(38px, 9vw, 52px);
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.herr-scope .dona-zona { display: flex; justify-content: center; margin: 12px 0 4px; }
.herr-scope .leyenda {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  margin: 8px 0 14px;
}
.herr-scope .leyenda div { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.herr-scope .pt { width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* ── Recibo / desglose ── */
.herr-scope .recibo {
  border: 1.5px dashed var(--line);
  border-radius: 14px;
  padding: 4px 15px;
  background: #FFFDF9;
  margin-top: 8px;
  overflow-x: auto;
}
.herr-scope .grupo {
  font-size: 11.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 0 2px;
  font-weight: 700;
}
.herr-scope .fila {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.herr-scope .fila:last-child  { border-bottom: 0; }
.herr-scope .fila .nom        { display: flex; align-items: center; gap: 6px; flex: 1; }
.herr-scope .fila .val        { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.herr-scope .fila .val.resta  { color: #B4462B; }
.herr-scope .fila.total       { font-size: 16px; border-top: 2px solid var(--navy); margin-top: 2px; border-bottom: 0; }
.herr-scope .fila.total .val  { color: var(--coral-dark); }
.herr-scope .aviso            { font-size: 12.5px; color: var(--muted); margin-top: 10px; line-height: 1.5; }

/* ── Lecciones ── */
.herr-scope .aprendio {
  background: var(--navy);
  color: #EAF0F7;
  border-radius: 14px;
  padding: 16px 16px 8px;
  margin-top: 16px;
}
.herr-scope .aprendio h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 16.5px;
  color: #fff;
  margin-bottom: 8px;
}
.herr-scope .aprendio p  { font-size: 13.5px; line-height: 1.55; margin-bottom: 9px; }
.herr-scope .aprendio b  { color: var(--gold); }

/* ── CTA final ── */
.herr-scope .cta {
  background: var(--navy);
  border-radius: 14px;
  padding: 16px;
  margin-top: 14px;
  color: #fff;
  text-align: center;
}
.herr-scope .cta p { font-family: 'Fraunces', Georgia, serif; font-size: 17px; margin-bottom: 11px; }
.herr-scope .cta a {
  display: inline-block;
  text-decoration: none;
  font-weight: 700;
  font-size: 14.5px;
  padding: 10px 16px;
  border-radius: 999px;
  margin: 0 4px 6px;
}
.herr-scope .cta .tel { background: var(--coral); color: #fff; }
.herr-scope .cta .wa  { background: #25D366; color: #fff; }
.herr-scope .legal    { font-size: 11.5px; color: var(--muted); margin-top: 12px; line-height: 1.5; text-align: center; }

/* ── Portal memoria ── */
.spg-mem { margin-top: 10px; }
.spg-mem-ok,
.spg-mem-anon {
  display: inline-block;
  font-size: 13px;
  padding: 7px 13px;
  border-radius: 8px;
  margin: 0;
}
.spg-mem-ok   { background: #dcfce7; color: #14532d; }
.spg-mem-anon { background: #f0f4ff; color: #1e3a5f; border: 1px solid #c7d7f4; }
.spg-mem-ok a, .spg-mem-anon a { color: inherit; font-weight: 700; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .herr-scope .card   { padding: 18px 14px; }
  .herr-scope .leyenda { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .herr-scope .toggle2 { grid-template-columns: 1fr; }
}
