/**
 * NovoForms — Public-facing styles
 * Modern, clean, responsive form styling.
 */

/* ─── Reset & base ─────────────────────────────────────────────────────────── */
.novoforms-wrap *,
.novoforms-wrap *::before,
.novoforms-wrap *::after {
  box-sizing: border-box;
}

.novoforms-wrap {
  --nf-primary:        #6366f1;
  --nf-primary-hover:  #4f46e5;
  --nf-primary-rgb:    99, 102, 241;
  --nf-success:        #10b981;
  --nf-error:          #ef4444;
  --nf-text:           #111827;
  --nf-label:          #374151;
  --nf-placeholder:    #9ca3af;
  --nf-border:         #d1d5db;
  --nf-border-focus:   #6366f1;
  --nf-bg:             #ffffff;
  --nf-bg-input:       #f9fafb;
  --nf-radius:         10px;
  --nf-shadow-input:   0 1px 2px rgba(0,0,0,0.05);
  --nf-shadow-focus:   0 0 0 3px rgba(var(--nf-primary-rgb), 0.18);
  --nf-transition:     150ms ease;
  --nf-font:           -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  font-family: var(--nf-font);
  color: var(--nf-text);
  max-width: 680px;
}

/* ─── Form grid ─────────────────────────────────────────────────────────────── */
.nf-fields-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.nf-col-full  { flex: 0 0 100%; }
.nf-col-half  { flex: 0 0 calc(50% - 9px); }

@media (max-width: 540px) {
  .nf-col-half { flex: 0 0 100%; }
}

/* ─── Field wrapper ──────────────────────────────────────────────────────────── */
.nf-field-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ─── Labels ────────────────────────────────────────────────────────────────── */
.nf-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--nf-label);
  line-height: 1.4;
}

.nf-required {
  color: var(--nf-error);
  margin-left: 3px;
}

/* ─── Inputs ────────────────────────────────────────────────────────────────── */
.nf-input {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  font-family: var(--nf-font);
  color: var(--nf-text);
  background: var(--nf-bg-input);
  border: 1.5px solid var(--nf-border);
  border-radius: var(--nf-radius);
  box-shadow: var(--nf-shadow-input);
  outline: none;
  transition: border-color var(--nf-transition), box-shadow var(--nf-transition), background var(--nf-transition);
  appearance: none;
  -webkit-appearance: none;
}

.nf-input::placeholder {
  color: var(--nf-placeholder);
}

.nf-input:focus {
  border-color: var(--nf-border-focus);
  box-shadow: var(--nf-shadow-focus);
  background: var(--nf-bg);
}

.nf-input.nf-input-error {
  border-color: var(--nf-error);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.15);
}

/* ─── Textarea ──────────────────────────────────────────────────────────────── */
.nf-textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.6;
}

/* ─── Select ────────────────────────────────────────────────────────────────── */
.nf-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 20px;
  padding-right: 40px;
  cursor: pointer;
}

/* ─── Radio & Checkbox ──────────────────────────────────────────────────────── */
.nf-radio-group,
.nf-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nf-radio-label,
.nf-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--nf-label);
  cursor: pointer;
  user-select: none;
}

.nf-radio,
.nf-checkbox {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  accent-color: var(--nf-primary);
  cursor: pointer;
}

/* ─── Field error message ───────────────────────────────────────────────────── */
.nf-field-error {
  display: block;
  font-size: 12px;
  color: var(--nf-error);
  min-height: 16px;
  line-height: 1.3;
}

/* ─── Submit button ─────────────────────────────────────────────────────────── */
.nf-submit-wrap {
  margin-top: 8px;
}

.nf-submit-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--nf-font);
  color: #ffffff;
  background: var(--nf-primary);
  border: none;
  border-radius: var(--nf-radius);
  cursor: pointer;
  transition: background var(--nf-transition), transform var(--nf-transition), box-shadow var(--nf-transition);
  box-shadow: 0 2px 8px rgba(var(--nf-primary-rgb), 0.35);
}

.nf-submit-btn:hover {
  background: var(--nf-primary-hover);
  box-shadow: 0 4px 16px rgba(var(--nf-primary-rgb), 0.45);
  transform: translateY(-1px);
}

.nf-submit-btn:active {
  transform: translateY(0);
}

.nf-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* ─── Spinner ───────────────────────────────────────────────────────────────── */
.nf-btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: nf-spin 0.65s linear infinite;
}

.nf-submit-btn.nf-submitting .nf-btn-spinner { display: block; }

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

/* ─── Response messages ─────────────────────────────────────────────────────── */
.nf-response {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: var(--nf-radius);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  display: none;
}

.nf-response.nf-success {
  display: block;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.nf-response.nf-error-msg {
  display: block;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ─── Honeypot (always hidden) ──────────────────────────────────────────────── */
.novoforms-hp {
  position: absolute !important;
  left: -9999px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ─── Success Screen ─────────────────────────────────────────────────────── */
.nf-success-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px;
  opacity: 0;
  transform: translateY(20px) scale(0.97);
  transition: opacity 500ms cubic-bezier(.22,1,.36,1), transform 500ms cubic-bezier(.22,1,.36,1);
}

.nf-success-screen.nf-success-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Animated checkmark */
.nf-success-icon-wrap {
  margin-bottom: 24px;
}

.nf-success-icon {
  width: 80px;
  height: 80px;
  position: relative;
}

.nf-success-icon svg {
  width: 80px;
  height: 80px;
  overflow: visible;
}

/* Circle draw animation */
.nf-checkmark-circle {
  stroke: #10b981;
  fill: #ecfdf5;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: nf-circle-draw 0.55s cubic-bezier(.65,0,.45,1) 0.1s forwards;
}

/* Check draw animation */
.nf-checkmark-check {
  stroke: #10b981;
  fill: none;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: nf-check-draw 0.3s cubic-bezier(.65,0,.45,1) 0.55s forwards;
}

@keyframes nf-circle-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes nf-check-draw {
  to { stroke-dashoffset: 0; }
}

.nf-success-title {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 800;
  color: #065f46;
  letter-spacing: -0.02em;
}

.nf-success-message {
  margin: 0;
  font-size: 15px;
  color: #374151;
  line-height: 1.6;
  max-width: 380px;
}
