/* Cálculos Jurídicos — estilos */
:root {
  --navy: hsl(202 65% 20%);
  --navy-2: hsl(202 55% 30%);
  --copper: hsl(37 41% 52%);
  --copper-2: hsl(37 50% 62%);
  --copper-3: hsl(37 45% 42%);
  --ivory: hsl(60 24% 97%);
  --fg: hsl(0 0% 18%);
  --muted: hsl(202 20% 40%);
  --border: hsl(210 20% 86%);
  --bg-soft: hsl(210 20% 95%);
  --ok-bg: hsl(140 40% 94%); --ok-fg: hsl(140 45% 26%);
  --warn-bg: hsl(37 70% 93%); --warn-fg: hsl(30 55% 32%);
  --err-bg: hsl(0 65% 95%); --err-fg: hsl(0 55% 40%);
  --radius: 12px;
  --shadow: 0 8px 24px hsl(202 40% 20% / 0.10);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--fg); background: var(--ivory); line-height: 1.5; font-size: 15px; }
a { color: var(--navy-2); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 8px; color: var(--navy); }
h1 { font-size: 38px; letter-spacing: -0.5px; }
h2 { font-size: 26px; }
h3 { font-size: 18px; }
p { margin: 0 0 10px; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Header */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--navy); color: #fff; box-shadow: 0 2px 10px hsl(202 60% 10% / 0.3); }
.topbar .container { display: flex; align-items: center; gap: 18px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -0.2px; }
.brand .logo { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--copper-2), var(--copper-3)); display: grid; place-items: center; font-size: 18px; color: hsl(30 45% 14%); }
.topnav { display: flex; gap: 16px; margin-left: 12px; }
.topnav a { color: hsl(0 0% 100% / 0.85); text-decoration: none; font-size: 14px; }
.topnav a:hover { color: #fff; }
.topbar .spacer { flex: 1; }
.userbox { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.userbox .plan { background: hsl(0 0% 100% / 0.15); border-radius: 999px; padding: 2px 10px; font-size: 12px; }
.userbox .plan.pro { background: var(--copper); color: hsl(30 45% 14%); font-weight: 600; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 9px; padding: 9px 16px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: linear-gradient(135deg, var(--copper-2), var(--copper-3)); color: hsl(30 45% 14%); }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 16px hsl(37 45% 42% / 0.35); }
.btn-navy { background: var(--navy-2); color: #fff; }
.btn-navy:hover:not(:disabled) { background: var(--navy); }
.btn-outline { background: #fff; border-color: var(--border); color: var(--navy); }
.btn-outline:hover:not(:disabled) { border-color: var(--navy-2); }
.btn-ghost { background: transparent; color: var(--navy-2); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-soft); }
.btn-light { background: hsl(0 0% 100% / 0.15); color: #fff; }
.btn-light:hover:not(:disabled) { background: hsl(0 0% 100% / 0.25); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* Hero */
.hero { background: linear-gradient(160deg, hsl(202 65% 23%), hsl(202 60% 15%)); color: #fff; padding: 64px 0 56px; }
.hero h1 { color: #fff; max-width: 720px; }
.hero p.lead { font-size: 18px; max-width: 640px; color: hsl(0 0% 100% / 0.85); margin-bottom: 22px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero .fuentes { margin-top: 26px; font-size: 13px; color: hsl(0 0% 100% / 0.7); }
.hero .fuentes strong { color: var(--copper-2); font-weight: 600; }

/* Secciones */
section.bloque { padding: 48px 0; }
section.bloque.alt { background: #fff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.sub { color: var(--muted); max-width: 680px; margin-bottom: 24px; }

.grid-calc { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.calc-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; transition: transform .15s ease; }
.calc-card:hover { transform: translateY(-3px); }
.calc-card .icono { font-size: 28px; }
.calc-card p { font-size: 13.5px; color: var(--muted); flex: 1; }

.pie-indices { margin-top: 18px; font-size: 13px; color: var(--muted); background: #fff; border: 1px dashed var(--border); border-radius: 10px; padding: 10px 14px; }

/* Precios */
.grid-precios { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; max-width: 760px; }
.precio { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.precio.destacado { border: 2px solid var(--copper); position: relative; }
.precio.destacado::before { content: "Recomendado"; position: absolute; top: -12px; left: 20px; background: var(--copper); color: hsl(30 45% 14%); font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.precio .monto { font-size: 32px; font-weight: 700; color: var(--navy); margin: 6px 0; }
.precio .monto small { font-size: 14px; color: var(--muted); font-weight: 500; }
.precio ul { padding-left: 18px; margin: 10px 0 18px; font-size: 14px; }
.precio li { margin-bottom: 4px; }

/* Listas (mis cálculos, admin) */
.lista { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.lista .fila { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
.lista .fila:last-child { border-bottom: none; }
.lista .fila .t { font-weight: 600; color: var(--navy); }
.lista .fila .s { font-size: 12.5px; color: var(--muted); }
.lista .vacio { padding: 18px; color: var(--muted); font-size: 14px; }

.tarjeta { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }

/* Footer */
footer { padding: 30px 0 40px; font-size: 12.5px; color: var(--muted); }
footer .aviso { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }

/* Formularios */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px; background: #fff; color: var(--fg); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--navy-2); box-shadow: 0 0 0 3px hsl(202 55% 30% / 0.15); }
.field input.detectado { background: hsl(140 40% 96%); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.grid-2 .span-2 { grid-column: 1 / -1; }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; font-size: 14px; }
.checkbox-row label { font-size: 14px; color: var(--fg); font-weight: 500; }
.caja { border: 1px dashed var(--border); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.caja > label.titulo { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.toast { border-radius: 8px; padding: 9px 12px; font-size: 13.5px; margin: 8px 0; }
.toast.err { background: var(--err-bg); color: var(--err-fg); }
.toast.ok { background: var(--ok-bg); color: var(--ok-fg); }
.toast.warn { background: var(--warn-bg); color: var(--warn-fg); }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: hsl(202 60% 10% / 0.55); display: flex; align-items: flex-start; justify-content: center; padding: 30px 14px; overflow: auto; z-index: 50; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 760px; box-shadow: 0 24px 60px hsl(202 60% 10% / 0.35); padding: 20px 22px 18px; }
.modal.chico { max-width: 420px; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.modal-header h2 { font-size: 20px; }
.modal-header p { font-size: 13px; color: var(--muted); margin: 0; }
.modal-close { border: none; background: var(--bg-soft); border-radius: 8px; width: 32px; height: 32px; cursor: pointer; font-size: 16px; }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* Resultado */
.resultado { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-top: 10px; background: hsl(60 24% 98%); }
.resultado table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.resultado td { padding: 4px 6px; vertical-align: top; border-bottom: 1px solid hsl(210 20% 92%); }
.resultado td.v { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.resultado .det { font-size: 11.5px; color: var(--muted); }
.resultado .total { font-size: 18px; text-align: right; margin-top: 10px; color: var(--navy); }
.resultado .adv { margin-top: 8px; font-size: 12.5px; color: var(--warn-fg); }
.resultado details summary { cursor: pointer; font-size: 13px; }
.resultado .tramos { max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: 6px; margin-top: 4px; }
.resultado .tramos table { font-size: 12px; }
.resultado .tramos th { position: sticky; top: 0; background: var(--bg-soft); text-align: left; padding: 3px 8px; }
.tabla-meses { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabla-meses th { text-align: left; background: var(--bg-soft); padding: 4px 8px; }
.tabla-meses td { padding: 3px 8px; }
.tabla-meses input { width: 100%; }

@media (max-width: 720px) {
  h1 { font-size: 30px; }
  .topnav { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .modal { padding: 16px; }
  .lista .fila { grid-template-columns: 1fr; }
}
@media print {
  .topbar, .hero, section.bloque, footer, .modal-actions, .modal-close { display: none !important; }
  .modal-overlay { position: static; padding: 0; background: #fff; }
  .modal { box-shadow: none; max-width: none; }
}
