/* =========================================================
   EdukIA Next · Lab de Ley Normal
   CSS encapsulado bajo .shell para WordPress
   ========================================================= */

/* ---------- Variables (ámbito .shell) ---------- */
.shell{
  --ink:#172031;
  --muted:#637087;
  --line:#dfe5ef;
  --red:#e9144d;
  --redbg:#fff1f3;
  --green:#098950;
  --greenbg:#edfff5;
  --blue:#2c4ca3;
  --bg:#f4f6fb;

  max-width:1380px;
  padding:28px 23px 56px;
  margin:0 auto;
  color:var(--ink);
  font-family:Inter,ui-sans-serif,system-ui,Segoe UI,Arial,sans-serif;
  background:radial-gradient(ellipse at 70% -20%,#e8f0ff 0,transparent 55%),var(--bg);
  border-radius:18px;
}

/* Reset local: solo dentro de .shell */
.shell *,
.shell *::before,
.shell *::after{box-sizing:border-box;}

/* ---------- Layout ---------- */
.shell .layout{
  display:grid;
  grid-template-columns:minmax(310px,425px) minmax(0,1fr);
  align-items:start;
  gap:20px;
}

/* ---------- Paneles ---------- */
.shell .panel{
  background:#fff;
  border:1px solid #e6eaf2;
  border-radius:22px;
  box-shadow:0 12px 40px #1720310b;
  padding:22px;
}

/* ---------- Título del formulario ---------- */
.shell .formTitle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin:0 0 18px;
}
.shell .formTitle h2{
  font-size:18px;
  margin:0;
  letter-spacing:-.02em;
}
.shell .tag{
  font-size:11px;
  font-weight:800;
  letter-spacing:.07em;
  color:var(--blue);
  background:#edf2ff;
  padding:5px 9px;
  border-radius:20px;
}

