.cmrec-bcat-wrap { max-width: 720px; margin: 0 auto; font-family: inherit; }
.cmrec-steps { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.cmrec-steps .step { padding: 6px 12px; border-radius: 20px; background: #eee; color: #888; font-size: 13px; }
.cmrec-steps .step.active { background: #1a3c6e; color: #fff; }

/* ---------------------------------------------------------------
   ERROR / SUCCESS MODAL — fixed overlay, always visible regardless
   of scroll position, works reliably on mobile screens.
   --------------------------------------------------------------- */
.cmrec-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 999999;
  padding: 16px;
  padding-top: 28px;
  box-sizing: border-box;
}
@media (max-width: 600px) {
  .cmrec-modal-overlay { padding-top: 12px; }
}
.cmrec-modal-box {
  background: #fff;
  border-radius: 10px;
  max-width: 420px;
  width: 100%;
  padding: 26px 20px 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  position: relative;
  max-height: 85vh;
  overflow-y: auto;
  box-sizing: border-box;
}
.cmrec-modal-error { border: 2px solid #d32f2f; }
.cmrec-modal-success { border: 2px solid #1b5e20; }
.cmrec-modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: #777;
  padding: 6px 10px;
}
.cmrec-modal-close:hover { color: #000; }
.cmrec-modal-title { font-size: 17px; font-weight: 700; margin-bottom: 10px; padding-right: 24px; }
.cmrec-modal-error .cmrec-modal-title { color: #b3261e; }
.cmrec-modal-success .cmrec-modal-title { color: #1b5e20; }
.cmrec-modal-msg { font-size: 14.5px; line-height: 1.55; color: #333; margin-bottom: 14px; white-space: pre-line; }
.cmrec-modal-tip {
  font-size: 13px;
  background: #fff7e6;
  border: 1px solid #ffe0a3;
  border-radius: 6px;
  padding: 10px 12px;
  color: #7a5200;
  margin-bottom: 18px;
  line-height: 1.45;
}
.cmrec-modal-ok {
  display: block;
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: 6px;
  background: #1e3a5f;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.cmrec-modal-ok:hover { background: #16304d; }
@media (max-width: 600px) {
  .cmrec-modal-box { padding: 22px 16px 16px; }
}

.cmrec-message { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; }
.cmrec-message.error { background: #fdecea; color: #b3261e; border: 1px solid #f5c2c0; }
.cmrec-message.success { background: #e8f5e9; color: #1b5e20; border: 1px solid #b7e0b9; }

.cmrec-step label { display: block; margin-top: 14px; margin-bottom: 4px; font-weight: 600; font-size: 14px; }
.cmrec-step input[type="text"],
.cmrec-step input[type="date"],
.cmrec-step input[type="tel"],
.cmrec-step input[type="email"],
.cmrec-step input[type="file"],
.cmrec-step select,
.cmrec-step textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px; box-sizing: border-box;
}
.cmrec-step textarea { min-height: 60px; }

.cmrec-declaration { font-style: italic; margin-top: 20px; }

.cmrec-btn-primary, .cmrec-btn-secondary {
  display: inline-block; margin-top: 24px; margin-right: 10px; padding: 10px 22px;
  border-radius: 4px; border: none; font-size: 15px; cursor: pointer; text-decoration: none;
}
.cmrec-btn-primary { background: #1a3c6e; color: #fff; }
.cmrec-btn-secondary { background: #eee; color: #333; }

.cmrec-step input.cmrec-invalid,
.cmrec-step select.cmrec-invalid,
.cmrec-step textarea.cmrec-invalid {
  border: 2px solid #d32f2f !important;
  background: #fdecea !important;
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.15) !important;
  scroll-margin-top: 90px;
}

/* Inline per-field error text — shown right under the field itself.
   Only surfaced on mobile widths; on desktop the top popup + red
   border are enough, so this stays hidden there. */
.cmrec-field-error {
  display: none;
  color: #b3261e;
  font-size: 12.5px;
  font-weight: 600;
  margin-top: 4px;
  margin-bottom: 2px;
}
@media (max-width: 600px) {
  .cmrec-field-error { display: block; }
}

.cmrec-note { color: #666; font-size: 13px; }
.cmrec-section { margin-top: 28px; padding-bottom: 4px; border-bottom: 2px solid #1a3c6e; color: #1a3c6e; }
.cmrec-review-actions { margin-top: 10px; }

/* =====================================================================
   REVIEW STEP — exact visual replica of the official CMREC B-Cat PDF.
   Used only in Step 2 (Review). Same field order/labels the PDF uses.
   ===================================================================== */
.cmrec-pdf-sheet {
  background: #fff;
  border: 3px solid #222;
  padding: 24px 28px;
  font-family: "Times New Roman", Times, serif;
  color: #111;
  max-width: 900px;
  margin: 0 auto;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  overflow-x: auto;
}
.pdf-appno {
  text-align: right;
  font-style: italic;
  border: 1px solid #222;
  display: inline-block;
  padding: 4px 10px;
  float: right;
  font-size: 13px;
}
.pdf-header { display: flex; align-items: center; gap: 16px; clear: both; padding-top: 6px; }
.pdf-logo { width: 64px; height: auto; flex-shrink: 0; }
.pdf-headertext { flex: 1; }
.pdf-college { font-size: 24px; font-weight: bold; color: #111; text-align: center; }
.pdf-ugc { font-size: 14px; font-weight: bold; color: #c0392b; text-align: center; }
.pdf-address { font-size: 12px; text-align: center; color: #222; }
.pdf-hr { border: none; border-top: 3px solid #111; margin: 10px 0; }
.pdf-title { text-align: center; font-weight: bold; text-decoration: underline; margin: 10px 0; font-size: 15px; }
.pdf-courses { font-size: 13px; margin-bottom: 10px; }

.pdf-body { display: flex; gap: 20px; }
.pdf-fields { flex: 1; min-width: 0; }
.pdf-fields-full { margin-top: 10px; }
.pdf-branch { margin-bottom: 14px; font-size: 13px; }

.pdf-photobox {
  width: 110px; min-width: 110px; height: 130px;
  border: 2px solid #6a4c93;
  display: flex; align-items: center; justify-content: center;
  text-align: center; font-size: 11px; color: #444; padding: 6px;
}
.pdf-photobox img { max-width: 100%; max-height: 100%; object-fit: cover; }

.pdf-row { display: flex; font-size: 13px; margin-bottom: 6px; align-items: baseline; }
.pdf-num { width: 22px; flex-shrink: 0; }
.pdf-label { width: 42%; flex-shrink: 0; padding-right: 6px; }
.pdf-sub { font-size: 11px; font-style: italic; color: #444; }
.pdf-colon { width: 10px; flex-shrink: 0; }
.pdf-value { flex: 1; border-bottom: 1px solid #999; min-height: 16px; word-break: break-word; }

.pdf-declaration { margin-top: 22px; font-size: 13px; }

.pdf-signrow { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 30px; }
.pdf-date { font-size: 13px; }
.pdf-signbox { text-align: center; }
.pdf-sign-img { max-height: 40px; display: block; margin: 0 auto 4px; }
.pdf-signlabel { font-style: italic; font-size: 13px; border-top: 1px solid #222; padding-top: 2px; }

.pdf-xerox-title { font-style: italic; font-weight: bold; margin-top: 24px; font-size: 13px; }
.pdf-xerox-table { border-collapse: collapse; margin-top: 6px; font-size: 13px; width: 100%; max-width: 500px; }
.pdf-xerox-table th, .pdf-xerox-table td { border: 1px solid #222; padding: 4px 8px; text-align: left; }
.pdf-xerox-table th:last-child, .pdf-xerox-table td:last-child { text-align: center; width: 60px; }

@media (max-width: 600px) {
  .pdf-body { flex-direction: column; }
  .pdf-photobox { align-self: flex-end; }
  .pdf-row { flex-wrap: wrap; }
  .pdf-label { width: 100%; }
  .pdf-college { font-size: 18px; }
}

/* =====================================================================
   v2.1 ADDITIONS
   ===================================================================== */

/* Dismissible message banner (× close button) */
.cmrec-message { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cmrec-message-text { flex: 1; }
.cmrec-message-close {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0.65;
}
.cmrec-message-close:hover { opacity: 1; }

/* Manual payment step — QR + screenshot upload */
.cmrec-pay-instruction { font-size: 14px; margin-bottom: 16px; color: #333; }
.cmrec-qr-wrap { text-align: center; margin: 8px 0 22px; }
.cmrec-qr-img {
  width: 240px; max-width: 80%; height: auto;
  border: 1px solid #ddd; border-radius: 10px; padding: 10px; background: #fff;
}
.cmrec-qr-amount { margin-top: 8px; font-weight: 700; font-size: 15px; color: #1a3c6e; }
.cmrec-pay-upload {
  background: #f7f9fc; border: 1px solid #e0e6ef; border-radius: 10px; padding: 16px 18px;
}
.cmrec-pay-upload label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 14px; }
.cmrec-pay-upload input.cmrec-invalid {
  border: 2px solid #d32f2f !important;
  background: #fdecea !important;
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.15) !important;
}
.cmrec-pay-upload .cmrec-btn-primary { margin-top: 16px; }

/* Required-field asterisk — always red */
.cmrec-req { color: #d32f2f; font-weight: 700; }

/* ---- Instructions step (Step 0) ---- */
.cmrec-instructions { margin: 8px 0 18px; padding-left: 22px; line-height: 1.6; }
.cmrec-instructions > li { margin-bottom: 8px; }
.cmrec-instructions ul { margin-top: 6px; }
.cmrec-accept-label {
  display: flex; align-items: flex-start; gap: 8px;
  background: #f7f9fc; border: 1px solid #e0e6ef; border-radius: 8px;
  padding: 12px 14px; font-weight: 600; cursor: pointer;
}
.cmrec-accept-label input { margin-top: 3px; width: auto; }

/* ---- Success step (Step 4) ---- */
.cmrec-success { text-align: center; padding: 10px 0; }
.cmrec-success h3 { color: #1e7e34; }
.cmrec-appno-box {
  display: inline-block; margin: 14px auto; padding: 14px 26px;
  background: #eef6ff; border: 1px dashed #1a3c6e; border-radius: 10px;
  font-size: 15px; color: #1a3c6e;
}
.cmrec-appno-box strong { font-size: 26px; letter-spacing: 1px; }

/* Hint text below field labels */
.cmrec-hint { display: block; color: #777; font-size: 12px; margin: 0 0 4px; font-style: italic; }

/* Mobile: ensure continue button + accept label are tappable */
#cmrec-instructions-continue { width: 100%; max-width: 320px; margin-top: 14px; padding: 12px 20px; font-size: 16px; }
.cmrec-accept-label input[type="checkbox"] { width: 20px; height: 20px; min-width: 20px; }
@media (max-width: 600px) {
  #cmrec-instructions-continue { max-width: 100%; }
  .cmrec-accept-label { font-size: 14px; }
}
