@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(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 1.25rem;
  font-family: 'Montserrat', sans-serif;
}
#payment-processing.visible { display: flex; }

#payment-processing .pay-processing-card {
  background: #fff;
  border-radius: 1rem;
  padding: 2rem 1.75rem 1.75rem;
  max-width: 22rem;
  width: 100%;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(19, 97, 197, 0.12);
}

#payment-processing .pay-processing-icon {
  display: block;
  margin: 0 auto 1.25rem;
  width: 5.5rem;
  height: 5.5rem;
  object-fit: contain;
}

#payment-processing .pay-processing-title {
  margin: 0 0 0.75rem;
  color: #111827;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.35;
}

#payment-processing .pay-processing-dots {
  display: inline;
  color: #1361c5;
  font-weight: 700;
  letter-spacing: 0.02em;
}

#payment-processing .pay-processing-sub {
  margin: 0;
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.45;
}

/* ── 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;
}
/* ── Selector de medio de pago (PSE / Bre-B) ── */
#pay-method-picker.pay-method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-width: 36rem;
}

#pay-method-picker.pay-method-grid--single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 18rem;
}

#pay-method-picker .pay-method-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.75rem;
  min-height: 9.5rem;
  padding: 1rem;
  border: 2px solid #d1d5db;
  border-radius: 0.75rem;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  font-family: 'Montserrat', sans-serif;
  text-align: center;
}

#pay-method-picker .pay-method-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 14px rgba(19, 97, 197, 0.12);
}

#pay-method-picker .pay-method-card.selected {
  border-color: #1361c5;
  background: #f0f7ff;
  box-shadow: 0 0 0 3px rgba(19, 97, 197, 0.15);
}

#pay-method-picker .pay-method-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 4.75rem;
  overflow: hidden;
  flex-shrink: 0;
}

#pay-method-picker .pay-method-logo {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

#pay-method-picker .pay-method-logo--pse {
  max-height: 3.25rem;
}

#pay-method-picker .pay-method-logo--breb {
  max-height: 4.25rem;
}

#pay-method-picker .pay-method-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #374151;
  line-height: 1.3;
}

.pay-continue-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.selected-method-preview {
  width: 100%;
  max-width: 16rem;
  height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.selected-method-logo {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.selected-method-logo--pse {
  max-height: 3.5rem;
}

.selected-method-logo--breb {
  max-height: 4rem;
}

.btn-continue-pay {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14rem;
  padding: 0.875rem 2rem;
  border: none;
  border-radius: 0.75rem;
  background: #1361c5;
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.0625rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn-continue-pay:hover {
  background: #0d4ea1;
}

.btn-continue-pay:active {
  transform: scale(0.98);
}

#pse-bank-section.hidden {
  display: none;
}

.breb-method-hint {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: #e8f2fc;
  border: 1px solid rgba(19, 97, 197, 0.2);
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: #1e40af;
  max-width: 36rem;
}

.breb-method-hint.hidden {
  display: none;
}

@media (max-width: 520px) {
  #pay-method-picker.pay-method-grid {
    grid-template-columns: 1fr;
  }
}

.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;
}

/* ── Páginas informativas SEO ── */
.seo-wrap { max-width: 760px; margin: 0 auto; padding: 1.25rem 1rem 3rem; line-height: 1.65; color: #1f2937; }
.seo-wrap h1 { font-family: 'Poppins', sans-serif; font-size: 1.75rem; margin: 0 0 1rem; color: #1361c5; }
.seo-wrap h2 { font-family: 'Poppins', sans-serif; font-size: 1.2rem; margin: 2rem 0 0.75rem; color: #1e40af; }
.seo-wrap p { margin: 0 0 1rem; }
.seo-wrap ul { margin: 0 0 1rem; padding-left: 1.25rem; }
.seo-wrap .lead { font-size: 1.05rem; color: #374151; }
.seo-wrap .cta { display: inline-block; margin-top: 1rem; padding: 0.75rem 1.25rem; background: #1361c5; color: #fff; text-decoration: none; border-radius: 8px; font-weight: 600; }
.seo-wrap .cta:hover { background: #0d4ea1; }
