/* Flow Test Page Styles - aligned with site palette */
:root {
  --primary-start: #667eea;
  --primary-end: #764ba2;
  --success-start: #28a745;
  --success-end: #20c997;
  --warn-start: #fa709a;
  --warn-end: #fee140;
  --text: #333;
  --text-muted: #666;
  --border: #e1e8ed;
  --bg-soft: #f8f9fa;
}

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

body {
  font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--gris-claro, #f8f9fa) 0%, var(--beige, #f5f0e6) 100%);
  min-height: 100vh;
  display: block;
  overflow-x: hidden; /* Garantiza que no haya orilla blanca */
}

main.container {
  background: white;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  max-width: 720px;
  width: 100%;
  margin: 40px auto;
}

h1 { color: var(--texto-oscuro, #333); margin-bottom: 10px; font-size: 28px; }
.subtitle { color: var(--text-muted); margin-bottom: 30px; font-size: 14px; }

.form-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; color: var(--texto-oscuro, #333); font-weight: 600; font-size: 14px; }
input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
input:focus { outline: none; border-color: var(--dorado, #d4af37); box-shadow: 0 0 0 4px rgba(212,175,55,0.15); }
.help { display: block; color: var(--text-muted); font-size: 12px; margin-top: 6px; }

.btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--primary-start) 0%, var(--primary-end) 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  margin-bottom: 10px;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(102, 126, 234, 0.35); }
.btn:active { transform: translateY(0); }
.btn:disabled { background: #ccc; cursor: not-allowed; transform: none; opacity: 0.8; }
.btn i { margin-right: 8px; }

.btn-search { background: linear-gradient(135deg, var(--success-start) 0%, var(--success-end) 100%); }
.btn-search:hover { box-shadow: 0 10px 20px rgba(40, 167, 69, 0.35); }
.btn-pago-total { background: linear-gradient(135deg, var(--dorado, #d4af37) 0%, var(--dorado-claro, #e8c98c) 100%); color: var(--azul-oscuro, #292f5c); }
.btn-primer-pago { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.btn-completar { background: linear-gradient(135deg, var(--dorado, #d4af37) 0%, var(--dorado-claro, #e8c98c) 100%); color: var(--azul-oscuro, #292f5c); }
.btn-secondary { background: #6c757d; color: #fff; }

.alert { padding: 15px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }
.alert-error { background: #fee; color: #c33; border: 1px solid #fcc; }
.alert-success { background: #efe; color: #3c3; border: 1px solid #cfc; }
.alert-info { background: #e7f3ff; color: #004085; border: 1px solid #b8daff; }
.alert-warning { background: #fff5f5; color: #842029; border: 1px solid #f5c2c7; }

/* Family validation persistent warning - standout red card */
#familyValidationWarning.family-warning {
  display: none; /* JS toggles this */
  background: #fff5f5;
  color: #842029;
  border: 1px solid #f5c2c7;
  border-left: 5px solid #dc3545;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 8px 24px rgba(220,53,69,0.12);
  line-height: 1.4;
}

#familyValidationWarning.family-warning i {
  color: #dc3545;
}

.loading { display: none; text-align: center; margin-top: 20px; }
.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--dorado, #d4af37);
  border-radius: 50%;
  width: 40px; height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

#resultadoBusqueda { display: none; }

.estudiantes-list { background: var(--bg-soft); padding: 15px; border-radius: 8px; margin-bottom: 20px; }
.estudiante-item { padding: 10px; background: white; margin-bottom: 8px; border-radius: 6px; border-left: 4px solid var(--dorado, #d4af37); }
.estudiante-item:last-child { margin-bottom: 0; }

.info-pago { background: #fff3cd; padding: 15px; border-radius: 8px; margin-bottom: 20px; border-left: 4px solid #ffc107; }
.info-pago p { margin: 5px 0; font-size: 14px; }

.opciones-pago { display: flex; flex-direction: column; gap: 10px; }

.estado-completo { background: #d4edda; color: #155724; padding: 20px; border-radius: 8px; text-align: center; border: 2px solid #c3e6cb; }
.estado-completo h3 { margin-bottom: 10px; }

#formBusqueda { display: block; }
#formPago { display: none; }

.info-box { background: var(--bg-soft); padding: 15px; border-radius: 8px; margin-bottom: 20px; border-left: 4px solid var(--dorado, #d4af37); }
.section-title { margin-bottom: 10px; font-weight: 600; color: var(--texto-oscuro, #333333); }
.link-back { display: block; text-align: center; margin-top: 15px; color: var(--azul-oscuro, #292f5c); text-decoration: none; font-weight: 600; }
.link-back:hover { text-decoration: underline; }
.processing-text { margin-top: 10px; color: var(--text-muted); }

/* Tipo de Pago Selector */
.tipo-pago-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
}

.btn-tipo-pago {
  flex: 1;
  padding: 15px;
  background: white;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  color: var(--texto-oscuro, #333);
}

.btn-tipo-pago:hover {
  border-color: var(--dorado, #d4af37);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(212, 175, 55, 0.2);
}

.btn-tipo-pago.active {
  background: linear-gradient(135deg, var(--dorado, #d4af37) 0%, var(--dorado-claro, #e8c98c) 100%);
  color: var(--azul-oscuro, #292f5c);
  border-color: var(--dorado, #d4af37);
}

.btn-tipo-pago i {
  margin-right: 8px;
}

/* Estilos para Pago Familiar */
.info-apoderados-familiar {
  background: #e7f3ff;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid #667eea;
}

.info-apoderados-familiar h3 {
  margin-bottom: 10px;
  color: var(--texto-oscuro, #333);
}

.apoderado-item {
  padding: 8px;
  background: white;
  margin-bottom: 8px;
  border-radius: 6px;
  font-size: 14px;
}

.apoderado-item:last-child {
  margin-bottom: 0;
}

.estudiante-card {
  display: flex;
  align-items: center;
  padding: 12px;
  background: white;
  margin-bottom: 10px;
  border-radius: 8px;
  border-left: 4px solid var(--dorado, #d4af37);
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.estudiante-icon {
  font-size: 24px;
  margin-right: 12px;
}

.estudiante-info {
  flex: 1;
}

.estudiante-nombre {
  font-weight: 600;
  color: var(--texto-oscuro, #333);
  margin-bottom: 4px;
}

.estudiante-detalles {
  font-size: 12px;
  color: var(--text-muted);
}

.opciones-pago-familiar {
  background: var(--bg-soft);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.opciones-pago-familiar h3 {
  color: var(--texto-oscuro, #333);
  margin-bottom: 10px;
}

.info-pago-familiar {
  background: #fff3cd;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 15px;
  font-size: 14px;
  color: #856404;
}

.opciones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.opcion-pago-card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  border: 2px solid var(--border);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.opcion-pago-card:hover {
  border-color: var(--dorado, #d4af37);
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(212, 175, 55, 0.2);
}

.opcion-icon {
  font-size: 32px;
  margin-bottom: 10px;
}

.opcion-pago-card h4 {
  color: var(--texto-oscuro, #333);
  margin-bottom: 10px;
}

.opcion-monto {
  font-size: 24px;
  font-weight: 700;
  color: var(--dorado, #d4af37);
  margin-bottom: 8px;
}

.opcion-detalle {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 15px;
}

.opcion-pago-card .btn {
  margin: 0;
  width: 100%;
}

/* Estado de pago familiar */
.estado-pago-familiar {
  margin-top: 15px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
}

.estado-pago-familiar p {
  margin: 5px 0;
  font-size: 14px;
}

/* Responsive tweaks */
@media (max-width: 640px) {
  main.container { padding: 24px; border-radius: 16px; margin: 16px auto; width: calc(100% - 24px); }
  h1 { font-size: 24px; }
  .btn { font-size: 16px; padding: 14px; }
}
