/* iCIEN · Herramientas interactivas — complementa /normas/_styles.css */
.tool-wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }
.tool-section { padding: 56px 0 24px; }
#herramienta { min-height: 320px; }
#herramienta.is-loading::before {
  content: 'Cargando herramienta…'; display: block; text-align: center; padding: 80px 0; color: var(--text-muted);
}

.hd-card {
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  padding: 32px; margin-bottom: 20px; box-shadow: 0 6px 24px rgba(13,28,58,0.06);
}
.hd-eyebrow {
  font-family: var(--font-display); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold); font-weight: 600; margin-bottom: 8px;
}
.hd-h2 { font-family: var(--font-display); font-size: 22px; line-height: 1.3; color: var(--navy-deep); margin: 0 0 10px; font-weight: 700; }
.hd-help { color: var(--white2); font-size: 15px; margin-bottom: 20px; }

/* Progreso */
.hd-progress { height: 8px; background: var(--bg3); border-radius: 99px; overflow: hidden; }
.hd-progress-bar { height: 100%; background: linear-gradient(90deg, var(--navy), var(--gold)); border-radius: 99px; transition: width .4s ease; }
.hd-progress-label { font-size: 13px; color: var(--text-muted); margin: 8px 0 16px; text-align: right; }

/* Preguntas */
.hd-qs { list-style: none; counter-reset: q; padding: 0; margin: 0; }
.hd-q { counter-increment: q; padding: 18px 0; border-top: 1px solid var(--border); }
.hd-q:first-child { border-top: 0; }
.hd-q-text { font-size: 16px; color: var(--navy-deep); margin-bottom: 12px; }
.hd-q-text::before { content: counter(q) '. '; font-weight: 700; color: var(--gold); }
.hd-q.is-missing .hd-q-text { color: #b22222; }
.hd-q.is-missing .hd-options { outline: 2px dashed rgba(178,34,34,.5); outline-offset: 4px; border-radius: 10px; }

.hd-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hd-options-2 { grid-template-columns: repeat(2, minmax(0, 180px)); }
.hd-opt {
  font: 500 15px var(--font-body); padding: 11px 10px; border-radius: 10px; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--bg); color: var(--navy); transition: all .15s;
  min-height: 44px;
}
.hd-opt:hover { border-color: var(--navy-light); }
.hd-opt:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 2px; }
.hd-opt.is-on { background: var(--navy); border-color: var(--navy); color: #fff; }
.hd-opt-si.is-on { background: #2e7d32; border-color: #2e7d32; }
.hd-opt-parcial.is-on { background: var(--gold-light); border-color: var(--gold-light); }
.hd-opt-no.is-on { background: #b22222; border-color: #b22222; }
.hd-opt-na.is-on { background: #7a8aa8; border-color: #7a8aa8; }

.hd-missing, .hd-form-error { color: #b22222; font-size: 14px; margin-top: 12px; }
.hd-actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.hd-actions-split { justify-content: space-between; }
.hd-actions-left { justify-content: flex-start; }
#herramienta .btn-gold, #herramienta .btn-ghost { cursor: pointer; border: 0; font-family: var(--font-display); }
#herramienta .btn-gold[disabled] { opacity: .45; cursor: not-allowed; }
#herramienta .btn-ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
#herramienta .btn-ghost:hover { background: var(--teal-dim); }
.hd-link { background: none; border: 0; color: var(--navy-light); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.hd-resume { margin-top: 18px; text-align: center; font-size: 14px; color: var(--white2); }

/* Resultado */
.hd-result-top { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: center; }
.hd-gauge { width: 100%; max-width: 220px; }
.hd-gauge-num { font-family: var(--font-display); font-size: 34px; font-weight: 800; fill: var(--navy-deep); }
.hd-gauge-verde { stroke: #2e7d32; } .hd-gauge-amarillo { stroke: var(--gold-light); } .hd-gauge-rojo { stroke: #b22222; }
.hd-level { display: inline-block; font-family: var(--font-display); font-weight: 700; font-size: 18px; padding: 6px 14px; border-radius: 99px; margin-bottom: 10px; }
.hd-level-verde { background: rgba(46,125,50,.12); color: #2e7d32; }
.hd-level-amarillo { background: var(--gold-dim); color: var(--gold); }
.hd-level-rojo { background: rgba(178,34,34,.10); color: #b22222; }
.hd-result-sum { color: var(--navy-deep); margin-bottom: 8px; }
.hd-result-teaser { color: var(--white2); }

/* Formulario */
.hd-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.hd-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--white2); }
.hd-field input {
  font: 16px var(--font-body); padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--navy-deep);
}
.hd-field input:focus { outline: none; border-color: var(--navy-light); background: #fff; }
.hd-check { grid-column: 1 / -1; display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--white2); }
.hd-check input { margin-top: 4px; width: 18px; height: 18px; flex: none; accent-color: var(--navy); }
.hd-check a { color: var(--navy-light); }
.hd-form .hd-actions, .hd-form .hd-form-error, .hd-form .hd-fine { grid-column: 1 / -1; }
.hd-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.hd-fine { font-size: 12.5px; color: var(--text-muted); margin-top: 14px; }

/* Informe */
.hd-blocks { list-style: none; padding: 0; margin: 0 0 28px; }
.hd-block { display: grid; grid-template-columns: 14px 1fr 160px 48px; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.hd-block.is-na { color: var(--text-muted); grid-template-columns: 14px 1fr auto; }
.hd-dot { width: 12px; height: 12px; border-radius: 50%; background: #c8c8c8; }
.hd-dot-verde { background: #2e7d32; } .hd-dot-amarillo { background: var(--gold-light); } .hd-dot-rojo { background: #b22222; }
.hd-block-bar { height: 8px; background: var(--bg3); border-radius: 99px; overflow: hidden; }
.hd-block-bar span { display: block; height: 100%; border-radius: 99px; }
.hd-bar-verde { background: #2e7d32; } .hd-bar-amarillo { background: var(--gold-light); } .hd-bar-rojo { background: #b22222; }
.hd-block-pct { text-align: right; font-weight: 600; color: var(--navy-deep); }
.hd-gaps, .hd-route { padding-left: 22px; margin: 0 0 26px; }
.hd-gaps li, .hd-route li { margin-bottom: 12px; }
.hd-gap-meta { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--gold); font-weight: 600; }
.hd-gap-text { color: var(--navy-deep); }
.hd-all { margin-bottom: 24px; background: var(--bg); border-radius: 10px; padding: 12px 16px; }
.hd-all summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.hd-all ul { margin: 12px 0 0 18px; } .hd-all li { margin-bottom: 8px; font-size: 14.5px; }
.hd-next-step { background: var(--teal-dim); border-radius: 14px; padding: 22px; margin-top: 8px; }
.hd-next-step h3 { font-family: var(--font-display); color: var(--navy-deep); margin-bottom: 6px; }

/* Contenido explicativo */
.tool-note { background: var(--gold-dim); border-left: 4px solid var(--gold); padding: 14px 18px; border-radius: 8px; font-size: 14.5px; color: var(--navy-deep); margin: 0 auto 8px; max-width: 860px; }
.tool-updated { font-size: 13px; color: rgba(255,255,255,.7); margin-top: 14px; }
.tool-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 18px; }
.tool-step { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.tool-step b { display: block; font-family: var(--font-display); color: var(--gold); font-size: 24px; }
.tool-table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 15px; background: #fff; }
.tool-table th, .tool-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.tool-table th { font-family: var(--font-display); color: var(--navy-deep); background: var(--bg2); }
.tool-faq details { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; }
.tool-faq summary { cursor: pointer; font-weight: 600; color: var(--navy-deep); }
.tool-faq p { margin-top: 10px; color: var(--white2); }

@media (max-width: 700px) {
  .hd-card { padding: 22px 18px; border-radius: 14px; }
  .hd-h2 { font-size: 19px; }
  .hd-options { grid-template-columns: 1fr 1fr; }
  .hd-options-2 { grid-template-columns: 1fr 1fr; }
  .hd-result-top { grid-template-columns: 1fr; text-align: center; }
  .hd-gauge { margin: 0 auto; }
  .hd-form { grid-template-columns: 1fr; }
  .hd-block { grid-template-columns: 12px 1fr 44px; }
  .hd-block-bar { grid-column: 2 / 4; grid-row: 2; }
  .hd-actions-split .btn-gold, .hd-actions-split .btn-ghost { flex: 1; text-align: center; }
  .tool-steps { grid-template-columns: 1fr; }
  .tool-table { font-size: 14px; }
}
@media print {
  nav, footer, .final-cta, .hd-actions, .hd-form-card { display: none !important; }
  .hd-card { box-shadow: none; }
}
.hd-privacy { grid-column: 1 / -1; font-size: 12.5px; line-height: 1.5; color: var(--white2); background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.hd-privacy a { color: var(--navy-light); }
