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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f4f6f9;
  color: #333;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===========================================================
   ANIMATIONS
   =========================================================== */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

@keyframes floatDelay {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes waterFlow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animate-float {
  animation: float 4s ease-in-out infinite;
}

.animate-float-delay {
  animation: floatDelay 5s ease-in-out infinite;
}

.animate-fadeIn {
  animation: fadeIn 0.8s ease-out forwards;
}

.animate-slideUp {
  animation: slideUp 0.6s ease-out forwards;
}

.img-pulse {
  animation: pulse 1.5s ease-in-out infinite;
}

/* ===========================================================
   OVERLAYS / MODALS
   =========================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
}

.modal-box {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 480px;
  width: 90%;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #003366;
  color: #fff;
  padding: 16px 24px;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: #fff;
}

.modal-body {
  padding: 24px;
  color: #4b5563;
  font-size: 16px;
  line-height: 1.6;
}

.modal-footer {
  padding: 0 24px 16px;
  text-align: right;
}

/* ===========================================================
   HELP BUTTONS
   =========================================================== */
#help-buttons {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

#help-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

#help-menu a {
  background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

#help-menu a:hover {
  transform: scale(1.1);
}

#toggle-help {
  background: #003366;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

#toggle-help:hover {
  background: #002244;
  transform: scale(1.05);
}

/* Radio payment method labels */
label:has(input[name="metodo-pago"]:checked) {
  border-color: #003366 !important;
  background: #eff6ff !important;
}

/* ===========================================================
   TOGGLE SWITCH
   =========================================================== */
.toggle-track {
  width: 48px;
  height: 26px;
  background: #d1d5db;
  border-radius: 13px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-track.active {
  background: #003366;
}

.toggle-thumb {
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: left 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.toggle-track.active .toggle-thumb {
  left: 24px;
}

/* ===========================================================
   PAY METHOD GRID (from pagaracueductobogota.st)
   =========================================================== */
.pay-method-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 400px;
}

.pay-method-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  border: 2px solid #e0e4e8;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
}

.pay-method-card:hover {
  border-color: #90b4d4;
}

.pay-method-card.selected {
  border-color: #003366;
  background: #f0f4f8;
}

.pay-method-logo-wrap {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pay-method-logo {
  max-height: 36px;
  max-width: 120px;
}

.pay-method-label {
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
  text-align: center;
}

.breb-method-hint {
  font-size: 14px;
  color: #6b7a8f;
  margin-top: 8px;
  padding: 8px 12px;
  background: #f0fdf4;
  border-radius: 6px;
  border-left: 3px solid #16a34a;
}

/* ===========================================================
   FIELD WRAP (from pagaracueductobogota.st)
   =========================================================== */
.field-wrap {
  position: relative;
}

.field-wrap select,
.field-wrap input {
  width: 100%;
  padding: 14px 16px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 15px;
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.field-wrap select:focus,
.field-wrap input:focus {
  border-color: #003366;
  box-shadow: 0 0 0 3px rgba(0,51,102,0.10);
}

.field-wrap label {
  position: absolute;
  top: -10px;
  left: 12px;
  background: #fff;
  padding: 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: #003366;
  pointer-events: none;
}

.field-wrap .chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #6b7a8f;
}

/* ===========================================================
   BUTTONS (for non-Tailwind pages)
   =========================================================== */
.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===========================================================
   SPINNER (standalone)
   =========================================================== */
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e0e4e8;
  border-top: 4px solid #003366;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.spinner-container {
  display: flex;
  justify-content: center;
  padding: 20px;
}

/* ===========================================================
   ALERTS
   =========================================================== */
.alert {
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
  border: 1px solid transparent;
}

.alert-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.alert-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.alert-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.alert-info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

/* ===========================================================
   BADGES
   =========================================================== */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
}

.badge-completado { background: #f0fdf4; color: #166534; }
.badge-validando { background: #eff6ff; color: #1e40af; }
.badge-pendiente { background: #fffbeb; color: #92400e; }
.badge-rechazado { background: #fef2f2; color: #991b1b; }

/* ===========================================================
   QR IMAGE
   =========================================================== */
.qr-img {
  width: 250px;
  height: 250px;
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  border: 1px solid #e0e4e8;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.qr-wrapper {
  display: flex;
  justify-content: center;
  padding: 24px 0;
}

/* ===========================================================
   TABLES (admin)
   =========================================================== */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th,
.table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f0f2f5; vertical-align: middle; }
.table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: #6b7a8f; font-weight: 600; background: #f8f9fa; }
.table td code { background: #eef2ff; color: #003366; padding: 2px 6px; border-radius: 4px; font-size: 12px; font-family: 'Consolas', monospace; }

/* ===========================================================
   STATS (admin)
   =========================================================== */
.stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 16px; }
.stats-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-card { background: #f8f9fa; border: 1px solid #e0e4e8; border-radius: 8px; padding: 16px; text-align: center; }
.stat-num { font-size: 24px; font-weight: 800; color: #1f2937; }
.stat-label { font-size: 11px; color: #6b7a8f; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }
.stat-total .stat-num { color: #003366; }
.stat-success .stat-num { color: #16a34a; }
.stat-pending .stat-num { color: #d97706; }
.stat-validating .stat-num { color: #2563eb; }
.stat-rejected .stat-num { color: #dc2626; }
.stat-money .stat-num { color: #16a34a; }

/* ===========================================================
   LOGS (admin)
   =========================================================== */
.logs-container { max-height: 400px; overflow-y: auto; }
.logs-container::-webkit-scrollbar { width: 4px; }
.logs-container::-webkit-scrollbar-thumb { background: #e0e4e8; border-radius: 2px; }
.log-entry { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f2f5; font-size: 13px; flex-wrap: wrap; }
.log-time { color: #9ca3af; font-size: 11px; white-space: nowrap; min-width: 140px; }
.log-accion { color: #2563eb; font-weight: 600; text-transform: uppercase; font-size: 11px; min-width: 100px; }
.log-detalle { color: #4b5563; flex: 1; }
.log-ref code { background: #eef2ff; color: #003366; padding: 2px 6px; border-radius: 4px; font-size: 11px; font-family: 'Consolas', monospace; }

/* ===========================================================
   PAGO INFO
   =========================================================== */
.pago-info { margin-bottom: 12px; }
.info-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #f0f2f5; }
.info-row:last-child { border-bottom: none; }
.info-label { color: #6b7a8f; font-size: 14px; }
.info-value { color: #1f2937; font-size: 14px; font-weight: 500; text-align: right; }
.info-value.monto { font-size: 24px; font-weight: 800; color: #16a34a; }
.info-row.highlight { background: #f0fdf4; border-radius: 6px; padding: 12px 8px; margin: 4px 0; border-bottom: none; }
.info-value code { background: #eef2ff; color: #003366; padding: 2px 8px; border-radius: 4px; font-size: 13px; font-family: 'Consolas', monospace; }

/* ===========================================================
   STEPS
   =========================================================== */
.steps-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin: 24px 0; }
.step-item { text-align: center; padding: 16px 8px; background: #f8f9fa; border-radius: 8px; border: 1px solid #e0e4e8; }
.step-num { width: 32px; height: 32px; border-radius: 50%; background: #003366; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; margin: 0 auto 8px; }
.step-item p { font-size: 12px; color: #6b7a8f; line-height: 1.4; margin: 0; }

/* ===========================================================
   RESPONSIVE
   =========================================================== */
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .pay-method-grid { grid-template-columns: 1fr; }
}

.hidden {
  display: none !important;
}
