/* =====================================================================
   forms.css — Contact form + multi-step Questionnaire wizard.
   Loaded in addition to main.css on contact.html and questionnaire.html.
   ===================================================================== */

/* ---------- Form shell ---------- */
.form-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--sp-6); }
.form-row { margin-bottom: var(--sp-5); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

label { display: block; font-weight: 600; color: var(--ink); margin-bottom: 6px; font-size: .95rem; }
label .req { color: var(--danger); }
.hint { font-weight: 400; color: var(--text-muted); font-size: .85rem; margin: 2px 0 8px; }

input[type=text], input[type=email], input[type=tel], input[type=url], input[type=date],
input[type=number], select, textarea {
  width: 100%; font-family: inherit; font-size: 1rem; color: var(--text);
  padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow);
}
textarea { min-height: 120px; resize: vertical; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .85rem; margin-top: 6px; min-height: 1em; }

/* File input */
input[type=file] {
  width: 100%; font-family: inherit; font-size: .95rem; padding: 10px;
  border: 1.5px dashed var(--border); border-radius: var(--radius-sm); background: var(--bg-alt);
}
input[type=file]::file-selector-button {
  font-family: inherit; font-weight: 600; margin-right: 12px; padding: 8px 14px;
  border: 0; border-radius: 999px; background: var(--brand-light); color: var(--brand-dark); cursor: pointer;
}

/* Checkbox / radio groups */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; transition: border-color .15s ease, background .15s ease; font-weight: 500;
}
.choice:hover { border-color: var(--brand); background: var(--brand-light); }
.choice input { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; flex: none; }
.choice.selected { border-color: var(--brand); background: var(--brand-light); }

/* Status messages */
.form-status { border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: var(--sp-5); font-weight: 600; display: none; }
.form-status.show { display: block; }
.form-status.success { background: #e7f6ec; color: var(--success); border: 1px solid #b6e2c4; }
.form-status.error { background: #fdeaea; color: var(--danger); border: 1px solid #f2c3c3; }

/* ---------- Wizard ---------- */
.wizard-head { margin-bottom: var(--sp-6); }
.progress { height: 8px; background: var(--bg-alt); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand-dark)); transition: width .3s ease; }
.progress-meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: .9rem; color: var(--text-muted); font-weight: 600; }

.wizard-step { display: none; animation: fadeIn .25s ease; }
.wizard-step.active { display: block; }
.wizard-step h2 { font-size: 1.5rem; }
.wizard-step .step-intro { color: var(--text-muted); margin-top: -6px; margin-bottom: var(--sp-5); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.wizard-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: var(--sp-6); padding-top: var(--sp-5); border-top: 1px solid var(--border); }
.wizard-nav .spacer { flex: 1; }
.save-note { font-size: .85rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.save-note .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }

/* Review step */
.review-list { list-style: none; padding: 0; margin: 0; }
.review-list li { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; gap: 16px; flex-wrap: wrap; }
.review-list .k { font-weight: 700; color: var(--ink); min-width: 200px; }
.review-list .v { color: var(--text); flex: 1; }

/* Print (questionnaire summary) — only the active Review step prints */
.print-only { display: none; }
@media print {
  .no-print, .wizard-head, .form-status, .step-intro { display: none !important; }
  .print-only { display: block !important; }
  .form-card { box-shadow: none; border: none; padding: 0; }
  .wizard-step { page-break-inside: avoid; }
  .review-list .k { min-width: 220px; }
}
