/* MTK form 6 (mo-tai-khoan-ekyc) — spacing + post-submit message.
 * Lives in gcl-core (tracked) — the xkld theme is gitignored so CSS there never deploys.
 * The gcl-gap-* layout classes sit on Formidable fields (see be-laravel
 * docs/account-opening/plans/02-wordpress-form.md update log for the field list). */

.frm_forms .gcl-gap-lg { margin-top: 28px; }
.frm_forms .gcl-gap-md { margin-top: 24px; }
.frm_forms .gcl-gap-sm { margin-top: 14px; }
.frm_forms .gcl-extra-accounts .frm_description { margin-top: 6px; }
/* Stage theme lays checkbox options inline — force one per line regardless of global style. */
.frm_forms .gcl-extra-accounts .frm_checkbox { display: block; margin-bottom: 4px; }

/* Next/submit buttons render OUTSIDE their field container — classes are inert there. */
#frm_form_6_container .frm_submit { margin-top: 24px; }

/* CTA ("Tiếp tục" step 1 / "Gửi thông tin" step 2): theme leaves it auto-width, so on mobile
 * the two-word label wraps inside a stub of a button. Full-width CTA, never wraps.
 * !important mirrors the theme's own — .with_frm_style .frm_submit button uses it. */
#frm_form_6_container .frm_submit button {
  width: 100% !important;
  max-width: 360px;
  min-height: 52px;
  padding: 14px 28px !important;
  font-size: 17px !important;
  line-height: 1.25 !important;
  white-space: nowrap;
  border-radius: 10px !important;
  box-shadow: 0 6px 16px rgba(253, 185, 36, 0.3);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
#frm_form_6_container .frm_submit button:active {
  transform: translateY(1px);
  box-shadow: 0 3px 10px rgba(253, 185, 36, 0.28);
}

/* Success message: theme default is orange-on-orange, unreadable. */
#frm_form_6_container .frm_message,
.frm_forms .frm_message {
  background: #fffaf0;
  border: 1px solid #f0c040;
  color: #333;
  padding: 18px 22px;
  line-height: 1.6;
}
#frm_form_6_container .frm_message strong,
.frm_forms .frm_message strong { color: #111; }
#frm_form_6_container .frm_message p,
.frm_forms .frm_message p { font-weight: 600; color: #333; }

/* Loading state cho nút Tiếp theo / Gửi thông tin (JS gcl-btn-loading). */
.gcl-btn-loading {
  opacity: 0.7;
  pointer-events: none;
  position: relative;
}
.gcl-btn-loading::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  vertical-align: -2px;
  border: 2px solid rgba(0, 0, 0, 0.25);
  border-top-color: rgba(0, 0, 0, 0.75);
  border-radius: 50%;
  animation: gcl-spin 0.7s linear infinite;
}
@keyframes gcl-spin { to { transform: rotate(360deg); } }

/* ==========================================================================
 * Ép chụp chân dung bằng camera — field 43 "Hình chân dung" (JS gcl-cam-*)
 * ========================================================================== */

/* KHOÁ field 43 cho tới khi JS sẵn sàng (fail-closed): CSS nằm trong <head>, JS ở
 * footer — khoảng hở vài trăm ms đó đủ cho người nhanh tay mở gallery nếu không khoá
 * trước. JS init xong sẽ gắn .gcl-cam-ready để mở đúng cửa theo route. JS chết →
 * field bị khoá NHÌN THẤY ĐƯỢC, thay vì một lỗ gallery không ai thấy. */
#file43_dropzone:not(.gcl-cam-ready) { pointer-events: none; }

/* Modal chụp */
.gcl-cam-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000; /* trên OTP modal + header theme */
  background: rgba(10, 12, 16, 0.82);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.gcl-cam-overlay.gcl-cam-show { display: flex; }
.gcl-cam-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
}
.gcl-cam-banner {
  padding: 10px 12px;
  border-radius: 9px;
  margin-bottom: 10px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
  background: #fff7e6;
  color: #7a5200;
}
.gcl-cam-banner.gcl-cam-good { background: #e9f7ef; color: #146c3c; }
.gcl-cam-banner.gcl-cam-bad { background: #fdecec; color: #b02a2a; }
.gcl-cam-stage {
  position: relative;
  background: #0c0e12;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  margin-bottom: 12px;
}
/* Preview lật gương CHỈ lúc hiển thị — pixel giữ đúng chiều nên ảnh lưu không ngược */
.gcl-cam-stage canvas,
.gcl-cam-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gcl-cam-stage canvas { transform: scaleX(-1); }
.gcl-cam-stage img { display: none; }
.gcl-cam-stage.gcl-cam-shot canvas { display: none; }
.gcl-cam-stage.gcl-cam-shot img { display: block; }
.gcl-cam-msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  color: #b9c0cc;
  font-size: 13.5px;
}
.gcl-cam-stage.gcl-cam-live .gcl-cam-msg,
.gcl-cam-stage.gcl-cam-shot .gcl-cam-msg { display: none; }
/* Khung canh mặt — chỉ để người dùng canh, không nhận diện gì */
.gcl-cam-guide {
  position: absolute;
  left: 50%;
  top: 45%;
  width: 60%;
  aspect-ratio: 3 / 4;
  transform: translate(-50%, -50%);
  border: 2px dashed rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  pointer-events: none;
  display: none;
}
.gcl-cam-stage.gcl-cam-live .gcl-cam-guide { display: block; }
.gcl-cam-btn {
  display: block;
  width: 100%;
  padding: 13px 16px;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 15px;
  color: #1a1200;
  background: #fdb924;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
.gcl-cam-btn.gcl-cam-ghost {
  background: #fff;
  color: #333;
  border: 1px solid #d9dce2;
  font-weight: 600;
}
.gcl-cam-btn:disabled { opacity: 0.5; pointer-events: none; }
.gcl-cam-row { display: flex; gap: 8px; }
.gcl-cam-row .gcl-cam-btn { flex: 1; }
.gcl-cam-hidden { display: none !important; }
