/* ── COMPONENTS ─────────────────────────────────────────────────────
   Shared UI primitives: buttons, cards, forms, badges, modals,
   info panels, section headings, search, spinner.
──────────────────────────────────────────────────────────────────── */

/* BUTTONS ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all .15s;
  text-decoration: none;
  line-height: 1.4;
}
.btn-outline {
  border: 1.5px solid var(--border-dark);
  background: transparent;
  color: var(--slate);
}
.btn-outline:hover { border-color: var(--teal); color: var(--teal); }
.btn-primary { background: var(--teal); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--teal-light); color: #000; }
.btn-gold { background: var(--teal); color: #fff; font-weight: 700; }
.btn-gold:hover { background: var(--teal-light); }
.btn-lg { padding: 13px 28px; font-size: 15px; font-weight: 700; }

/* SECTION HEADINGS ------------------------------------------------- */
.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 8px;
}
.section-title {
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(26px, 3.5vw, 36px);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -.6px;
  line-height: 1.2;
}
.section-sub {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 10px;
  font-weight: 300;
}

/* INFO PANELS ------------------------------------------------------- */
.info-panel {
  border: 1px solid var(--border);
  border-left: 4px solid #1b4f9e;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  background: var(--surface);
  font-size: 14px;
  color: #d0d8e0;
  line-height: 1.6;
}
.info-panel.teal { border-left-color: var(--teal); }
.info-panel.gold { border-left-color: var(--gold); }
.info-panel strong { color: #ffffff; }

/* BADGES ------------------------------------------------------------ */
.badge { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; }
.badge-green { background: #1a3a2a; color: #4ade80; }
.badge-red   { background: #3a1a1a; color: #f87171; }
.badge-grey  { background: var(--surface-mid); color: var(--muted); }

/* CONTACT MODAL ----------------------------------------------------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,22,40,.95);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.active { display: flex; }
.modal-card {
  width: min(640px, 100%);
  background: #0f172a;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  box-shadow: 0 18px 70px rgba(0,0,0,.45);
  padding: 32px;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 18px; right: 18px;
  width: 40px; height: 40px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.85);
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modal-head { margin-bottom: 24px; }
.modal-head h2 { font-size: clamp(28px, 3vw, 36px); color: #ffffff; margin-bottom: 10px; }
.modal-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.form-note { margin-top: 18px; font-size: 13px; color: rgba(255,255,255,.7); }
.form-note a { color: var(--teal); }

/* FORMS ------------------------------------------------------------- */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #d0d8e0;
  margin-bottom: 7px;
}
.form-group label .req { color: #ef4444; margin-left: 2px; }
.form-group input,
.form-group select,
.form-group textarea,
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 14px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  outline: none;
  transition: border .2s, background .2s;
  background: var(--surface-mid);
  color: #fff;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(var(--teal-rgb),.15);
  background: rgba(var(--teal-rgb),.06);
}
.form-group textarea,
.contact-form textarea { height: 120px; resize: vertical; }
.form-group .hint { font-size: 13px; color: var(--muted); margin-top: 5px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 16px;
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.form-section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.form-divider { height: 1px; background: var(--border); margin: 24px 0; }

/* CHECKBOX ROWS ---------------------------------------------------- */
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; cursor: pointer; }
.checkbox-row input[type="checkbox"] {
  width: 16px; height: 16px;
  margin-top: 2px;
  accent-color: var(--teal);
  flex-shrink: 0;
  cursor: pointer;
}
.checkbox-row label { font-size: 14px; color: var(--muted); cursor: pointer; line-height: 1.45; }
.checkbox-row label strong { color: #fff; }

/* SEARCH INPUT & RESULTS ------------------------------------------- */
.search-input-wrap { display: flex; gap: 8px; }
.search-input {
  flex: 1;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border .2s;
  color: #ffffff;
  background: var(--surface-mid);
}
.search-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(var(--teal-rgb),.1);
}
.result-item {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  background: var(--surface-mid);
}
.result-name { font-weight: 600; font-size: 14px; color: #ffffff; }
.result-meta { font-size: 12px; color: var(--muted); margin-top: 3px; display: flex; gap: 12px; flex-wrap: wrap; }
.loading { text-align: center; padding: 18px; color: var(--muted); font-size: 13px; }
.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}

/* CUSTOM SELECT DROPDOWN (shared teal dropdown) ------------------- */
.cs-wrap {
  position: relative;
  width: 100%;
}
.cs-trigger {
  width: 100%;
  padding: 14px 18px;
  background: var(--surface-mid);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.cs-trigger:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(var(--teal-rgb),.15);
}
.cs-wrap.cs-open .cs-trigger {
  border-color: var(--teal);
  background: rgba(var(--teal-rgb),.06);
  box-shadow: 0 0 0 3px rgba(var(--teal-rgb),.15);
}
.cs-trigger-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cs-trigger-text.cs-placeholder { color: rgba(255,255,255,.28); }
.cs-arrow {
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
  transition: transform .2s;
  flex-shrink: 0;
}
.cs-wrap.cs-open .cs-arrow { transform: rotate(180deg); }

.cs-list {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #1b2d2c;
  border: 1.5px solid var(--teal);
  border-radius: var(--radius-md);
  z-index: 500;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
.cs-wrap.cs-open .cs-list { display: block; }
.cs-option {
  padding: 11px 18px;
  color: #d8e4e3;
  font-size: 14px;
  cursor: pointer;
  transition: background .1s, color .1s;
}
.cs-option:hover {
  background: var(--teal);
  color: #fff;
}
.cs-option.cs-disabled {
  opacity: .4;
  cursor: default;
  pointer-events: none;
  font-style: italic;
}

/* ── ACTIVITY AUTOCOMPLETE ─────────────────────────────────────────── */
.acs-wrap { position: relative; width: 100%; }
.acs-list {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #1b2d2c;
  border: 1.5px solid var(--teal);
  border-radius: var(--radius-md);
  z-index: 500;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
.acs-wrap.acs-open .acs-list { display: block; }
.acs-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  color: #d8e4e3;
  font-size: 14px;
  cursor: pointer;
  transition: background .1s, color .1s;
}
.acs-option:hover,
.acs-option.acs-active { background: var(--teal); color: #fff; }
.acs-option .acs-name { flex: 1; min-width: 0; }
.acs-option .acs-code {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--muted);
  background: rgba(255,255,255,.06);
  border-radius: 4px;
  padding: 2px 7px;
}
.acs-option:hover .acs-code,
.acs-option.acs-active .acs-code { color: #fff; background: rgba(255,255,255,.18); }
.acs-hl { color: var(--teal-light); font-weight: 700; }
.acs-option:hover .acs-hl,
.acs-option.acs-active .acs-hl { color: #fff; }
.acs-empty { padding: 14px 16px; color: var(--muted); font-size: 13px; font-style: italic; }
/* Tick the field once a listed activity has been chosen. */
.acs-wrap.acs-has-selection input { border-color: var(--teal); }

/* ── "Not a government agency" disclaimer strip ────────────────────── */
.gov-disclaimer {
  background: transparent;
  color: rgba(255,255,255,.3);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  padding: 7px 20px;
}
.gov-disclaimer strong { color: rgba(255,255,255,.42); font-weight: 500; }
.gov-disclaimer a { color: var(--teal-light); }
