/* Añadidos estilos para mensajes de estado de formularios */

/* Estados de formularios */
.connect-form__status {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.connect-form__status--success {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.connect-form__status--error {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* Estados de botones de carga */
.button {
  position: relative;
  transition: all 0.2s ease;
}

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

.button__loader {
  display: none;
}

.button__loader:not([hidden]) {
  display: inline-block;
}

.button__loader::after {
  content: "";
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-left: 0.5rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Validación de campos */
.form-field__control input:invalid:not(:placeholder-shown),
.form-field__control textarea:invalid:not(:placeholder-shown) {
  border-color: #ef4444;
}

.form-field__control input:valid:not(:placeholder-shown),
.form-field__control textarea:valid:not(:placeholder-shown) {
  border-color: #22c55e;
}

/* Mensajes de validación HTML5 */
.form-field__control input:invalid:focus,
.form-field__control textarea:invalid:focus {
  outline: 2px solid #ef4444;
  outline-offset: 2px;
}

/* Accesibilidad mejorada */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Nuevos estilos para popup notification animado */

/* Popup Notification Container */
.popup-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: none;
  max-width: 420px;
  width: calc(100% - 40px);
}

.popup-notification--visible {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* Popup Content */
.popup-notification__content {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(10px);
  animation: popupSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes popupSlideIn {
  0% {
    transform: translateX(100px) scale(0.8);
    opacity: 0;
  }
  100% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

.popup-notification__content--success {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  border: 1px solid #86efac;
  color: #166534;
}

.popup-notification__content--error {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border: 1px solid #fca5a5;
  color: #991b1b;
}

/* Popup Icon */
.popup-notification__icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: iconPulse 0.6s ease-out;
}

@keyframes iconPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

.popup-notification__icon svg {
  width: 28px;
  height: 28px;
  stroke-width: 2.5;
}

.popup-notification__content--success .popup-notification__icon svg {
  stroke: #16a34a;
}

.popup-notification__content--error .popup-notification__icon svg {
  stroke: #dc2626;
}

/* Popup Message */
.popup-notification__message {
  flex: 1;
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.5;
}

/* Close Button */
.popup-notification__close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.popup-notification__close:hover {
  background: rgba(0, 0, 0, 0.12);
  transform: scale(1.1);
}

.popup-notification__close:active {
  transform: scale(0.95);
}

.popup-notification__close svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}

.popup-notification__content--success .popup-notification__close {
  color: #166534;
}

.popup-notification__content--error .popup-notification__close {
  color: #991b1b;
}

/* Responsive para móviles */
@media (max-width: 640px) {
  .popup-notification {
    top: 10px;
    right: 10px;
    left: 10px;
    width: auto;
    max-width: none;
  }

  .popup-notification__content {
    padding: 14px 16px;
    gap: 12px;
  }

  .popup-notification__icon {
    width: 28px;
    height: 28px;
  }

  .popup-notification__icon svg {
    width: 24px;
    height: 24px;
  }

  .popup-notification__message {
    font-size: 0.875rem;
  }

  .popup-notification__close {
    width: 24px;
    height: 24px;
  }

  .popup-notification__close svg {
    width: 14px;
    height: 14px;
  }
}

/* Animación de salida */
.popup-notification:not(.popup-notification--visible) .popup-notification__content {
  animation: popupSlideOut 0.3s ease-in forwards;
}

@keyframes popupSlideOut {
  from {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
  to {
    transform: translateX(100px) scale(0.8);
    opacity: 0;
  }
}

/* Modo oscuro (opcional) */
@media (prefers-color-scheme: dark) {
  .connect-form__status--success {
    background-color: #064e3b;
    color: #86efac;
    border-color: #059669;
  }

  .connect-form__status--error {
    background-color: #7f1d1d;
    color: #fca5a5;
    border-color: #dc2626;
  }

  .popup-notification__content {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
  }

  .popup-notification__content--success {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    border-color: #059669;
    color: #86efac;
  }

  .popup-notification__content--error {
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
    border-color: #dc2626;
    color: #fca5a5;
  }

  .popup-notification__content--success .popup-notification__icon svg {
    stroke: #86efac;
  }

  .popup-notification__content--error .popup-notification__icon svg {
    stroke: #fca5a5;
  }

  .popup-notification__close {
    background: rgba(255, 255, 255, 0.1);
  }

  .popup-notification__close:hover {
    background: rgba(255, 255, 255, 0.2);
  }

  .popup-notification__content--success .popup-notification__close {
    color: #86efac;
  }

  .popup-notification__content--error .popup-notification__close {
    color: #fca5a5;
  }
}
