/**
 * Smart Approval Form Builder – Frontend CSS
 * Clean, accessible, mobile-first form styles.
 * @package SmartApprovalFormBuilder
 */

.safb-form-wrapper {
  max-width: 680px;
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1a1a1a;
}
.safb-form-desc { color: #555; font-size: 15px; line-height: 1.6; margin: 0 0 22px; }

/* Messages */
.safb-success-msg,
.safb-error-msg {
  padding: 13px 16px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  animation: safb-slide-down .3s ease;
}
.safb-success-msg { background: #d1fae5; color: #065f46; border-left: 4px solid #10b981; }
.safb-error-msg   { background: #fee2e2; color: #7f1d1d; border-left: 4px solid #ef4444; }

@keyframes safb-slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Field wrap */
.safb-field-wrap { margin-bottom: 20px; }
.safb-field-wrap label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}
.safb-required { color: #ef4444; margin-left: 3px; }
.safb-field-desc { font-size: 12px; color: #6b7280; margin-top: 5px; }

/* Inputs */
.safb-input {
  display: block;
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid #d1d5db;
  border-radius: 6px;
  font-size: 15px;
  color: #111827;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  appearance: auto;
}
.safb-input:focus {
  outline: none;
  border-color: #2271b1;
  box-shadow: 0 0 0 3px rgba(34,113,177,.15);
}
.safb-input::placeholder { color: #9ca3af; }
textarea.safb-input { resize: vertical; min-height: 100px; }

/* Checkbox / Radio */
.safb-checkbox-group,
.safb-radio-group { display: flex; flex-direction: column; gap: 10px; }
.safb-check-label,
.safb-radio-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
}
.safb-check-label input,
.safb-radio-label input { width: 17px; height: 17px; accent-color: #2271b1; flex-shrink: 0; cursor: pointer; }

/* File */
.safb-file-input {
  padding: 8px;
  font-size: 13px;
  border: 1.5px dashed #d1d5db;
  background: #f9fafb;
  cursor: pointer;
}
.safb-file-input:hover { border-color: #2271b1; background: #f0f5fb; }

/* Empty notice inside form */
.safb-empty-notice { color: #888; font-style: italic; font-size: 14px; }
.safb-error { color: #d63638; font-size: 14px; }

/* Submit button */
.safb-form-footer { margin-top: 26px; }
.safb-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 28px;
  background: #2271b1;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .08s;
  box-shadow: 0 2px 6px rgba(34,113,177,.35);
}
.safb-submit-btn:hover  { background: #135e96; }
.safb-submit-btn:active { transform: translateY(1px); }
.safb-submit-btn:focus-visible { outline: 3px solid #2271b1; outline-offset: 3px; }
.safb-submit-btn:disabled { opacity: .65; cursor: not-allowed; }

/* Spinner inside button */
.safb-spin-svg {
  width: 17px;
  height: 17px;
  animation: safb-spin .8s linear infinite;
}
.safb-spin-svg circle {
  stroke: rgba(255,255,255,.85);
  stroke-linecap: round;
  stroke-dasharray: 80;
  stroke-dashoffset: 60;
}
@keyframes safb-spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 600px) {
  .safb-form-wrapper { max-width: 100%; }
  .safb-submit-btn   { width: 100%; }
  .safb-input { font-size: 16px; } /* prevent iOS auto-zoom */
}
