/**
 * Contact Form Styles
 * Styles for contact form spinner, alerts, and button states
 * 
 * @file contact-form.css
 */

/* Submit Button Layout */
#submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Submit Button Text and Icon Spacing */
#submit-text {
  display: inline-block;
  white-space: nowrap;
}

/* Submit Icon Container */
#submit-icon {
  transition: opacity 0.15s ease-in-out;
  position: relative;
  /* keep spinner positioned relative to this */
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  /* allow svg stroke to show, if needed */
  z-index: 1;
  flex-shrink: 0;
}

/* Spinner Animation - ensure spinner rotates around its center */
.spinner-icon,
.spinner-icon svg {
  transform-origin: 50% 50%;
  /* center center */
  -webkit-transform-origin: 50% 50%;
  -ms-transform-origin: 50% 50%;
  display: block;
  /* avoid inline alignment shifting */
  will-change: transform;
  /* smooth animation hint */
  backface-visibility: hidden;
  transform-box: fill-box;
  /* for some SVGs, ensures transform-origin uses SVG's bounding box */
}

/* Keep the SVG sized and centered */
.spinner-icon {
  animation: spin 1s linear infinite;
  width: 20px;
  height: 20px;
  line-height: 1;
  position: relative;
  flex-shrink: 0;
}

.spinner-icon svg {
  width: 100%;
  height: 100%;
  margin: 0;
  stroke: currentColor;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Form Alert Styles */
#form-alert {
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.5;
  margin-top: 20px;
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
  transform: translateY(-10px);
  opacity: 0;
}

#form-alert.show {
  opacity: 1;
  transform: translateY(0);
}

.alert-success {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.alert-danger {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

/* Disabled Button State */
#submit:disabled {
  opacity: 0.7;
  cursor: not-allowed !important;
}