/* ---------- Controles ---------- */
.shell .control{
  border:1px solid var(--line);
  border-radius:15px;
  margin-bottom:14px;
  padding:13px 15px;
  background:#fff;
}
.shell .control.red{border:2px solid #f3b1c2;background:var(--redbg);}
.shell .control.green{border:2px solid #b8ebcd;background:var(--greenbg);}
.shell .control label{
  display:block;
  font-weight:900;
  font-size:12px;
  line-height:1.5;
  letter-spacing:.012em;
  margin-bottom:8px;
}
.shell .control.red label{color:#a90d3a;}
.shell .control.green label{color:#076d3d;}
.shell .control input,
.shell .control textarea{
  width:100%;
  font-size:17px;
  line-height:1.5;
  border:1px solid #d6dce8;
  border-radius:10px;
  background:#fff;
  color:var(--ink);
  padding:10px 11px;
  outline:none;
  font-family:inherit;
}
.shell .control input:focus,
.shell .control textarea:focus{
  border-color:#6f89d1;
  box-shadow:0 0 0 3px #6884d32b;
}
.shell .control textarea{
  resize:vertical;
  min-height:105px;
  font-size:15px;
}
.shell .desc{
  font-size:11px;
  color:#607089;
  margin:8px 0 0;
}

/* ---------- Filas de dos columnas ---------- */
.shell .row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.shell .row .control{min-width:0;}
.shell .row .control label{min-height:38px;}

/* ---------- Botones ---------- */
.shell button{
  cursor:pointer;
  border:none;
  border-radius:12px;
  font-weight:850;
  font-size:15px;
  font-family:inherit;
}
.shell .mainBtn{
  width:100%;
  background:var(--red);
  color:#fff;
  padding:15px 12px;
  box-shadow:0 8px 17px #e9144d29;
}
.shell .mainBtn:hover{background:#c9093c;}
.shell .mainBtn:disabled{opacity:.6;cursor:wait;}
.shell .secondBtn{
  background:#eef2f9;
  color:#334155;
  padding:12px;
}
.shell .controls{
  display:flex;
  gap:10px;
}
.shell .controls > .mainBtn{flex:1;}

/* ---------- Texto informativo ---------- */
.shell .info{
  color:#637087;
  font-size:12px;
  line-height:1.6;
  margin:15px 0 0;
}

/* ---------- Mensaje de error ---------- */
.shell .message{
  display:none;
  border-radius:12px;
  padding:10px 12px;
  margin:0 0 12px;
  border:1px solid #fac7c7;
  background:#fff4f2;
  color:#922d24;
  font-size:13px;
  line-height:1.5;
}
.shell .message.show{display:block;}

/* ---------- Cabecera del gráfico ---------- */
.shell .graphTop{
  display:flex;
  justify-content:space-between;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}
.shell .graphTop h2{
  margin:0;
  font-size:20px;
  letter-spacing:-.025em;
}
.shell .bubble{
  border-radius:999px;
  border:1px solid #e2e6ee;
  background:#f6f8fc;
  padding:6px 10px;
  color:#59667c;
  font-size:12px;
  font-weight:700;
}

/* ---------- Contenedor del gráfico ---------- */
.shell .chartHolder{
  width:100%;
  margin-top:11px;
  border-radius:14px;
  border:1px solid #e4eaf4;
  overflow:hidden;
  background:#fbfcff;
}
.shell .curveSvg{
  width:100%;
  display:block;
  aspect-ratio:900/345;
}
.shell .curveSvg text{font-family:inherit;}
.shell #shade{opacity:0;transition:opacity .25s;}
.shell #strokePath{stroke-dasharray:1100;stroke-dashoffset:1100;}

/* ---------- Estado del proceso ---------- */
.shell #stage{
  font-size:12px;
  color:var(--muted);
  min-height:20px;
  margin-top:9px;
}

/* ---------- Resultados ---------- */
.shell .resultBox{
  margin-top:14px;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.shell .metric{
  background:#f7f9fe;
  border:1px solid #e4e9f3;
  border-radius:14px;
  padding:14px;
}
.shell .metricTitle{
  color:#66748c;
  font-size:12px;
  font-weight:700;
}
.shell .metricVal{
  margin-top:5px;
  font-size:clamp(20px,2.2vw,30px);
  font-weight:900;
  color:#142b52;
  font-variant-numeric:tabular-nums;
}
.shell .metricVal.pink{color:var(--red);}

/* ---------- Bloque final (reservado) ---------- */
.shell .final{
  display:none;
  margin-top:12px;
  padding:16px;
  border:1px solid #cbd9ed;
  background:#f3f8ff;
  border-radius:16px;
  line-height:1.55;
}
.shell .final.show{display:block;}
.shell .final strong{color:#173e79;}
.shell .resultContext{margin-top:6px;font-size:15px;}

/* =========================================================
   Componentes dentro del SVG (contexto y gato)
   ========================================================= */

.shell .graphContextBox,
.shell .graphCatBox{
  font-family:Inter,ui-sans-serif,system-ui,Segoe UI,Arial,sans-serif;
}

.shell .graphContextBox{
  width:100%;
  height:100%;
  background:rgba(255,255,255,.84);
  border:1px solid #dbe5f2;
  border-radius:16px;
  padding:11px 12px;
  box-shadow:0 3px 16px #17203110;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  color:#2d405a;
}
.shell .graphContextBox .ctxLabel{
  font-size:11px;
  line-height:1.2;
  font-weight:900;
  letter-spacing:.08em;
  color:#5473a7;
  text-transform:uppercase;
}
.shell .graphContextBox .ctxText{
  font-size:13.4px;
  line-height:1.35;
  white-space:normal;
  overflow-wrap:anywhere;
  overflow:auto;
  min-height:0;
  flex:0 0 auto;
  scrollbar-width:thin;
}
.shell .graphContextBox .ctxComplement{
  font-size:13px;
  line-height:1.33;
  white-space:normal;
  overflow-wrap:anywhere;
  margin-top:6px;
  padding-top:6px;
  border-top:1px dashed #d8e3f0;
  color:#334c6c;
  overflow:auto;
  flex:1;
  scrollbar-width:thin;
}
.shell .graphContextBox .ctxExtreme{
  font-size:11px;
  font-weight:850;
  color:#b91c1c;
  margin-top:5px;
  line-height:1.3;
}

/* Transiciones de los overlays */
.shell #contextOverlay,
.shell #catOverlay{
  opacity:0;
  transition:opacity .32s ease;
  pointer-events:none;
}
.shell #contextOverlay.visible,
.shell #catOverlay.visible{opacity:1;}
.shell #catOverlay.visible{pointer-events:auto;}

/* Caja del gato */
.shell .graphCatBox{
  width:100%;
  height:100%;
  background:rgba(255,255,255,.95);
  border:1px solid #dae4f1;
  border-radius:17px;
  box-shadow:0 4px 18px #17203114;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:space-between;
  padding:5px;
  position:relative;
  overflow:hidden;
  color:#122139;
}
.shell .catVideo{
  display:none;
  width:100%;
  flex:1;
  min-height:0;
  object-fit:cover;
  object-position:center center;
  border-radius:12px;
  background:#fff;
}
.shell .graphCatBox.success #catHappyVideo,
.shell .graphCatBox.fail #catAngryVideo{display:block;}

.shell .catFooter{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  width:100%;
  min-height:25px;
  flex:none;
}
.shell .catSpeech{
  font-size:18px;
  letter-spacing:.07em;
  font-weight:950;
  line-height:1;
  color:#08794c;
}
.shell .graphCatBox.fail .catSpeech{color:#bb2541;}
.shell .catReplay{
  background:#edf2f9;
  border:1px solid #d8e3f0;
  color:#2c4264;
  font-size:11px;
  padding:4px 7px;
  border-radius:8px;
  cursor:pointer;
  line-height:1;
}
.shell .catReplay:hover{background:#e0e9f5;}
.shell .catSoundNotice{
  display:none;
  position:absolute;
  left:9px;
  right:9px;
  top:8px;
  border-radius:8px;
  background:rgba(255,255,255,.96);
  font-size:10px;
  line-height:1.3;
  color:#9b2137;
  padding:4px 6px;
  text-align:center;
  box-shadow:0 2px 6px #0001;
}
.shell .catSoundNotice.visible{display:block;}
.shell .extremeMeta{
  font-size:13px;
  font-weight:900;
  color:#a61031;
  margin-top:6px;
  line-height:1.25;
}

/* ---------- Accesibilidad ---------- */
.shell .visuallyHidden{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

/* ---------- Cabecera de pasos ---------- */
.shell .stepsHeader{
  display:flex;
  align-items:center;
  gap:12px;
  margin:22px 0 10px;
}
.shell .stepsHeader h3{
  margin:0;
  font-size:18px;
}

/* ---------- Pasos ---------- */
.shell .steps{display:grid;gap:9px;}
.shell .step{
  border:1px solid #e1e6ee;
  border-radius:14px;
  background:#fcfdff;
  padding:13px 14px;
  opacity:0;
  transform:translateY(8px);
  transition:opacity .35s,transform .35s;
}
.shell .step.show{opacity:1;transform:none;}
.shell .stepTitle{
  font-size:13px;
  font-weight:900;
  color:#274475;
}
.shell .stepContent{
  margin-top:6px;
  font-size:13px;
  line-height:1.55;
  color:#38465b;
}
.shell .pill{
  font-size:12px;
  background:#eaf0f9;
  border:1px solid #dae5f5;
  border-radius:6px;
  padding:2px 6px;
  white-space:nowrap;
  font-variant-numeric:tabular-nums;
}
.shell .tiny{
  color:#6b788c;
  font-size:11px;
  line-height:1.6;
  margin:12px 0 0;
}
.shell .hidden{display:none !important;}

/* ---------- Responsive ---------- */
@media (max-width:950px){
  .shell .layout{grid-template-columns:1fr;}
}

@media (max-width:620px){
  .shell{padding:13px 12px 35px;}
  .shell .row{grid-template-columns:1fr;}
  .shell .row .control label{min-height:0;}
  .shell .panel{padding:16px;border-radius:16px;}
  .shell .resultBox{grid-template-columns:1fr 1fr;}
  .shell .metric{padding:10px;}
  .shell #catReaction{grid-template-columns:115px 1fr;}
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion:reduce){
  .shell *,
  .shell *::before,
  .shell *::after{
    animation-duration:.01ms !important;
    transition-duration:.01ms !important;
  }
}