/* IAV Quantico — visor de un solo uso
   Marca: azul marino #1E456C · azul profundo #0B1B2E · rojo #C42A36 */

:root {
  --navy: #1E456C;
  --deep: #0B1B2E;
  --deep-2: #102439;
  --red: #C42A36;
  --line: rgba(255, 255, 255, .14);
  --text: #E8EDF3;
  --muted: #9DAEC1;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--deep);
  color: var(--text);
  font-family: Arial, Helvetica, "Liberation Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Nada de esta aplicacion esta pensado para imprimirse. */
@media print {
  html, body { display: none !important; }
}

/* ───────────────────────── Pantalla de acceso ───────────────────────── */

.gate {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background:
    radial-gradient(1100px 620px at 50% -10%, rgba(30, 69, 108, .55), transparent 70%),
    var(--deep);
}

.card {
  width: 100%;
  max-width: 470px;
  background: var(--deep-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 40px 36px 34px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}

.brand { text-align: center; margin-bottom: 30px; }
.brand img { width: 168px; height: auto; display: block; margin: 0 auto 20px; }

.brand h1 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .055em;
  text-transform: uppercase;
  margin: 0 0 6px;
  line-height: 1.45;
}

.brand p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: .035em;
}

.notice {
  background: rgba(196, 42, 54, .09);
  border: 1px solid rgba(196, 42, 54, .42);
  border-left: 3px solid var(--red);
  border-radius: 5px;
  padding: 16px 17px;
  margin-bottom: 26px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #F0DDDF;
}

.notice strong { color: #fff; }

.notice-title {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 9px;
}

label.field-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 9px;
}

input[type="text"] {
  width: 100%;
  padding: 15px 16px;
  font-size: 25px;
  font-family: "Courier New", "Liberation Mono", monospace;
  font-weight: 700;
  letter-spacing: .34em;
  text-align: center;
  color: #fff;
  background: rgba(0, 0, 0, .34);
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

input[type="text"]:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(30, 69, 108, .38);
}

input[type="text"]::placeholder {
  color: rgba(157, 174, 193, .4);
  letter-spacing: .3em;
}

button.primary {
  width: 100%;
  margin-top: 20px;
  padding: 15px 18px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .045em;
  color: #fff;
  background: var(--navy);
  border: 1px solid #2A5B8C;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1.45;
  transition: background .15s, opacity .15s;
}

button.primary:hover:not(:disabled) { background: #24547f; }
button.primary:disabled { opacity: .5; cursor: not-allowed; }

.hint {
  margin-top: 15px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
}

.error {
  margin-top: 17px;
  padding: 12px 14px;
  background: rgba(196, 42, 54, .14);
  border: 1px solid rgba(196, 42, 54, .5);
  border-radius: 5px;
  font-size: 13px;
  line-height: 1.55;
  color: #F5D8DB;
  display: none;
}

.error.show { display: block; }

.foot {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  line-height: 1.6;
  letter-spacing: .045em;
  color: rgba(157, 174, 193, .68);
  text-align: center;
  text-transform: uppercase;
}

/* ───────────────────────────── Visor ───────────────────────────── */

.viewer {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--deep);
  /* El visor no se selecciona ni se arrastra. */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 16px;
  background: rgba(0, 0, 0, .3);
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  letter-spacing: .075em;
  color: var(--muted);
}

.topbar .conf {
  text-transform: uppercase;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .13em;
  color: rgba(196, 42, 54, .95);
  white-space: nowrap;
}

.topbar .counter {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.topbar .clock {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.topbar .clock.warn { color: #FFC9CE; }

.stage {
  flex: 1 1 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  min-height: 0;
}

canvas#slide {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  border-radius: 3px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .55);
  background: #fff;
  pointer-events: none;
}

.nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 27, 46, .74);
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
  font-size: 21px;
  cursor: pointer;
  opacity: .62;
  transition: opacity .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
}

.nav:hover:not(:disabled) { opacity: 1; background: rgba(30, 69, 108, .9); }
.nav:disabled { opacity: .16; cursor: default; }
.nav.prev { left: 12px; }
.nav.next { right: 12px; }

.loading {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.loading.show { display: flex; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(14px);
  padding: 12px 22px;
  background: var(--red);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .045em;
  border-radius: 5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 20;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ──────────────────────── Pantalla de cierre ──────────────────────── */

.closed {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: var(--deep);
  z-index: 50;
}

.closed.show { display: flex; }

.closed-inner {
  max-width: 440px;
  text-align: center;
}

.closed-inner img { width: 150px; height: auto; margin-bottom: 28px; opacity: .9; }

.closed-inner h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .045em;
  margin: 0 0 14px;
}

.closed-inner p {
  font-size: 13.5px;
  line-height: 1.72;
  color: var(--muted);
  margin: 0 0 10px;
}

.closed-inner .sig {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  letter-spacing: .095em;
  text-transform: uppercase;
  color: rgba(157, 174, 193, .62);
}

/* Aviso de rotacion: en vertical una lamina 16:9 queda ilegible en un telefono. */
.rotate {
  display: none;
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 22px;
  padding: 13px 16px;
  background: rgba(30, 69, 108, .92);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.55;
  text-align: center;
  color: var(--text);
}

.rotate em {
  display: block;
  margin-top: 4px;
  font-style: normal;
  font-size: 11px;
  color: rgba(232, 237, 243, .72);
}

.rotate-icon {
  display: block;
  font-size: 20px;
  margin-bottom: 5px;
  opacity: .85;
}

@media (orientation: portrait) and (max-width: 860px) {
  .rotate { display: block; }
  .stage { padding: 6px; }
}

@media (max-width: 600px) {
  .card { padding: 30px 22px 26px; }
  .brand img { width: 140px; }
  input[type="text"] { font-size: 21px; letter-spacing: .26em; }
  .nav { width: 38px; height: 62px; font-size: 18px; }
  .nav.prev { left: 6px; }
  .nav.next { right: 6px; }
  .topbar { font-size: 10.5px; padding: 8px 11px; gap: 9px; }
  .topbar .conf { display: none; }
  .stage { padding: 8px; }
}
