/* Polished feedback for form states and alerts */
#devis-alert {
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid transparent;
}
#devis-alert.success {
  background: #ecfdf5; /* green-50 */
  color: #065f46; /* green-800 */
  border-color: #a7f3d0; /* green-200 */
}
#devis-alert.error {
  background: #fef2f2; /* red-50 */
  color: #991b1b; /* red-800 */
  border-color: #fecaca; /* red-200 */
}

/* Error field highlight */
.field.field--error input,
.field.field--error select,
.field.field--error textarea {
  border-color: #ef4444 !important; /* red-500 */
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
  animation: error-blink 1s ease-in-out 2;
  will-change: border-color, box-shadow;
}

/* Submit button states */
.card button.btn.is-sending,
button.btn.is-sending {
  position: relative;
  pointer-events: none;
  opacity: 0.9;
}
button.btn.is-sending::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.8);
  border-top-color: rgba(255,255,255,0.2);
  animation: spinner 0.8s linear infinite;
}

button.btn.is-success {
  background: #10b981 !important; /* emerald-500 */
  border-color: #10b981 !important;
}

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

/* Blink animation for error field */
@keyframes error-blink {
  0% {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
  }
  50% {
    border-color: #b91c1c;
    box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.24);
  }
  100% {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
  }
}

@media (prefers-reduced-motion: reduce) {
  .field.field--error input,
  .field.field--error select,
  .field.field--error textarea {
    animation: none;
  }
}
