/* ============================================
   CALCULADORA DE EMBARGO DE NÓMINA
   Diseño: Dashboard financiero · Versión 1.0
   Tipografía: DM Sans + DM Mono
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&family=DM+Mono:wght@400;500&display=swap');

/* ── Variables ─────────────────────────────── */
:root {
  --bg:         #0e0f13;
  --bg-2:       #16181f;
  --bg-3:       #1e2028;
  --bg-card:    #1a1c24;
  --border:     rgba(255,255,255,.08);
  --border-2:   rgba(255,255,255,.14);
  --text:       #e8eaf0;
  --text-2:     #9da0ad;
  --text-3:     #62656f;
  --accent:     #4f8ef7;
  --accent-dim: rgba(79,142,247,.12);
  --accent-2:   #7eb8f5;
  --danger:     #f05a5a;
  --danger-dim: rgba(240,90,90,.12);
  --success:    #3fcf7f;
  --success-dim:rgba(63,207,127,.10);
  --gold:       #f5c542;
  --gold-dim:   rgba(245,197,66,.10);
  --ff:         'DM Sans', system-ui, sans-serif;
  --ff-mono:    'DM Mono', 'Courier New', monospace;
  --radius:     6px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --transition: 180ms ease;
  --shadow:     0 4px 24px rgba(0,0,0,.4);
}

/* ── Reset ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Wrapper ────────────────────────────────── */
.emb-wrapper {
  font-family: var(--ff);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  max-width: 900px;
  margin: 0 auto;
  padding: 0 0 56px;
}

/* ── CABECERA ───────────────────────────────── */
.emb-header {
  position: relative;
  padding: 52px 48px 44px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
}

.emb-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--success), var(--gold));
}

.emb-header__inner { flex: 1; position: relative; z-index: 1; }

.emb-header__eyebrow {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.emb-badge {
  display: inline-block;
  font-family: var(--ff-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: var(--accent-dim);
  color: var(--accent-2);
  border: 1px solid rgba(79,142,247,.25);
  border-radius: 4px;
  padding: 3px 10px;
}

.emb-badge--year {
  background: var(--gold-dim);
  color: var(--gold);
  border-color: rgba(245,197,66,.25);
}

.emb-header__title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 300;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -.02em;
}

.emb-header__title strong {
  font-weight: 600;
  color: #fff;
  display: block;
}

.emb-header__desc {
  font-size: 14px;
  font-weight: 300;
  color: var(--text-2);
  max-width: 480px;
  line-height: 1.7;
}

.emb-header__deco {
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.emb-scale {
  font-size: 88px;
  opacity: .06;
  line-height: 1;
  user-select: none;
}

/* ── AVISO ──────────────────────────────────── */
.emb-alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: rgba(79,142,247,.07);
  border: 1px solid rgba(79,142,247,.2);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin: 20px 24px 0;
  font-size: 13px;
  color: var(--text-2);
}

.emb-alert__icon {
  flex-shrink: 0;
  color: var(--accent-2);
  margin-top: 2px;
}

/* ── SECCIÓN TÍTULOS ────────────────────────── */
.emb-section-title {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 24px;
}

.emb-section-title__num {
  font-family: var(--ff-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(79,142,247,.2);
  border-radius: 4px;
  padding: 3px 8px;
  letter-spacing: .05em;
}

.emb-subsection-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 12px;
}

/* ── FORMULARIO ─────────────────────────────── */
.emb-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 40px 32px;
  margin: 20px 24px 0;
}

.emb-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 24px;
}

.emb-field { display: flex; flex-direction: column; gap: 6px; }
.emb-field--full { grid-column: 1 / -1; }

.emb-label {
  font-family: var(--ff-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-3);
}

.emb-required {
  color: var(--danger);
  text-decoration: none;
  margin-left: 3px;
  cursor: default;
}

.emb-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.emb-input {
  width: 100%;
  font-family: var(--ff-mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 10px 56px 10px 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -moz-appearance: textfield;
}

.emb-input::-webkit-outer-spin-button,
.emb-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.emb-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,142,247,.15);
}

.emb-input::placeholder { color: var(--text-3); font-weight: 400; }

.emb-input__suffix {
  position: absolute;
  right: 12px;
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--text-3);
  pointer-events: none;
  white-space: nowrap;
}

.emb-field__help {
  font-size: 12px;
  color: var(--text-3);
}

.emb-field__help a {
  color: var(--accent-2);
  text-decoration: none;
}
.emb-field__help a:hover { text-decoration: underline; }

/* Radio group */
.emb-radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.emb-radio {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.emb-radio:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.emb-radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}

.emb-radio__box {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--border-2);
  margin-top: 2px;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
}

.emb-radio__box::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--transition);
}

.emb-radio input[type="radio"]:checked ~ .emb-radio__box {
  border-color: var(--accent);
}

.emb-radio input[type="radio"]:checked ~ .emb-radio__box::after { opacity: 1; }

.emb-radio:has(input:checked) {
  border-color: rgba(79,142,247,.5);
  background: var(--accent-dim);
}

.emb-radio__content { flex: 1; }
.emb-radio__content strong { display: block; font-size: 14px; font-weight: 500; color: var(--text); }
.emb-radio__content small  { font-size: 12px; color: var(--text-3); line-height: 1.5; display: block; margin-top: 2px; }

/* ── BOTÓN CALCULAR ─────────────────────────── */
.emb-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--ff);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: .01em;
  transition: background var(--transition), transform 100ms ease, box-shadow var(--transition);
}

.emb-btn:hover {
  background: #6aa3f8;
  box-shadow: 0 4px 20px rgba(79,142,247,.3);
}

.emb-btn:active { transform: scale(.99); }

