:root {
  --primary:       #1c3461;
  --primary-hover: #16295a;
  --accent:        #0087c8;
  --accent-hover:  #006fa8;
  --text:          #333333;
  --text-light:    #666666;
  --text-muted:    #999999;
  --border:        #cccccc;
  --bg:            #eef0f3;
  --white:         #ffffff;
  --divider:       #dde0e6;
  --green:         #2e9e5b;
  --red:           #c0392b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Source Sans 3', 'Segoe UI', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Site header ── */
.site-header { background: var(--primary); color: #fff; }
.site-header .inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: stretch;
}
.site-header .logo-block {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  flex: 1;
}
.site-logo { display: block; height: 46px; width: auto; }
.print-logo { display: none; }
.header-accent-bar {
  height: 4px;
  background: linear-gradient(90deg, #0087c8 0%, #00b4d8 100%);
}

/* ── Breadcrumb ── */
.breadcrumb-bar {
  background: #dde1e8;
  border-bottom: 1px solid #c8cdd6;
  padding: 8px 0;
  font-size: 13px;
}
.breadcrumb-bar .inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-light);
}
.breadcrumb-bar a { color: var(--accent); text-decoration: none; }
.breadcrumb-bar a:hover { text-decoration: underline; }
.breadcrumb-bar .sep { color: #aaa; }
.breadcrumb-bar .current { color: var(--text); font-weight: 600; }

/* ── Page layout ── */
.page {
  max-width: 940px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}
.page-heading {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-bottom: 26px;
  background: linear-gradient(135deg, #1c3461 0%, #16295a 100%);
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  padding: 32px 34px;
}
.page-heading-bar {
  width: 5px;
  min-height: 60px;
  background: var(--accent);
  border-radius: 3px;
  flex-shrink: 0;
  margin-right: 18px;
  margin-top: 3px;
}
.page-title {
  font-size: 34px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 8px;
  line-height: 1.15;
}
.page-subtitle { font-size: 18px; color: rgba(255,255,255,0.75); margin: 0; }

@media (max-width: 640px) {
  .page-heading { padding: 22px 20px; }
  .page-title { font-size: 26px; }
  .page-subtitle { font-size: 16px; }
}

/* ── Aviso general ── */
.info-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--white);
  border: 1px solid var(--divider);
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
  padding: 16px 20px;
  margin-bottom: 30px;
}
.info-banner svg { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.info-banner .ib-title { font-size: 15px; font-weight: 700; color: var(--primary); }
.info-banner .ib-sub { font-size: 13px; color: var(--text-light); margin-top: 2px; }
.info-banner .ib-mmc { font-size: 13px; color: var(--text-light); margin-top: 6px; }
.info-banner .ib-mmc b { color: var(--primary); }

/* Aviso de cálculo provisorio: el decreto del año en curso todavía no salió */
.aviso-mmc {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #fff8e1;
  border: 1px solid #f0dfa8;
  border-left: 4px solid #e2b93b;
  border-radius: 4px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
  padding: 16px 20px;
  margin: -14px 0 30px;
  color: #7a5c12;
  font-size: 13.5px;
}
.aviso-mmc svg { color: #c9971a; flex-shrink: 0; margin-top: 1px; }
.aviso-mmc b { display: block; color: #6b4f0a; font-size: 14px; margin-bottom: 2px; }
.aviso-mmc[hidden] { display: none; }

/* ── Tarjeta de simulador ── */
.sim {
  background: var(--white);
  border: 1px solid var(--divider);
  border-radius: 4px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
  overflow: hidden;
  margin-bottom: 22px;
}
.sim-head {
  background: linear-gradient(135deg, #3a5c93 0%, #315184 100%);
  color: #fff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.sim-head > div:first-child { flex: 1; }
.sim-head h2 { font-size: 17px; font-weight: 700; margin: 0; }
.sim-head .esc-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.7);
}
.chevron {
  color: rgba(255,255,255,0.85);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.sim.collapsed .chevron { transform: rotate(-90deg); }
.sim.collapsed .sim-body { display: none; }

/* ── Barra de fecha ── */
.sim-datebar {
  display: flex;
  justify-content: flex-end;
  padding: 10px 24px 0;
  font-size: 12px;
  color: var(--text-muted);
}
.sim-datebar b { color: var(--text-light); font-weight: 600; }

/* ── Bloques ── */
.block { padding: 4px 24px 18px; }
.block-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 6px;
  margin: 18px 0 14px;
}
.subhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  background: #eef2f7;
  border-left: 3px solid var(--primary);
  padding: 7px 12px;
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Filas de campos ── */
.frow {
  display: grid;
  grid-template-columns: minmax(220px, 1.15fr) minmax(200px, 1fr);
  gap: 10px 18px;
  align-items: center;
  padding: 7px 0;
}
.frow > label, .frow > .flabel {
  font-size: 14.5px;
  color: var(--text);
  font-weight: 400;
}

input[type="text"],
input[type="date"],
input[type="number"],
select {
  width: 100%;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text);
  background: #fffdf0;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 7px 9px;
  transition: border-color 0.12s, box-shadow 0.12s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,135,200,0.15);
}
select { cursor: pointer; }
input[type="number"] { text-align: right; }

/* ── Salidas calculadas ── */
.out {
  display: block;
  width: 100%;
  font-size: 14.5px;
  font-weight: 400;
  color: var(--text);
  background: #eef2f7;
  border: 1px solid #d3dae4;
  border-radius: 3px;
  padding: 7px 9px;
  min-height: 36px;
}
.out.num { text-align: right; }

/* ── Fecha vencimiento plazo + aclaración (misma caja) ── */
.note-box {
  background: #fff8e1;
  border: 1px solid #f0dfa8;
  border-left: 3px solid #e2b93b;
  border-radius: 3px;
  padding: 2px 14px 10px;
  margin: 8px 0;
}
.note-box .frow { padding: 8px 0 6px; }
.note-text {
  font-size: 12.5px;
  color: #7a5c12;
  border-top: 1px dashed #e6d391;
  padding-top: 7px;
}
.note-text b { display: block; margin-bottom: 2px; }
.note-text .leyenda { margin: 0 0 8px; }
.note-text .leyenda b { display: inline; margin: 0; }
.aviso {
  background: #fdecea;
  border: 1px solid #f3c0ba;
  border-left: 3px solid var(--red);
  border-radius: 3px;
  padding: 9px 12px;
  margin: 8px 0 0;
  font-size: 12.5px;
  color: #8c2c1f;
}
.aviso b { font-weight: 700; }
.aviso[hidden] { display: none; }
.note-text ul { margin: 2px 0 0; padding-left: 18px; }

/* ── Resultado / aclaración / acciones ── */
.result-block { background: #f7f9fc; border-top: 1px solid var(--divider); }
.aclaracion {
  background: #f4f6f9;
  border-top: 1px solid var(--divider);
  padding: 16px 24px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-light);
  font-style: italic;
}
.aclaracion b { font-style: normal; color: var(--text); }
.sim-actions {
  border-top: 1px solid var(--divider);
  padding: 14px 24px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: 3px;
  padding: 9px 20px;
  cursor: pointer;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.12s;
}
.btn:hover { background: var(--primary-hover); }
.btn.secondary { background: #fff; color: var(--primary); }
.btn.secondary:hover { background: #eef2f7; }

/* ── Footer ── */
.site-footer {
  background: var(--primary);
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  text-align: center;
  padding: 18px 24px;
  margin-top: 40px;
}
.site-footer a { color: rgba(255,255,255,0.8); text-decoration: none; }

/* ── Responsive ── */
@media (max-width: 700px) {
  .page { padding: 20px 14px 48px; }
  .sim-head { padding: 14px 16px; flex-wrap: wrap; }
  .block { padding: 4px 16px 16px; }
  .aclaracion, .sim-actions, .sim-datebar { padding-left: 16px; padding-right: 16px; }
  .frow { grid-template-columns: 1fr; gap: 4px; padding: 8px 0; }
  .site-logo { height: 34px; }
}

/* ── Documento de impresión (formato Estetica.docx) ── */
#print-doc, .print-logo { display: none; }

@page { size: A4; margin: 2.5cm; }

@media print {
  body { background: #fff; }
  body > *:not(#print-doc) { display: none !important; }

  #print-doc {
    display: block;
    font-family: Calibri, Carlito, 'Segoe UI', Arial, sans-serif;
    font-size: 10.5pt;
    line-height: 1.15;
    color: #23272F;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Portada */
  .pd-cover { text-align: center; page-break-after: always; }
  .pd-cover img { width: 14cm; max-width: 100%; margin: 60pt 0 40pt; }
  .pd-title {
    font-family: Cambria, Georgia, serif;
    font-weight: 700; font-size: 22pt; color: #1F3864;
    margin: 20pt 0 6pt;
  }
  .pd-rule { border-bottom: 1.5pt solid #2E5496; margin: 0 130pt 18pt; }
  .pd-subtitle {
    font-family: Cambria, Georgia, serif;
    font-size: 15pt; color: #23272F; margin: 0 0 30pt;
  }
  .pd-org  { font-size: 12pt; color: #6B7280; margin: 0 0 3pt; }
  .pd-meta { font-weight: 700; font-size: 11pt; color: #1F3864; margin: 35pt 0 6pt; }

  /* Encabezado corrido */
  .pd-runhead {
    display: flex; align-items: center; justify-content: space-between; gap: 12pt;
    border-bottom: 0.75pt solid #D6DCE6;
    padding-bottom: 4pt; margin-bottom: 6pt;
  }
  .pd-runhead img  { width: 5.28cm; }
  .pd-runhead span { font-size: 8pt; color: #6B7280; text-align: right; }

  /* Títulos de sección */
  .pd-h {
    font-family: Cambria, Georgia, serif;
    font-weight: 700; font-size: 13pt; color: #1F3864;
    border-bottom: 0.75pt solid #D6DCE6;
    padding-bottom: 4pt; margin: 18pt 0 8pt;
    page-break-after: avoid;
  }

  /* Tablas de datos */
  .pd-table {
    width: 100%; border-collapse: collapse;
    border-top: 1pt solid #1F3864;
    border-bottom: 1pt solid #1F3864;
    page-break-inside: avoid;
  }
  .pd-table tr:nth-child(even) { background: #F4F6F9; }
  .pd-table tr + tr th, .pd-table tr + tr td { border-top: 0.5pt solid #D6DCE6; }
  .pd-table th {
    width: 30%; text-align: left; vertical-align: middle;
    font-weight: 700; font-size: 9.5pt; color: #1F3864;
    padding: 5pt 7pt;
  }
  .pd-table td { width: 70%; vertical-align: middle; font-size: 10pt; padding: 5pt 7pt; }

  .pd-p     { text-align: justify; margin: 0 0 7pt; }
  .pd-p b   { font-weight: 700; }
  .pd-empty { font-style: italic; color: #6B7280; }

  /* alto útil de una A4 con márgenes de 2,5 cm: el pie queda abajo */
  .pd-body { display: flex; flex-direction: column; min-height: 24.7cm; }
  .pd-foot {
    border-top: 0.75pt solid #D6DCE6;
    padding-top: 6pt; margin-top: auto;
    text-align: center; font-size: 8pt; color: #6B7280;
  }
}
