/* Visor de folletos Cédula A · DTS Consultores */
:root {
  --navy: #0f2747;
  --navy-2: #1d3a63;
  --gold: #c9a14a;
  --gold-soft: #f6efdd;
  --ink: #1f2933;
  --muted: #5b6b7f;
  --line: #d9dfe7;
  --paper: #ffffff;
  --fondo: #e9edf2;
  --red: #b42318;
  --red-soft: #fdecea;
  --acc: #1d4e89;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--fondo);
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
button, input { font: inherit; }

/* ---------- Entrada ---------- */
.entrada {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center; padding: 24px 16px;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
}
.tarjeta {
  width: 100%; max-width: 420px; background: var(--paper); border-radius: 14px;
  padding: 32px 28px 26px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
  border-top: 4px solid var(--gold);
}
.tarjeta img { height: 54px; display: block; margin: 0 auto 18px; }
.tarjeta h1 { font-size: 1.3rem; margin: 0 0 4px; text-align: center; color: var(--navy); }
.tarjeta .sub { margin: 0 0 24px; text-align: center; color: var(--muted); font-size: .92rem; }
.tarjeta label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; color: var(--navy); }
.tarjeta input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 8px;
  font-size: 1.15rem; letter-spacing: .12em; text-transform: uppercase; text-align: center;
  -webkit-user-select: text; user-select: text;
}
.tarjeta input:focus { outline: none; border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(29, 58, 99, .15); }
.boton {
  width: 100%; margin-top: 14px; padding: 12px; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--navy); color: #fff; font-weight: 600; font-size: 1rem;
}
.boton:hover { background: var(--navy-2); }
.boton:disabled { opacity: .6; cursor: default; }
.error {
  display: none; margin-top: 14px; padding: 10px 12px; border-radius: 8px;
  background: var(--red-soft); color: var(--red); font-size: .9rem;
}
.error.visible { display: block; }
.aviso { margin: 22px 0 0; font-size: .78rem; color: var(--muted); text-align: center; line-height: 1.5; }

/* ---------- Visor ---------- */
.barra {
  position: sticky; top: 0; z-index: 10;
  background: var(--navy); color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
}
.barra-sup {
  display: flex; align-items: center; gap: 14px; padding: 10px 16px;
  max-width: 1100px; margin: 0 auto;
}
.barra-sup img { height: 30px; flex: none; }
.barra-sup .quien { flex: 1; min-width: 0; font-size: .82rem; line-height: 1.35; text-align: right; }
.quien b { display: block; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quien span { color: #c9d3e0; }
.salir {
  flex: none; background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 6px; padding: 6px 12px; cursor: pointer; font-size: .82rem;
}
.salir:hover { background: rgba(255, 255, 255, .1); }

.pestanas {
  display: flex; gap: 4px; padding: 0 16px; max-width: 1100px; margin: 0 auto;
  overflow-x: auto; scrollbar-width: none;
}
.pestanas::-webkit-scrollbar { display: none; }
.pestana {
  flex: none; background: transparent; border: 0; color: #c9d3e0; cursor: pointer;
  padding: 10px 14px 11px; font-size: .86rem; font-weight: 600; border-bottom: 3px solid transparent;
}
.pestana:hover { color: #fff; }
.pestana[aria-selected="true"] { color: #fff; border-bottom-color: var(--gold); }
.pestana small { display: block; font-weight: 400; font-size: .74rem; opacity: .85; }
.pestanas.sub { max-width: none; background: var(--navy-2); padding: 0 max(16px, calc((100% - 1100px) / 2 + 16px)); }
.pestanas.sub .pestana { padding: 8px 14px 9px; }
.pestanas.sub .pestana span { font-weight: 700; }
.pestana[hidden], .pestanas[hidden] { display: none; }
.hojas.horizontal { max-width: 1240px; }
.hojas.simulador { max-width: 1100px; padding-bottom: 16px; }
.sim { position: relative; height: calc(100vh - var(--margen, 160px) - 24px); min-height: 480px; background: var(--paper); border-radius: 4px; box-shadow: 0 2px 8px rgba(15, 39, 71, .12); overflow: hidden; }
.sim iframe { display: block; width: 100%; height: 100%; border: 0; }
.sim-marca { position: absolute; inset: 0; pointer-events: none; }
.controles[hidden] { display: none; }

.controles {
  background: var(--paper); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 16px;
  font-size: .86rem; color: var(--muted);
}
.controles button {
  background: var(--paper); border: 1px solid var(--line); border-radius: 6px; cursor: pointer;
  width: 34px; height: 30px; color: var(--navy); font-size: 1rem; line-height: 1;
}
.controles button:hover { border-color: var(--navy-2); }
.controles input {
  width: 52px; text-align: center; padding: 4px; border: 1px solid var(--line); border-radius: 6px;
  -webkit-user-select: text; user-select: text;
}

.hojas { max-width: 900px; margin: 0 auto; padding: 18px 16px 60px; }
.hoja {
  position: relative; width: 100%; aspect-ratio: 1275 / 1650; margin: 0 auto 18px;
  background: var(--paper); box-shadow: 0 2px 8px rgba(15, 39, 71, .12); border-radius: 2px;
  overflow: hidden;
}
.hoja canvas { display: block; width: 100%; height: 100%; pointer-events: none; }
.hoja .cargando {
  position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: .85rem;
}
.hoja.lista .cargando { display: none; }

.estado { text-align: center; padding: 60px 16px; color: var(--muted); }

/* Ocultar el contenido si se intenta imprimir */
@media print {
  body * { display: none !important; }
  body::after {
    content: "Este material no se puede imprimir. © Lic. Carlos Soltero y/o DTS Consultores";
    display: block; padding: 40px; font: 14pt sans-serif;
  }
}

@media (max-width: 560px) {
  .barra-sup .quien span { display: none; }
  .hojas { padding: 12px 8px 40px; }
  .hoja { margin-bottom: 10px; }
}
