/* ESTILOS BÁSICOS DE FORMULARIO */
.field-required {
  color: #dc3545;
  font-weight: bold;
  margin-left: 4px;
}

label.required {
  font-weight: 600;
}

/* Secciones del formulario */
h2 {
  font-size: 1.4rem;
  color: #2C3E50;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e9ecef;
}

.form-group {
  margin-bottom: 1.2rem;
}

.card-block {
  padding: 1.5rem;
  background-color: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

/* VALIDACIÓN DE CAMPOS */
.form-control {
  transition: all 0.3s ease;
  border: 1px solid #ced4da;
  padding: .5rem .75rem;
  border-radius: 3px;
}

.form-control:focus {
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.form-control.is-valid {
  border-left: 4px solid #28a745;
  background-color: #f8fff9;
}

.form-control.is-invalid {
  border-left: 4px solid #dc3545;
  background-color: #fff8f8;
}

.form-error-message {
  display: none;
  color: #dc3545;
  font-size: 12px;
  margin-top: 5px;
  margin-left: 2px;
}

.is-invalid + .form-error-message {
  display: block;
}

.form-text.text-muted {
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

/* CHECKBOX PERSONALIZADO */
.custom-control {
  padding-left: 2rem;
  min-height: 1.5rem;
}

.custom-control-input {
  position: absolute;
  z-index: -1;
  opacity: 0;
}

.custom-control-label {
  position: relative;
  margin-bottom: 0;
  cursor: pointer;
}

.custom-control-label::before {
  position: absolute;
  left: -1.75rem;
  top: 0.2rem;
  display: block;
  width: 1rem;
  height: 1rem;
  border: 1px solid #adb5bd;
  background-color: #fff;
  content: "";
  border-radius: 0.25rem;
}

.custom-control-input:checked ~ .custom-control-label::before {
  border-color: #28a745;
  background-color: #28a745;
}

.custom-control-input:focus ~ .custom-control-label::before {
  box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.custom-control-label::after {
  position: absolute;
  left: -1.75rem;
  top: 0.2rem;
  display: block;
  width: 1rem;
  height: 1rem;
  content: "";
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50% 50%;
}

.custom-control-input:checked ~ .custom-control-label::after {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/%3e%3c/svg%3e");
}

/* BOTONES */
.btn {
  padding: .5rem 1rem;
  border-radius: 3px;
  transition: all 0.2s ease-in-out;
}

.btn-primary {
  background-color: #2C7BE5;
  border-color: #2C7BE5;
}

.btn-primary:hover {
  background-color: #1a68d1;
  border-color: #1a68d1;
}

.btn-outline-primary {
  color: #2C7BE5;
  border-color: #2C7BE5;
}

.btn-outline-primary:hover {
  background-color: #2C7BE5;
  border-color: #2C7BE5;
}

button.disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

/* ESTADO DE CARGA */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.form-group.loading::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  border: 3px solid rgba(0,0,0,0.1);
  border-radius: 50%;
  border-top-color: #2C7BE5;
  animation: spin 1s linear infinite;
}

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

/* NOTIFICACIONES Y OVERLAY */
.form-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(255,255,255,0.9);
  z-index: 9999;
  font-size: 18px;
  color: #333;
  backdrop-filter: blur(2px);
}

.spinner {
  width: 60px;
  height: 60px;
  border: 6px solid rgba(44,123,229,0.1);
  border-radius: 50%;
  border-top-color: #2C7BE5;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 25px;
  border-radius: 4px;
  color: white;
  font-weight: bold;
  z-index: 10000;
  transform: translateX(120%);
  transition: transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.notification.visible {
  transform: translateX(0);
}

.notification-success { background-color: #28a745; }
.notification-error { background-color: #dc3545; }

/* MENSAJES DE ERROR */
.registration-errors {
  margin-bottom: 20px;
  border-radius: 4px;
}

.registration-errors ul {
  padding-left: 20px;
  margin-bottom: 0;
}

.registration-errors li {
  margin-bottom: 6px;
}

/* ÉXITO DE REGISTRO */
.registration-success {
  text-align: center;
  padding: 40px 15px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.registration-success .material-icons {
  font-size: 72px;
  margin-bottom: 20px;
  color: #28a745;
}

.registration-success h3 {
  margin-bottom: 20px;
  color: #2C3E50;
}

/* Estilos responsivos */
@media (max-width: 767px) {
  .form-control-label {
    margin-bottom: 0.5rem;
  }
}
