/* ============================================
   Modal Form — Inline Errors, Loader, Success
   ============================================ */

/* --- Field errors --- */
.form-group--error .form-input {
  border-color: #dc2626;
}

.form-group--error .form-input:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.form-error {
  display: none;
  font-size: 13px;
  color: #dc2626;
  margin-top: 4px;
  line-height: 1.3;
}

.form-group--error .form-error {
  display: block;
}

/* --- Alert banner (network / cross-field errors) --- */
.modal__alert {
  display: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 16px;
}

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

.modal__alert--visible {
  display: block;
}

/* --- Submit button loading state --- */
.modal__submit-loader {
  display: none;
}

.modal__submit--loading .modal__submit-text {
  display: none;
}

.modal__submit--loading .modal__submit-loader {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.modal__submit--loading {
  pointer-events: none;
  opacity: 0.75;
}

/* --- Success screen --- */
.modal__success {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 24px;
  min-height: 300px;
}

.modal__success--visible {
  display: flex;
}

.modal__success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 20px;
}

.modal__success-title {
  font-family: 'Lora', serif;
  font-size: 22px;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0 0 8px;
}

.modal__success-subtitle {
  font-size: 15px;
  color: #6b7280;
  margin: 0 0 24px;
  line-height: 1.5;
}

.modal__success-close {
  padding: 10px 28px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.modal__success-close:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}
