/* Formulario CSS - formulario.css */

/* Estilos del Formulario de Contacto */
.contact-form {
  background: white;
  padding: 3rem;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.1);
}

.form-group {
  margin-bottom: 2rem;
  position: relative;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
  transition: color 0.3s ease;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 1rem 0;
  background: transparent;
  border: none;
  border-bottom: 2px solid #e2e8f0;
  font-size: 1rem;
  color: #333;
  outline: none;
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-bottom-color: #667eea;
}

.form-group input:focus+.form-line,
.form-group select:focus+.form-line,
.form-group textarea:focus+.form-line {
  transform: scaleX(1);
}

.form-group input:focus~label,
.form-group select:focus~label,
.form-group textarea:focus~label {
  color: #667eea;
}

.form-line {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transform: scaleX(0);
  transition: transform 0.3s ease;
  transform-origin: center;
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
  padding-top: 1rem;
}

.form-group select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.form-group select:focus {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23667eea' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
}

/* Estados de Validación */
.form-group input:valid,
.form-group select:valid,
.form-group textarea:valid {
  border-bottom-color: #10b981;
}

.form-group input:invalid:not(:placeholder-shown),
.form-group select:invalid:not(:placeholder-shown),
.form-group textarea:invalid:not(:placeholder-shown) {
  border-bottom-color: #ef4444;
}

/* Botón de Envío */
.btn-submit {
  width: 100%;
  padding: 1.2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 15px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  margin-top: 1rem;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.btn-submit:hover::before {
  left: 100%;
}

.btn-text {
  display: inline-block;
  transition: opacity 0.3s ease;
}

.btn-loader {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

.btn-submit.loading .btn-text {
  opacity: 0;
}

.btn-submit.loading .btn-loader {
  display: inline-block;
}

/* Mensaje de Feedback */
.form-feedback {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 10px;
  font-weight: 500;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.form-feedback.show {
  opacity: 1;
  transform: translateY(0);
}

.form-feedback.success {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.form-feedback.error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Animaciones */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Animaciones de Entrada del Formulario */
.form-group {
  animation: slideInUp 0.6s ease-out forwards;
  opacity: 0;
}

.form-group:nth-child(1) {
  animation-delay: 0.1s;
}

.form-group:nth-child(2) {
  animation-delay: 0.2s;
}

.form-group:nth-child(3) {
  animation-delay: 0.3s;
}

.form-group:nth-child(4) {
  animation-delay: 0.4s;
}

.form-group:nth-child(5) {
  animation-delay: 0.5s;
}

.btn-submit {
  animation: slideInUp 0.6s ease-out 0.6s forwards;
  opacity: 0;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Estados de Focus para Accesibilidad */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  border-radius: 5px;
}

.btn-submit:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* Placeholder personalizado */
.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #9ca3af;
  opacity: 0.8;
}

.form-group input:focus::placeholder,
.form-group textarea:focus::placeholder {
  opacity: 0.5;
}

/* Efectos de Label Flotante (Opcional) */
.form-group.floating input,
.form-group.floating select,
.form-group.floating textarea {
  padding-top: 1.5rem;
}

.form-group.floating label {
  position: absolute;
  top: 1rem;
  left: 0;
  font-size: 1rem;
  color: #9ca3af;
  pointer-events: none;
  transition: all 0.3s ease;
}

.form-group.floating input:focus~label,
.form-group.floating input:not(:placeholder-shown)~label,
.form-group.floating select:focus~label,
.form-group.floating select:not([value=""])~label,
.form-group.floating textarea:focus~label,
.form-group.floating textarea:not(:placeholder-shown)~label {
  top: -0.5rem;
  font-size: 0.8rem;
  color: #667eea;
  font-weight: 600;
}

/* Estilos para campos con error */
.form-group.error input,
.form-group.error select,
.form-group.error textarea {
  border-bottom-color: #ef4444;
}

.form-group.error label {
  color: #ef4444;
}

.form-group.error .form-line {
  background: #ef4444;
}

/* Estilos para campos válidos */
.form-group.success input,
.form-group.success select,
.form-group.success textarea {
  border-bottom-color: #10b981;
}

.form-group.success label {
  color: #10b981;
}

.form-group.success .form-line {
  background: #10b981;
}

/* Responsive Design para Formulario */
@media (max-width: 768px) {
  .contact-form {
    padding: 2rem 1.5rem;
  }

  .form-group {
    margin-bottom: 1.5rem;
  }

  .btn-submit {
    padding: 1rem;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .contact-form {
    padding: 1.5rem 1rem;
  }

  .form-group label {
    font-size: 0.9rem;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 0.95rem;
  }

  .btn-submit {
    font-size: 0.95rem;
  }
}

/* Efectos adicionales para mejorar UX */
.form-group input:not(:placeholder-shown):valid {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='20,6 9,17 4,12'%3e%3c/polyline%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1rem 1rem;
  padding-right: 2rem;
}

.form-group input:not(:placeholder-shown):invalid {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3ccircle cx='12' cy='12' r='10'%3e%3c/circle%3e%3cline x1='15' y1='9' x2='9' y2='15'%3e%3c/line%3e%3cline x1='9' y1='9' x2='15' y2='15'%3e%3c/line%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1rem 1rem;
  padding-right: 2rem;
}

