/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,400;14..32,500;14..32,600;14..32,700&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(145deg, #f0f4ff 0%, #e6edf7 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
  margin: 0;
}

.card {
  background: #ffffff;
  border-radius: 24px;
  padding: 40px 36px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(30, 58, 138, 0.10), 0 8px 24px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease;
}

h1 {
  font-size: 26px;
  font-weight: 700;
  color: #1e3a8a;
  margin-top: 0;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.subtitle {
  color: #64748b;
  font-size: 14px;
  font-weight: 400;
  margin-top: 0;
  margin-bottom: 28px;
  line-height: 1.5;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  background: #f8fafc;
  transition: border 0.2s, box-shadow 0.2s;
  margin-bottom: 16px;
}

input[type="text"]:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
  background: #ffffff;
}

#captcha-container {
  margin-bottom: 18px;
  display: flex;
  justify-content: center;
  transform: scale(0.92);
  transform-origin: left center;
}

button {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.30);
  letter-spacing: 0.3px;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
}

button:active {
  transform: scale(0.98);
}

.hidden {
  display: none !important;
}

.error {
  background: #fef2f2;
  color: #b91c1c;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  margin-top: 16px;
  border-left: 5px solid #ef4444;
  display: flex;
  align-items: center;
  gap: 10px;
}

.error::before {
  content: "⚠️";
  font-size: 18px;
}

#resultado {
  margin-top: 28px;
  border-top: 1px solid #e2e8f0;
  padding-top: 24px;
}

#nombreCliente {
  font-size: 20px;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 12px 0;
}

/* Lista de boletas como tarjetas */
#listaBoletas {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* --- Cada boleta como tarjeta --- */
.boleta-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: background 0.2s, box-shadow 0.2s;
}

.boleta-card.seleccionada {
  background: #eef2ff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.boleta-card:hover {
  background: #fafcff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

/* --- Checkbox --- */
.boleta-check-wrapper {
  flex-shrink: 0;
  padding-top: 4px; /* alinear verticalmente con el primer renglón */
}

.boleta-check {
  width: 20px;
  height: 20px;
  accent-color: #1e3a8a;
  cursor: pointer;
}

/* --- Contenido de la boleta --- */
.boleta-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px; /* separación entre líneas */
  font-size: 16px;
  color: #1e293b;
}

.boleta-content .label {
  font-weight: 500;
  color: #475569;
  margin-right: 4px;
}

.boleta-content strong {
  color: #0f172a;
}

.boleta-id,
.boleta-monto,
.boleta-fecha {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap; /* para que en móvil no se desborde */
}

.boleta-monto .valor {
  font-weight: 700;
  color: #1e3a8a;
  font-size: 16px;
}

.boleta-fecha {
  font-size: 16px;
  color: #64748b;
}

/* --- Ajustes para móviles --- */
@media (max-width: 480px) {
  .boleta-card {
    padding: 12px 14px;
    gap: 12px;
  }
  .boleta-content {
    font-size: 16px;
  }
  .boleta-monto .valor {
    font-size: 16px;
  }
  .boleta-check {
    width: 18px;
    height: 18px;
  }
}

.total {
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
  background: #f1f5f9;
  padding: 12px 16px;
  border-radius: 12px;
  text-align: center;
  margin: 12px 0 18px 0;
}

.total strong {
  color: #1e3a8a;
  font-weight: 700;
}

#btn-pagar {
  background: linear-gradient(135deg, #0b3b2c 0%, #0f6b4a 100%);
  box-shadow: 0 4px 12px rgba(15, 107, 74, 0.30);
}

#btn-pagar:hover {
  background: linear-gradient(135deg, #0b3b2c 0%, #0d5d3e 100%);
  box-shadow: 0 8px 24px rgba(15, 107, 74, 0.35);
}

/* --- Estilos para resultado.html --- */
#contenido {
  text-align: center;
}

#contenido h1 {
  font-size: 28px;
  margin-bottom: 8px;
}

#contenido h1.ok { color: #0d7c3f; }
#contenido h1.fail { color: #b91c1c; }

#contenido p {
  font-size: 16px;
  color: #334155;
  margin: 6px 0;
}

#contenido a {
  display: inline-block;
  margin-top: 20px;
  padding: 10px 24px;
  background: #1e3a8a;
  color: white;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s;
}

#contenido a:hover {
  background: #2563eb;
}

@media (max-width: 500px) {
  .card {
    padding: 24px 18px;
  }
  h1 {
    font-size: 22px;
  }
  #captcha-container {
    transform: scale(0.8);
    transform-origin: left center;
  }
}

/* ... (todo lo anterior se mantiene) ... */

/* Estilos específicos para el voucher */
#voucher {
  margin: 16px 0;
}

#voucher div {
  font-family: 'Courier New', monospace;
  background: #f9fafb;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

#voucher h2 {
  margin: 0 0 6px 0;
  font-size: 20px;
  letter-spacing: 2px;
  color: #1e3a8a;
}

#voucher p {
  margin: 4px 0;
}

#btn-descargar {
  width: 100%;
  padding: 14px 20px;
  background: #0b3b2c;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(11, 59, 44, 0.3);
  letter-spacing: 0.3px;
}

#btn-descargar:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(11, 59, 44, 0.35);
  background: #0d5d3e;
}

#btn-descargar:active {
  transform: scale(0.98);
}

/* Mejora en el separador del voucher */
#contenido hr {
  margin: 20px 0;
  border: none;
  border-top: 2px dashed #d1d5db;
}