/* ax-forms.css — shared form layer for Arewa Nexgen (admin, team, public).
   Pairs with assets/js/ax-forms.js. Tokens mirror the portal brand palette. */

.axf {
  --axf-green: #178748;
  --axf-green-dark: #126b3a;
  --axf-orange: #b45309;
  --axf-ink: #1f2937;
  --axf-muted: #6b7280;
  --axf-line: #d5dbe2;
  --axf-canvas: #f7f8f7;
  --axf-danger: #b42318;
  --axf-radius: 10px;
  color: var(--axf-ink);
  font-family: 'Plus Jakarta Sans', Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
}

.axf *,
.axf *::before,
.axf *::after { box-sizing: border-box; }

/* Author display rules below would otherwise beat the browser's [hidden] rule. */
.axf [hidden],
.axf[hidden] { display: none !important; }

.axf-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .axf-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .axf-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.axf-field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 16px; }
.axf-field:last-child { margin-bottom: 0; }

.axf-label {
  display: flex; align-items: baseline; gap: 6px;
  font-weight: 700; font-size: 13px; color: #334155; line-height: 1.3;
}
.axf-req { color: var(--axf-orange); font-weight: 800; }
.axf-optional { color: var(--axf-muted); font-weight: 500; font-size: 12px; }

.axf-hint { margin: 0; font-size: 12px; line-height: 1.45; color: var(--axf-muted); }
.axf-error { margin: 0; font-size: 12px; line-height: 1.45; color: var(--axf-danger); font-weight: 600; display: flex; gap: 5px; align-items: flex-start; }

.axf-input,
.axf-select,
.axf-textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--axf-line);
  border-radius: var(--axf-radius);
  background: #fff;
  color: var(--axf-ink);
  font: inherit;
  line-height: 1.4;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.axf-textarea { min-height: 96px; resize: vertical; }
.axf-input::placeholder,
.axf-textarea::placeholder { color: #9aa3af; }

.axf-input:focus,
.axf-select:focus,
.axf-textarea:focus,
.axf-search-input:focus {
  outline: none;
  border-color: var(--axf-green);
  box-shadow: 0 0 0 3px rgba(23, 135, 72, .16);
}

.axf-input:disabled,
.axf-select:disabled,
.axf-textarea:disabled { background: #f1f5f9; color: #64748b; cursor: not-allowed; }

.axf-invalid,
.axf-invalid:focus { border-color: var(--axf-danger); box-shadow: 0 0 0 3px rgba(180, 35, 24, .12); }

.axf-input[type="number"] { max-width: 100%; }
.axf-input[type="date"],
.axf-input[type="datetime-local"],
.axf-input[type="time"] { min-height: 42px; }

.axf-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.axf-check {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--axf-line); border-radius: var(--axf-radius);
  background: #fff; cursor: pointer; font-weight: 600; font-size: 13px;
}
.axf-check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--axf-green); flex-shrink: 0; }
.axf-check small { display: block; font-weight: 500; color: var(--axf-muted); font-size: 12px; margin-top: 2px; }

/* Searchable select */
.axf-searchable { position: relative; }
.axf-search-input {
  width: 100%; min-height: 38px; margin-bottom: 6px; padding: 8px 10px;
  border: 1px solid var(--axf-line); border-radius: 8px; font: inherit; font-size: 13px;
}
.axf-search-count { font-size: 11px; color: var(--axf-muted); margin-top: 4px; }

/* Uploads */
.axf-upload { display: flex; flex-direction: column; gap: 8px; }
.axf-drop {
  position: relative; display: flex; align-items: center; gap: 12px;
  border: 1.5px dashed #c3ccd6; border-radius: var(--axf-radius);
  background: #fbfcfb; padding: 14px; cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
  text-align: left; width: 100%;
}
.axf-drop:hover,
.axf-drop.axf-dragover { border-color: var(--axf-green); background: #f0faf4; }
.axf-drop:focus-within { border-color: var(--axf-green); box-shadow: 0 0 0 3px rgba(23, 135, 72, .14); }
.axf-drop input[type="file"] {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
}
.axf-drop-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.axf-drop-title { font-weight: 700; font-size: 13px; color: #334155; }
.axf-drop-meta { font-size: 12px; color: var(--axf-muted); }
.axf-drop-icon { font-size: 22px; color: var(--axf-green); flex-shrink: 0; }

.axf-preview { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid #e5e9ee; border-radius: 8px; background: #fff; }
.axf-preview img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; background: #eef1f4; flex-shrink: 0; }
.axf-preview-meta { min-width: 0; font-size: 12px; color: var(--axf-muted); overflow-wrap: anywhere; }
.axf-preview-meta strong { display: block; color: #334155; font-size: 13px; }

.axf-linkbtn {
  appearance: none; border: 1px solid var(--axf-line); background: #fff; color: #334155;
  border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 12px; font-weight: 700;
  cursor: pointer; min-height: 32px;
}
.axf-linkbtn:hover { border-color: var(--axf-danger); color: var(--axf-danger); }
.axf-linkbtn.axf-neutral:hover { border-color: var(--axf-green); color: var(--axf-green-dark); }

/* Repeatable groups */
.axf-repeat { display: flex; flex-direction: column; gap: 10px; }
.axf-repeat-rows { display: flex; flex-direction: column; gap: 10px; }
.axf-repeat-row {
  border: 1px solid #e2e8ef; border-radius: var(--axf-radius);
  padding: 12px; background: #fbfcfd; position: relative;
}
.axf-repeat-row .axf-remove {
  position: absolute; top: 8px; right: 8px; z-index: 1;
}
.axf-repeat-head { font-size: 12px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; padding-right: 80px; }
.axf-add {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  border: 1px dashed #b9c4cf; background: #fff; color: var(--axf-green-dark);
  border-radius: 8px; padding: 8px 12px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.axf-add:hover { border-color: var(--axf-green); background: #f0faf4; }

/* Submit + progress */
.axf-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.axf-submit {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 11px 18px; border: 0; border-radius: var(--axf-radius);
  background: var(--axf-green); color: #fff; font: inherit; font-weight: 800; font-size: 14px;
  cursor: pointer; transition: background .15s ease, transform .1s ease;
}
.axf-submit:hover { background: var(--axf-green-dark); }
.axf-submit:active { transform: translateY(1px); }
.axf-submit:disabled { opacity: .65; cursor: progress; }
.axf-submit.secondary { background: #fff; color: #334155; border: 1px solid var(--axf-line); }
.axf-submit.secondary:hover { background: #f8fafc; }

.axf-summary {
  border: 1px solid #f3c9c4; background: #fdf3f2; color: #8a1f14;
  border-radius: var(--axf-radius); padding: 12px 14px; margin-bottom: 16px;
  font-size: 13px; font-weight: 600;
}
.axf-summary ul { margin: 6px 0 0; padding-left: 18px; font-weight: 500; }
.axf-success {
  border: 1px solid #bfe3cd; background: #f1fbf4; color: #12633a;
  border-radius: var(--axf-radius); padding: 12px 14px; margin-bottom: 16px; font-size: 13px; font-weight: 600;
}

.axf-progress { font-size: 12px; color: var(--axf-muted); font-weight: 600; }

@media (max-width: 640px) {
  .axf-drop { align-items: flex-start; }
  .axf-preview img { width: 48px; height: 48px; }
}