.emb-btn-ghost {
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--text-3);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 14px;
  cursor: pointer;
  transition: all var(--transition);
}
.emb-btn-ghost:hover { color: var(--text); border-color: var(--border-2); }

/* ── RESULTADO ──────────────────────────────── */
.emb-result {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 40px 32px;
  margin: 20px 24px 0;
  animation: fadeUp .3s ease;
}

.emb-result[hidden] { display: none; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.emb-result__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

/* KPI cards */
.emb-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.emb-kpi {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  transition: border-color var(--transition);
}

.emb-kpi:hover { border-color: var(--border-2); }

.emb-kpi__label {
  font-family: var(--ff-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}

.emb-kpi__val {
  font-family: var(--ff-mono);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
}

.emb-kpi__val--libre  { color: var(--success); }
.emb-kpi__val--embargo{ color: var(--danger); }
.emb-kpi__val--pct    { color: var(--gold); }

.emb-kpi__sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
  line-height: 1.4;
}

/* Barra visual */
.emb-visual {
  margin: 0 0 28px;
}

.emb-visual__bar {
  display: flex;
  height: 10px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-3);
  margin-bottom: 10px;
}

.emb-visual__segment {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width .5s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
  min-width: 0;
}

.emb-visual__segment--libre  { background: var(--success); }
.emb-visual__segment--embargo{ background: var(--danger); }

.emb-visual__label {
  font-size: 9px;
  font-weight: 600;
  color: rgba(0,0,0,.5);
  letter-spacing: .05em;
  white-space: nowrap;
  overflow: hidden;
}

.emb-visual__legend {
  display: flex;
  gap: 20px;
  font-size: 12px;
  color: var(--text-3);
}

.emb-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.emb-legend-item::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.emb-legend-item--libre::before  { background: var(--success); }
.emb-legend-item--embargo::before { background: var(--danger); }

/* Tabla */
.emb-table-wrap {
  overflow-x: auto;
  margin-bottom: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.emb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.emb-table th {
  text-align: left;
  font-family: var(--ff-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 10px 16px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
}

.emb-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}

.emb-table tr:last-child td { border-bottom: none; }

.emb-table tr.emb-row--active td {
  color: var(--text);
  background: rgba(245,197,66,.05);
}

.emb-table tr.emb-row--active td:last-child {
  color: var(--gold);
  font-weight: 500;
  font-family: var(--ff-mono);
}

.emb-table tr.emb-row--inembargable td { color: var(--text-3); }

.emb-table__total {
  background: var(--bg-3) !important;
}

.emb-table__total td {
  color: var(--text) !important;
  font-family: var(--ff-mono);
  border-top: 1px solid var(--border-2);
}

.emb-table__total td:last-child {
  color: var(--danger) !important;
  font-size: 15px;
}

/* Nota legal */
.emb-legal-note {
  background: var(--bg-3);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 20px;
  line-height: 1.65;
}

.emb-legal-note strong { color: var(--text); }

/* Disclaimer */
.emb-disclaimer {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.7;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ── FAQ ────────────────────────────────────── */
.emb-faq {
  margin: 36px 24px 0;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.emb-faq__title {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 20px;
}

.emb-faq__list { display: flex; flex-direction: column; gap: 8px; }

.emb-faq__item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition);
}

.emb-faq__item:hover { border-color: var(--border-2); }
.emb-faq__item[open]  { border-color: rgba(79,142,247,.3); }

.emb-faq__q {
  padding: 16px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.emb-faq__q::after {
  content: '+';
  font-size: 18px;
  font-weight: 300;
  color: var(--text-3);
  flex-shrink: 0;
  margin-left: 12px;
  transition: transform var(--transition);
}

.emb-faq__item[open] .emb-faq__q::after {
  content: '−';
}

.emb-faq__a {
  padding: 0 20px 18px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.75;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.emb-faq__a strong { color: var(--text); }

/* ── FUENTES ─────────────────────────────────── */
.emb-sources {
  margin: 36px 24px 0;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.emb-sources__title {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 10px;
}

.emb-sources__intro {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 20px;
}

.emb-sources__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.emb-source {
  display: flex;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: border-color var(--transition);
}

.emb-source:hover { border-color: var(--border-2); }

.emb-source__num {
  font-family: var(--ff-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  flex-shrink: 0;
  padding-top: 2px;
  letter-spacing: .05em;
}

.emb-source__name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.4;
}

.emb-source__desc {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.6;
  margin-bottom: 10px;
}

.emb-source__link {
  font-family: var(--ff-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--accent-2);
  text-decoration: none;
  letter-spacing: .03em;
  transition: color var(--transition);
}

.emb-source__link:hover { color: var(--text); text-decoration: underline; }

.emb-sources__footer {
  font-size: 12px;
  color: var(--text-3);
  padding-top: 16px;
  border-top: 1px solid var(--border);
  line-height: 1.8;
}

.emb-sources__footer strong { color: var(--text-2); }

/* ── RESPONSIVE ─────────────────────────────── */
@media (max-width: 680px) {
  .emb-header { padding: 28px 20px 24px; flex-direction: column; }
  .emb-scale   { display: none; }
  .emb-form,
  .emb-result  { padding: 24px 20px; margin: 16px 12px 0; }
  .emb-alert   { margin: 16px 12px 0; }
  .emb-faq,
  .emb-sources { margin: 28px 12px 0; }
  .emb-form__grid   { grid-template-columns: 1fr; }
  .emb-radio-group  { grid-template-columns: 1fr; }
  .emb-kpis         { grid-template-columns: 1fr 1fr; }
  .emb-sources__grid{ grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
  .emb-kpis { grid-template-columns: 1fr; }
}

/* ── UTILIDADES ──────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Número formateado en tabla */
.num { font-family: var(--ff-mono); }