/**
 * Stock Alert for WooCommerce — product form.
 */

.safw-subscription-form {
  margin: 20px 0;
  padding: 20px;
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  max-width: 520px;
  box-sizing: border-box;
}

.safw-form-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.safw-form-header svg {
  flex-shrink: 0;
}

.safw-form-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.safw-email-input {
  width: 100%;
  min-height: 44px;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.5;
  outline: none;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.safw-email-input:focus {
  border-color: var(--safw-accent, #7c3aed);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.1);
}

.safw-subscribe-btn {
  width: 100%;
  min-height: 44px;
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
  transition: opacity 0.2s ease, transform 0.1s ease;
}

.safw-subscribe-btn:hover {
  opacity: 0.9;
}

.safw-subscribe-btn:active {
  transform: scale(0.98);
}

.safw-subscribe-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.safw-subscribe-btn.safw-loading {
  position: relative;
  color: transparent !important;
}

.safw-subscribe-btn.safw-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: safw-spin 0.6s linear infinite;
}

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

.safw-form-message {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
}

.safw-form-message.safw-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.safw-form-message.safw-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.safw-form-message.safw-info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.safw-subscriber-count {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  color: #666;
}

.safw-subscriber-count svg {
  color: var(--safw-accent, #7c3aed);
}

.safw-privacy-note {
  margin-top: 8px;
  font-size: 11px;
  color: #999;
}

.safw-privacy-note a {
  color: var(--safw-accent, #7c3aed);
  text-decoration: none;
}

.safw-privacy-note a:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .safw-subscription-form {
    max-width: 100%;
    padding: 16px;
  }

  .safw-form-body {
    gap: 8px;
  }

  .safw-email-input {
    min-height: 42px;
    padding: 8px 12px;
  }

  .safw-subscribe-btn {
    min-height: 42px;
    padding: 8px 18px;
  }
}
