/* ============================================================
   MPPA Portal — agency panel theme (registration forms & agency pages)
   Applied through <body class="agency-ui"> (core/View.php).
   Scoped selectors win over the older per-page styles.
   ============================================================ */
.agency-ui { background: #f3f6fa; color: #1f2937; font-size: 15px; }
.agency-ui h1, .agency-ui h2, .agency-ui h3 { letter-spacing: -.01em; }

/* ── Registration header: deadline + stepper ───────────────── */
.ap-top { background: #fff; border-bottom: 1px solid #e4e7ec; margin-bottom: 22px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.ap-top-in { max-width: 1080px; margin: 0 auto; padding: 14px 16px 16px; }
.ap-deadline { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: #fffaeb; border: 1px solid #fde7a8;
  border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }
.ap-deadline.is-urgent { background: #fef3f2; border-color: #fecdca; }
.ap-deadline-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 260px; }
.ap-deadline-left { flex-shrink: 0; font-weight: 700; font-size: .8rem; color: #93370d; background: #fef0c7; border-radius: 999px; padding: 4px 12px; }
.ap-deadline.is-urgent .ap-deadline-left { color: #b42318; background: #fee4e2; }
.ap-deadline-text { font-size: .8rem; color: #475467; line-height: 1.5; }
.ap-deadline-btn { flex-shrink: 0; font-size: .78rem; font-weight: 600; color: #1a3a6c; background: #fff; border: 1px solid #d0d5dd;
  border-radius: 8px; padding: 7px 14px; text-decoration: none; }
.ap-deadline-btn:hover { background: #f9fafb; }

.ap-steps { list-style: none; margin: 0; padding: 0; display: flex; }
.ap-step { flex: 1; position: relative; text-align: center; min-width: 0; }
.ap-step::before { content: ''; position: absolute; top: 15px; left: calc(-50% + 18px); right: calc(50% + 18px); height: 2px; background: #e4e7ec; }
.ap-step:first-child::before { display: none; }
.ap-step.is-done::before, .ap-step.is-current::before { background: #157347; }
.ap-step a, .ap-step > .ap-dot { text-decoration: none; }
.ap-step a { display: block; color: inherit; border-radius: 8px; }
.ap-step a:hover .ap-dot { box-shadow: 0 0 0 4px #dbeafe; }
.ap-dot { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: 50%; background: #fff; border: 2px solid #d0d5dd; color: #667085; font-size: .78rem; font-weight: 700; transition: box-shadow .15s; }
.ap-lbl { display: block; margin-top: 6px; font-size: .72rem; font-weight: 500; color: #667085; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-step.is-done .ap-dot { background: #157347; border-color: #157347; color: #fff; }
.ap-step.is-done .ap-lbl { color: #157347; }
.ap-step.is-current .ap-dot { background: #1a3a6c; border-color: #1a3a6c; color: #fff; box-shadow: 0 0 0 4px #dbe7fb; }
.ap-step.is-current .ap-lbl { color: #1a3a6c; font-weight: 700; }

.ap-steps-compact { display: none; }
.ap-sc-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.ap-sc-step { font-size: .72rem; font-weight: 700; color: #1a3a6c; text-transform: uppercase; letter-spacing: .05em; }
.ap-sc-title { font-size: .95rem; font-weight: 700; color: #101828; flex: 1; }
.ap-sc-pct { font-size: .72rem; color: #667085; }
.ap-sc-bar { height: 6px; background: #e4e7ec; border-radius: 999px; overflow: hidden; }
.ap-sc-bar span { display: block; height: 100%; background: linear-gradient(90deg, #1a3a6c, #2e5aa8); border-radius: 999px; }
@media (max-width: 860px) {
  .ap-steps { display: none; }
  .ap-steps-compact { display: block; }
  .ap-deadline-main { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ── Cards / page containers ───────────────────────────────── */
.agency-ui .bg-white.border, .agency-ui .bg-white.rounded { border-radius: 14px !important; border-color: #e4e7ec !important;
  box-shadow: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04) !important; }

/* ── Section headings ──────────────────────────────────────── */
.agency-ui .section-header { background: none !important; border: none !important; border-bottom: 1px solid #eaecf0 !important; border-radius: 0 !important;
  padding: 0 0 10px !important; margin: 8px 0 18px !important; font-size: .95rem !important; font-weight: 700 !important; color: #101828 !important;
  text-transform: none !important; letter-spacing: 0 !important; display: flex; align-items: center; gap: 8px; }
.agency-ui .pA-section, .agency-ui .sec {
  background: none !important; border: none !important; border-bottom: 1px solid #eaecf0 !important; border-radius: 0 !important;
  padding: 0 0 10px !important; margin: 10px 0 18px !important; font-size: .95rem !important; font-weight: 700 !important; color: #101828 !important;
  text-transform: none !important; letter-spacing: 0 !important; display: flex; align-items: center; gap: 8px; }
.agency-ui .pA-section::before, .agency-ui .sec::before, .agency-ui .section-header::before { content: ''; width: 4px; height: 18px; border-radius: 2px; background: #f2a900; flex-shrink: 0; }

/* Preview page section titles + person / certificate titles */
.agency-ui .prev-title { font-size: .95rem !important; text-transform: none !important; letter-spacing: 0 !important; color: #101828 !important; }
.agency-ui .person-title, .agency-ui .cert-title { color: #1a3a6c !important; font-weight: 700 !important; }

/* ── Labels, help text ─────────────────────────────────────── */
.agency-ui .field-label, .agency-ui label.fld, .agency-ui .pA-field > label { font-size: .84rem; font-weight: 600; color: #344054; margin-bottom: 6px; }
.agency-ui .req, .agency-ui .field-label .req { color: #d92d20; }
.agency-ui .helper-text, .agency-ui .hlp, .agency-ui .pA-hint { font-size: .76rem; color: #667085; margin-top: 6px; line-height: 1.45; }

/* ── Inputs (text, select, textarea, date) ─────────────────── */
.agency-ui input:not([type=radio]):not([type=checkbox]):not([type=file]):not([type=hidden]):not([type=submit]):not([type=button]):not([type=range]),
.agency-ui select, .agency-ui textarea {
  min-height: 44px; border: 1px solid #d0d5dd !important; border-radius: 8px !important; background-color: #fff;
  padding: 10px 14px; font-size: .92rem; color: #101828; box-shadow: 0 1px 2px rgba(16,24,40,.05);
  transition: border-color .15s, box-shadow .15s; }
.agency-ui textarea { min-height: 88px; line-height: 1.5; }
.agency-ui input:focus, .agency-ui select:focus, .agency-ui textarea:focus {
  outline: none; border-color: #2e5aa8 !important; box-shadow: 0 0 0 4px rgba(46,90,168,.14) !important; }
.agency-ui input[readonly], .agency-ui input:disabled, .agency-ui select:disabled { background: #f9fafb !important; color: #475467; }
.agency-ui input::placeholder, .agency-ui textarea::placeholder { color: #98a2b3; text-transform: none; letter-spacing: normal; font-family: inherit; }
.agency-ui input[type=radio], .agency-ui input[type=checkbox] { accent-color: #1a3a6c; width: 18px; height: 18px; }
.agency-ui input[type=file] { font-size: .84rem; padding: 6px; border: 1px dashed #d0d5dd; border-radius: 8px; background: #fcfcfd; width: 100%; }
.agency-ui input[type=file]::file-selector-button { border: 1px solid #d0d5dd; background: #fff; color: #1a3a6c; font-weight: 600;
  border-radius: 6px; padding: 7px 14px; margin-right: 12px; cursor: pointer; }
.agency-ui input[type=file]::file-selector-button:hover { background: #f2f4f7; }

/* Radio / choice cards used across the forms */
.agency-ui .radio-opt, .agency-ui .toggle-row label { border-radius: 10px !important; }

/* ── Buttons ───────────────────────────────────────────────── */
.agency-ui .btn-primary, .agency-ui .btn-p { background: #1a3a6c !important; background-image: none !important; color: #fff !important;
  border: 1px solid #1a3a6c !important; border-radius: 8px !important; padding: 11px 22px !important; font-weight: 600 !important;
  font-size: .9rem !important; text-transform: none !important; letter-spacing: 0 !important; box-shadow: 0 1px 2px rgba(16,24,40,.08); }
.agency-ui .btn-primary:hover, .agency-ui .btn-p:hover { background: #12305e !important; transform: none !important; }

/* ── Alerts ────────────────────────────────────────────────── */
.agency-ui .alert-error, .agency-ui .alert-e { border-radius: 10px !important; border: 1px solid #fecdca !important; border-left: 4px solid #d92d20 !important;
  background: #fef3f2 !important; color: #912018 !important; padding: 12px 16px !important; }
.agency-ui .alert-success, .agency-ui .alert-s { border-radius: 10px !important; border: 1px solid #abefc6 !important; border-left: 4px solid #079455 !important;
  background: #ecfdf3 !important; color: #054f31 !important; padding: 12px 16px !important; }

/* ── Small screens: single-column forms ───────────────────── */
@media (max-width: 640px) {
  .agency-ui .grid2, .agency-ui .grid3, .agency-ui .grid-2, .agency-ui .grid-3 { grid-template-columns: 1fr !important; }
  .agency-ui .btn-primary, .agency-ui .btn-p { width: 100%; justify-content: center; }
  .agency-ui { font-size: 14px; }
}
