/* ============================================================
   ESTILOS GENERALES - CONSULTA DE HABILITACIÓN
   ============================================================ */

/* ---------- Reset & base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  color: #1f2937;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 25px 15px;
  min-height: 100vh;

  /* Ruta corregida: sube a consulta/, luego a image/ */
  background:
    linear-gradient(rgba(15, 23, 42, 0.65), rgba(15, 23, 42, 0.75)),
    url('../image/fondo.png') center/cover no-repeat fixed;
  background-color: #0f172a;
}

/* ---------- Tarjeta principal ---------- */
.card {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 14px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
  padding: 25px 25px 18px;
  max-width: 520px;
  width: 100%;
  animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(15px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Logo ---------- */
.logo-top { text-align: center; margin-bottom: 12px; }
.logo-top img {
  max-height: 70px;
  filter: drop-shadow(0 3px 5px rgba(0,0,0,.1));
}

/* ---------- Títulos ---------- */
h1 {
  font-size: 1.15rem;
  color: #1e3a8a;
  margin-bottom: 4px;
  text-align: center;
  letter-spacing: -0.2px;
}
p.sub {
  color: #6b7280;
  font-size: .82rem;
  margin-bottom: 18px;
  text-align: center;
}

/* ---------- Formulario ---------- */
form { display: flex; gap: 8px; }
input[type=text] {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: .9rem;
  transition: all .2s;
  background: #fff;
}
input[type=text]:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
button {
  padding: 10px 20px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.3);
}
button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.4);
}
button:disabled { opacity: .6; cursor: wait; }

/* ---------- Resultado ---------- */
.resultado { margin-top: 18px; }
.ficha {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px 18px;
  background: #fafbfc;
  animation: fadeInUp 0.35s ease-out;
}
.ficha .nombre {
  font-size: .98rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 10px;
  text-align: center;
  letter-spacing: .2px;
}
.ficha .row {
  display: flex;
  padding: 5px 0;
  border-bottom: 1px dashed #e5e7eb;
  font-size: .82rem;
  line-height: 1.4;
}
.ficha .row:last-child { border-bottom: none; }
.ficha .lbl { width: 130px; color: #6b7280; font-weight: 600; }
.ficha .val { color: #1f2937; }

/* ---------- Badges ---------- */
.badge {
  display: block;
  text-align: center;
  padding: 7px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: .82rem;
  margin-top: 12px;
  letter-spacing: .4px;
}
.ok { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.no { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ---------- Botón imprimir ---------- */
.btn-print {
  display: block;
  margin: 12px auto 0;
  padding: 8px 18px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.3);
}
.btn-print:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.4);
}

/* ---------- Mensajes ---------- */
.error {
  background: #fef3c7;
  color: #92400e;
  border-left: 3px solid #f59e0b;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: .82rem;
}
.spinner {
  color: #6b7280;
  font-size: .82rem;
  text-align: center;
  font-style: italic;
}

/* ---------- Pie de página ---------- */
.footer {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  text-align: center;
  font-size: .72rem;
  color: #6b7280;
  line-height: 1.5;
}
.footer .fecha-hora {
  font-weight: 600;
  color: #374151;
}
.footer .copyright {
  margin-top: 2px;
  color: #9ca3af;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  body { padding: 15px 10px; }
  .card { padding: 20px 18px 15px; }
  form { flex-direction: column; }
  button { width: 100%; }
  h1 { font-size: 1.05rem; }
  .ficha .lbl { width: 110px; font-size: .78rem; }
  .ficha .row { font-size: .78rem; }
}

/* ---------- Impresión ---------- */
@media print {
  body { background: #fff !important; padding: 0; }
  form, h1, p.sub, .logo-top, .btn-print, .footer { display: none !important; }
  .card { box-shadow: none; padding: 0; max-width: 100%; background: #fff; }
  .ficha { border: 1px solid #000; background: #fff; }
}

/* ============================================================
   MÓDULO: VERIFICAR CONSTANCIA
   ============================================================ */

/* Sobrescribimos el body si tiene la clase verificar-page */
body.verificar-page {
  background:
    linear-gradient(rgba(15, 23, 42, 0.75), rgba(15, 23, 42, 0.85)),
    url('../image/fondo.png') center/cover no-repeat fixed;
  background-color: #0f172a;
}

.codigo-box {
  margin-top: 14px;
  padding: 12px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  text-align: center;
}

.codigo-box .lbl-cod {
  font-size: .7rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
  font-weight: 600;
}

.codigo-box .cod {
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: #1e3a8a;
  letter-spacing: 1px;
}

/* El error ya está en tu CSS original, pero añadimos la etiqueta code */
.error code {
  background: #fde68a;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: .8rem;
  font-family: 'Courier New', monospace;
}