@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&family=Poppins:wght@400;700&display=swap');

*, *::before, *::after { box-sizing: border-box; }

/* ── Container Bootstrap-like ── */
.bs-container {
  width: 100%;
  padding-right: 0.75rem;
  padding-left: 0.75rem;
  margin-right: auto;
  margin-left: auto;
}
@media (min-width: 576px)  { .bs-container { max-width: 540px; } }
@media (min-width: 768px)  { .bs-container { max-width: 720px; } }
@media (min-width: 992px)  { .bs-container { max-width: 960px; } }
@media (min-width: 1200px) { .bs-container { max-width: 1140px; } }
@media (min-width: 1400px) { .bs-container { max-width: 1320px; } }


body {
  margin: 0;
  font-family: sans-serif;
  color: #333333;
  background: #fff;
}

.font-poppins { font-family: 'Poppins', sans-serif; }
.font-montserrat { font-family: 'Montserrat', sans-serif; }

/* ── Overlay oscuro de fondo ── */
#bg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 9999;
  display: none;
}

/* ── Spinner de carga de factura ── */
#spinner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
}
#spinner-overlay.visible { display: flex; }

@keyframes pulse-opacity {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
.img-pulse { animation: pulse-opacity 1.2s infinite; }

/* ── Overlay de procesando pago ── */
#payment-processing {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-size: 1.5em;
  font-family: sans-serif;
}
#payment-processing.visible { display: flex; }

/* ── Modales ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.hidden { display: none; }

.modal-box {
  background: #fff;
  border-radius: 0.5rem;
  width: 90%;
  max-width: 28rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e5e7eb;
  padding: 1rem 1.5rem;
}
.modal-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6b7280;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: #000; }

.modal-body {
  padding: 1rem 1.5rem;
  color: #1f2937;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid #e5e7eb;
  padding: 1rem 1.5rem;
}

/* ── Toggle switch ── */
.toggle-track {
  width: 2.5rem;
  height: 1.25rem;
  border-radius: 9999px;
  border: 1px solid #d1d5db;
  background: #fff;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.toggle-track.on {
  background: #006eff;
  border-color: #006eff;
}
.toggle-thumb {
  width: 1rem;
  height: 1rem;
  border-radius: 9999px;
  background: #9ca3af;
  position: absolute;
  top: 0.125rem;
  left: 0.125rem;
  transition: transform 0.2s, background 0.2s;
}
.toggle-track.on .toggle-thumb {
  background: #fff;
  transform: translateX(1.375rem);
}

/* ── Captcha checkbox ── */
#captcha-check {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  appearance: none;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}
#captcha-check:checked { background: #d1d5db; border-color: #d1d5db; }

#captcha-checkmark {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  pointer-events: none;
  color: #16a34a;
  display: none;
}
#captcha-check:checked ~ #captcha-checkmark { display: block; }

/* ── Campos flotantes ── */
.field-wrap {
  position: relative;
}
.field-wrap input,
.field-wrap select {
  width: 100%;
  font-size: 0.9375rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  padding: 2rem 1rem 0.5rem;
  outline: none;
  appearance: none;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field-wrap input:focus,
.field-wrap select:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96,165,250,0.35);
}
.field-wrap label {
  position: absolute;
  left: 1rem;
  top: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
  pointer-events: none;
}
.field-wrap .chevron {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #6b7280;
}
.field-wrap.error input,
.field-wrap.error select { border-color: #ef4444; }
.field-wrap .err-icon {
  position: absolute;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  color: #dc2626;
  font-size: 0.75rem;
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid #dc2626;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

/* ── Tabla de facturas ── */
#bills-table tbody {
  font-weight: 500;
}
#bills-table tbody td {
  max-width: 90px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}
#bills-table tbody td:nth-child(3) {
  min-width: 105px;
}
#bills-table tbody td:nth-child(12) {
  min-width: 100px;
}

#bills-table tbody tr:last-child td {
  border-bottom: 1px solid #d1d5db !important;
  padding-bottom: calc(0.75rem + 10px) !important;
}
