/* Estilos específicos para la página de selección de país */

.country-card {
  max-width: 600px;
  margin: 2rem auto;
}

.form-header {
  text-align: center;
  margin-bottom: 2.5rem;
  display: block !important;
  flex-direction: column !important;
}

.form-header h2 {
  font-size: 2rem;
  color: #1a202c;
  margin-bottom: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  display: block !important;
  width: 100%;
}

.form-header .subtitle {
  color: #718096;
  font-size: 1rem;
  margin: 0;
  display: block !important;
  line-height: 1.5;
  width: 100%;
  margin-top: 0.5rem;
}

/* Contenedor de países */
.countries-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Opción de país */
.country-option {
  cursor: pointer;
  display: block;
}

.country-option input[type="radio"] {
  display: none;
}

.country-card-item {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  transition: all 0.3s ease;
  position: relative;
}

/* Colores por país - PERÚ (Morado) */
#country-peru:not(:checked) + .country-card-item {
  border-left: 4px solid #9333ea;
}

#country-peru + .country-card-item:hover {
  border-color: #9333ea;
  background: linear-gradient(135deg, #faf5ff 0%, #ffffff 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(147, 51, 234, 0.15);
}

#country-peru:checked + .country-card-item {
  border-color: #9333ea;
  background: linear-gradient(135deg, #faf5ff 0%, #ffffff 100%);
  box-shadow: 0 4px 16px rgba(147, 51, 234, 0.25);
}

#country-peru:checked + .country-card-item .country-name {
  color: #7e22ce;
  font-weight: 600;
}

/* Colores por país - MÉXICO (Verde) */
#country-mexico:not(:checked) + .country-card-item {
  border-left: 4px solid #16a34a;
}

#country-mexico + .country-card-item:hover {
  border-color: #16a34a;
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.15);
}

#country-mexico:checked + .country-card-item {
  border-color: #16a34a;
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
  box-shadow: 0 4px 16px rgba(22, 163, 74, 0.25);
}

#country-mexico:checked + .country-card-item .country-name {
  color: #15803d;
  font-weight: 600;
}

/* Colores por país - COLOMBIA (Amarillo) */
#country-colombia:not(:checked) + .country-card-item {
  border-left: 4px solid #eab308;
}

#country-colombia + .country-card-item:hover {
  border-color: #eab308;
  background: linear-gradient(135deg, #fefce8 0%, #ffffff 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.15);
}

#country-colombia:checked + .country-card-item {
  border-color: #eab308;
  background: linear-gradient(135deg, #fefce8 0%, #ffffff 100%);
  box-shadow: 0 4px 16px rgba(234, 179, 8, 0.25);
}

#country-colombia:checked + .country-card-item .country-name {
  color: #ca8a04;
  font-weight: 600;
}

/* Imagen de bandera - CORREGIDO */
.country-flag-img {
  width: 60px;
  height: 60px;
  max-width: 60px;
  max-height: 60px;
  object-fit: contain;
  border-radius: 8px;
  padding: 4px;
  background: #f8f9fa;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.country-card-item:hover .country-flag-img {
  transform: scale(1.05);
}

.country-name {
  flex: 1;
  font-size: 1.25rem;
  font-weight: 500;
  color: #2d3748;
  transition: color 0.3s ease;
}

.checkmark {
  font-size: 1.5rem;
  color: #48bb78;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Estado seleccionado - Checkmark visible */
.country-option input[type="radio"]:checked + .country-card-item .checkmark {
  opacity: 1;
}

.country-option input[type="radio"]:checked + .country-card-item .country-flag-img {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transform: scale(1.1);
}

/* Mensaje de error */
.error-message {
  background: #fff5f5;
  border: 1px solid #fc8181;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #c53030;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.error-message::before {
  content: "⚠️";
  font-size: 1.2rem;
}

/* Botón de acción */
.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 2rem;
}

.btn-primary {
  background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
  color: white;
  border: none;
  padding: 0.875rem 2.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(66, 153, 225, 0.4);
  background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  background: #cbd5e0;
  cursor: not-allowed;
  box-shadow: none;
}

/* Responsive */
@media (max-width: 768px) {
  .country-card {
    margin: 1rem;
  }

  .form-header h2 {
    font-size: 1.5rem;
  }

  .form-header .subtitle {
    font-size: 0.95rem;
  }

  .country-card-item {
    padding: 1.25rem;
    gap: 1rem;
  }

  .country-flag-img {
    width: 50px;
    height: 50px;
    max-width: 50px;
    max-height: 50px;
  }

  .country-name {
    font-size: 1.1rem;
  }

  .btn-primary {
    width: 100%;
    padding: 1rem;
  }
}