/* Herencia: asistente «¿Qué plan de herencia me encaja?» (herencia.html). */
.hw { --hw-o:#F7931A; --hw-line:rgba(255,255,255,.09); border-color:rgba(247,147,26,.38); background:radial-gradient(120% 120% at 100% 0%,rgba(247,147,26,.10),rgba(247,147,26,0) 55%),#050505; }
.hw-head h2 { margin-top:6px; }
.hw-label { display:inline-block; font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:2px; color:var(--hw-o); }
.hw-legal { display:flex; gap:12px; align-items:flex-start; margin:16px 0 4px; padding:12px 14px; border:1px solid rgba(247,147,26,.45); border-radius:12px; background:rgba(247,147,26,.08); font-size:.92rem; line-height:1.55; color:#E6E6E6; }
.hw-legal strong { color:#fff; }
.hw-legal-i { flex:0 0 24px; height:24px; border-radius:50%; background:var(--hw-o); color:#000; font-weight:900; display:flex; align-items:center; justify-content:center; font-size:.85rem; }

.hw-form { margin-top:22px; }
.hw-prog, .hw-step, .hw-nav { display:none; }
.hw-form.hw-js .hw-prog { display:block; height:4px; border-radius:4px; background:var(--hw-line); overflow:hidden; }
.hw-form.hw-js .hw-step { display:block; }
.hw-form.hw-js .hw-nav { display:flex; }
.hw-prog-bar { display:block; height:100%; width:0; background:var(--hw-o); box-shadow:0 0 12px rgba(247,147,26,.7); transition:width .45s cubic-bezier(.2,.8,.2,1); }
.hw-step { margin:12px 0 4px; font-family:'JetBrains Mono',monospace; font-size:.75rem; letter-spacing:1px; color:var(--text-secondary); }

.hw-q { border:0; padding:0; margin:0 0 18px; min-width:0; }
.hw-form.hw-js .hw-q { margin:0; }
.hw-q.in { animation:hwIn .4s cubic-bezier(.2,.8,.2,1) both; }
.hw-q legend { display:flex; gap:12px; align-items:baseline; padding:0; margin:6px 0 14px; font-size:clamp(1.08rem,2.2vw,1.3rem); font-weight:700; line-height:1.35; color:var(--text-primary); }
.hw-qn { font-family:'JetBrains Mono',monospace; font-size:.8rem; font-weight:600; color:var(--hw-o); }
.hw-opts { display:grid; gap:10px; }
.hw-opt { position:relative; display:flex; gap:12px; align-items:center; padding:14px 16px; border:1px solid var(--hw-line); border-radius:12px; background:#0c0c0c; cursor:pointer; color:var(--text-secondary); line-height:1.45; transition:border-color .2s,background .2s,color .2s,transform .2s; }
.hw-opt input { position:absolute; opacity:0; width:1px; height:1px; }
.hw-dot { flex:0 0 18px; height:18px; border-radius:50%; border:2px solid #555; transition:border-color .2s,box-shadow .2s; }
.hw-opt:hover { border-color:rgba(247,147,26,.5); color:var(--text-primary); }
.hw-opt:has(input:checked) { border-color:var(--hw-o); background:rgba(247,147,26,.09); color:#fff; }
.hw-opt:has(input:checked) .hw-dot { border-color:var(--hw-o); box-shadow:inset 0 0 0 4px #0c0c0c,inset 0 0 0 9px var(--hw-o); }
.hw-opt:has(input:focus-visible) { outline:2px solid var(--hw-o); outline-offset:2px; }

.hw-err { margin-top:12px; color:#FCA5A5; font-size:.9rem; }
.hw-nav { justify-content:space-between; gap:12px; margin-top:18px; }
.hw-btn { font:inherit; font-weight:700; font-size:.95rem; padding:12px 22px; min-height:44px; border-radius:10px; border:1px solid var(--hw-o); background:var(--hw-o); color:#000; cursor:pointer; transition:transform .2s,box-shadow .2s,background .2s,color .2s; }
.hw-btn:hover { box-shadow:0 0 22px rgba(247,147,26,.45); transform:translateY(-1px); }
.hw-btn.ghost { background:transparent; color:var(--hw-o); }
.hw-btn:disabled { opacity:.35; cursor:default; box-shadow:none; transform:none; }
.hw-btn:focus-visible, .hw-rk:focus-visible, .hw-more:focus-visible { outline:2px solid #fff; outline-offset:3px; }

.hw-res { margin-top:22px; scroll-margin-top:96px; }
.hw-res.in .hw-card, .hw-res.in .hw-grid > *, .hw-res.in .hw-note { animation:hwIn .5s cubic-bezier(.2,.8,.2,1) both; }
.hw-res.in .hw-why { animation-delay:.12s; } .hw-res.in .hw-ranks { animation-delay:.2s; } .hw-res.in .hw-note { animation-delay:.28s; }
.hw-card { padding:22px; border:1px solid var(--hw-o); border-radius:16px; background:linear-gradient(160deg,rgba(247,147,26,.12),rgba(247,147,26,.02) 60%),#0a0a0a; box-shadow:0 0 40px -18px rgba(247,147,26,.6); scroll-margin-top:96px; }
.hw-card.swap #hwDetail, .hw-card.swap .hw-card-h { animation:hwIn .35s ease both; }
.hw-card-h { display:flex; gap:14px; align-items:center; margin-bottom:12px; }
.hw-card-h > div { flex:1; min-width:0; }
.hw-card-h h3 { font-size:clamp(1.15rem,2.4vw,1.45rem); line-height:1.25; margin-top:2px; outline:none; }
.hw-big { flex:0 0 52px; height:52px; border-radius:14px; background:var(--hw-o); color:#000; font-weight:900; font-size:1.2rem; display:flex; align-items:center; justify-content:center; }
.hw-fit { flex:0 0 auto; text-align:right; font-size:.7rem; text-transform:uppercase; letter-spacing:1.5px; color:var(--text-secondary); }
.hw-fit b { display:block; font-family:'JetBrains Mono',monospace; font-size:1.5rem; letter-spacing:0; color:var(--hw-o); }
.hw-sum { color:#D6D6DA; line-height:1.65; }
.hw-cols { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-top:16px; }
.hw-col { padding:14px; border-radius:12px; border:1px solid var(--hw-line); background:rgba(0,0,0,.45); }
.hw-col h4, .hw-why h4, .hw-ranks h4 { font-size:.75rem; text-transform:uppercase; letter-spacing:1.5px; margin-bottom:10px; }
.hw-col.pro h4 { color:#4ADE80; } .hw-col.con h4 { color:#FBBF24; } .hw-col.risk h4 { color:#F87171; }
.hw-col ul, .hw-why ul { list-style:none; display:grid; gap:8px; margin:0; padding:0; }
.hw-col li, .hw-why li { position:relative; padding-left:18px; font-size:.9rem; line-height:1.5; color:var(--text-secondary); }
.hw-col li::before { position:absolute; left:0; top:0; font-weight:700; }
.hw-col.pro li::before { content:'+'; color:#4ADE80; } .hw-col.con li::before { content:'−'; color:#FBBF24; } .hw-col.risk li::before { content:'!'; color:#F87171; }
.hw-why li::before { content:''; position:absolute; left:2px; top:.6em; width:7px; height:7px; border-radius:50%; background:var(--hw-o); }
.hw-more { display:inline-block; margin-top:14px; font-weight:700; color:var(--hw-o); text-decoration:none; }
.hw-more::after { content:' →'; }
.hw-more:hover { text-decoration:underline; }

.hw-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:18px; margin-top:18px; }
.hw-why, .hw-ranks { padding:18px; border:1px solid var(--hw-line); border-radius:14px; background:#0a0a0a; }
.hw-hint { font-size:.82rem; color:var(--text-secondary); margin:-4px 0 10px; }
.hw-rank { list-style:none; display:grid; gap:8px; margin:0; padding:0; }
.hw-rk { width:100%; display:grid; grid-template-columns:30px minmax(0,1fr) 52px; grid-template-areas:"i n v" "i b b"; gap:4px 10px; align-items:center; padding:10px 12px; border:1px solid var(--hw-line); border-radius:10px; background:#0f0f0f; color:var(--text-secondary); font:inherit; font-size:.88rem; text-align:left; cursor:pointer; transition:border-color .2s,background .2s,color .2s; }
.hw-rk:hover { border-color:rgba(247,147,26,.5); color:var(--text-primary); }
.hw-rk.on { border-color:var(--hw-o); background:rgba(247,147,26,.08); color:#fff; }
.hw-rk-i { grid-area:i; width:30px; height:30px; border-radius:8px; background:rgba(247,147,26,.15); color:var(--hw-o); font-weight:800; font-size:.78rem; display:flex; align-items:center; justify-content:center; }
.hw-rk-n { grid-area:n; line-height:1.3; }
.hw-rk-n em { font-style:normal; font-size:.62rem; font-weight:700; text-transform:uppercase; letter-spacing:1px; padding:2px 6px; margin-left:4px; border-radius:6px; background:var(--hw-o); color:#000; white-space:nowrap; }
.hw-rk-v { grid-area:v; text-align:right; font-family:'JetBrains Mono',monospace; font-size:.8rem; color:var(--hw-o); }
.hw-rk-bar { grid-area:b; height:5px; border-radius:5px; background:var(--hw-line); overflow:hidden; }
.hw-rk-bar span { display:block; height:100%; background:var(--hw-o); border-radius:5px; transition:width .8s cubic-bezier(.2,.8,.2,1); }
.hw-note { margin-top:18px; }
#hwRestart { margin-top:16px; }
.hw-sr { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

@keyframes hwIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }

@media (max-width:820px) { .hw-cols { grid-template-columns:1fr; } .hw-grid { grid-template-columns:1fr; } }
@media (max-width:480px) {
  .hw-card { padding:16px; }
  .hw-card-h { flex-wrap:wrap; }
  .hw-big { flex-basis:44px; height:44px; font-size:1rem; }
  .hw-fit { order:3; width:100%; text-align:left; display:flex; gap:8px; align-items:baseline; }
  .hw-fit b { display:inline; font-size:1.2rem; }
  .hw-opt { padding:12px 14px; font-size:.95rem; }
  .hw-nav .hw-btn { flex:1; padding:12px 14px; }
  .hw-why, .hw-ranks { padding:14px; }
}
@media (prefers-reduced-motion: reduce) {
  .hw-q.in, .hw-res.in .hw-card, .hw-res.in .hw-grid > *, .hw-res.in .hw-note, .hw-card.swap #hwDetail, .hw-card.swap .hw-card-h { animation:none; }
  .hw-prog-bar, .hw-rk-bar span, .hw-opt, .hw-btn, .hw-rk { transition:none; }
  .hw-btn:hover { transform:none; }
}
