/* Registration flow styling — verbatim port of inc/reg_style.php. */

.reg-page { background:#1d3557; min-height:100vh; margin:0; font-family:'Source Sans 3','Source Sans Pro',sans-serif; }

.reg-header { background:#152945; padding:14px 24px; display:flex; align-items:center; }
.reg-header-brand { display:flex; align-items:center; gap:12px; }
.reg-header-logo {
  width:40px; height:40px; border-radius:50%; background:#fff; color:#1d3557;
  display:flex; align-items:center; justify-content:center; font-size:18px; flex-shrink:0; overflow:hidden;
}
.reg-header-logo a { display:block; width:100%; height:100%; }
.reg-header-logo img { width:100%; height:100%; object-fit:cover; }
.reg-header-name { color:#fff; font-weight:700; font-size:16px; line-height:1.2; }
.reg-header-sub  { color:#a8b8cf; font-size:12px; }

.reg-wrap { display:flex; justify-content:center; padding:24px 16px 48px; }
.reg-card { background:#fff; border-radius:20px; padding:32px 28px 28px; width:100%; max-width:720px; box-shadow:0 12px 40px rgba(0,0,0,0.18); }

.reg-brand { text-align:center; margin-bottom:24px; }
.reg-logo-lg { width:64px; height:64px; font-size:26px; margin:0 auto 12px; background:#eef2ff; color:#1d3557; }
.reg-title { font-size:22px; font-weight:700; color:#1d3557; margin:0 0 4px; }
.reg-sub   { font-size:13px; color:#888; margin:0; }

.reg-success-icon { width:64px; height:64px; border-radius:50%; background:#d1fae5; color:#10b981; font-size:26px; display:flex; align-items:center; justify-content:center; margin:0 auto 12px; }
.reg-success-code { text-align:center; background:#f9fbff; border:1.5px solid #dde4ed; border-radius:12px; padding:18px; display:flex; flex-direction:column; gap:4px; }
.reg-success-code span { font-size:12px; color:#888; text-transform:uppercase; letter-spacing:.5px; }
.reg-success-code strong { font-size:24px; color:#1d3557; letter-spacing:1px; }
.reg-success-code small { font-size:12px; color:#aaa; margin-top:4px; }

.reg-alert { background:#fdecea; color:#b91c1c; border:1px solid #f5c2c7; border-radius:10px; padding:12px 16px; font-size:13px; margin-bottom:16px; }
.reg-info { background:#eef6ff; color:#1d3557; border:1px solid #cfe2ff; border-radius:10px; padding:12px 16px; font-size:13px; margin-bottom:16px; }
.reg-handoff-banner { display:flex; align-items:center; gap:12px; background:#fff7e6; color:#7a4a00; border:1.5px solid #ffd479; border-radius:12px; padding:14px 16px; margin-bottom:20px; font-size:15px; font-weight:700; }
.reg-handoff-banner .reg-handoff-icon { width:34px; height:34px; border-radius:50%; background:#ffb703; color:#fff; display:flex; align-items:center; justify-content:center; font-size:16px; flex-shrink:0; }

.text-right { text-align:right; }
.d-flex { display:flex; }
.justify-content-between { justify-content:space-between; }
.ml-1 { margin-left:4px; }
.mr-2 { margin-right:8px; }

.reg-steps { list-style:none; display:flex; padding:0; margin:0 0 26px; }
.reg-steps li { flex:1; text-align:center; position:relative; font-size:12px; font-weight:600; color:#adb5bd; }
.reg-steps li:not(:last-child)::after { content:''; position:absolute; top:16px; left:56%; width:88%; height:2px; background:#e5e9f0; z-index:0; }
.reg-steps li.done:not(:last-child)::after { background:#1d3557; }
.reg-steps .step-circle { width:34px; height:34px; border-radius:50%; background:#e5e9f0; color:#8a9ab0; display:flex; align-items:center; justify-content:center; margin:0 auto 8px; position:relative; z-index:1; font-size:14px; transition:.2s; }
.reg-steps li.active .step-circle { background:#1d3557; color:#fff; }
.reg-steps li.done .step-circle   { background:#1d3557; color:#fff; }
.reg-steps li.active { color:#1d3557; }

.reg-step-pane { display:none; }
.reg-step-pane.active { display:block; }
.rf-next, .rf-prev { padding:11px 26px; border-radius:10px; font-size:14px; font-weight:700; cursor:pointer; border:none; transition:background .2s, transform .1s; }
.rf-next { background:#1d3557; color:#fff; }
.rf-next:hover { background:#457b9d; }
.rf-next:disabled { opacity:.7; cursor:not-allowed; }
.rf-prev { background:#f0f2f6; color:#555; }
.rf-prev:hover { background:#e5e9f0; }
.rf-next:active, .rf-prev:active { transform:scale(.98); }

.rf-refresh-bar { display:flex; justify-content:flex-end; margin:-12px 0 4px; }
.rf-refresh { margin-top:0; text-decoration:none; display:inline-block; }
.rf-top-actions { margin:0 0 22px; }
.rf-top-actions .rf-next { width:100%; }

.rf-section-title { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:1px; color:#457b9d; border-bottom:1px solid #e8eef5; padding-bottom:6px; margin:22px 0 14px; }
.rf-section-title:first-of-type { margin-top:0; }

.rf-row   { display:flex; gap:14px; flex-wrap:wrap; }
.rf-group { margin-bottom:14px; flex:1 1 100%; }
.rf-col-full { flex:1 1 100%; }
.rf-col-half { flex:1 1 calc(50% - 7px); min-width:140px; }

.rf-label { display:block; font-size:12px; font-weight:600; color:#555; margin-bottom:6px; }
.rf-req   { color:#e63946; }
.rf-hint  { font-size:11px; color:#aaa; margin-top:4px; display:block; }

.rf-input-wrap { position:relative; display:flex; align-items:center; border:1.5px solid #dde4ed; border-radius:10px; background:#f9fbff; transition:border-color .2s, box-shadow .2s; overflow:hidden; }
.rf-input-wrap:focus-within { border-color:#1d3557; box-shadow:0 0 0 3px rgba(29,53,87,.09); background:#fff; }
.rf-input-wrap-selected { border-color:#2ecc71; background:#f3fbf6; }
.rf-input-wrap-selected .rf-icon i { color:#2ecc71; }
.rf-icon { padding:0 12px; color:#a0aec0; font-size:14px; display:flex; align-items:center; flex-shrink:0; }
.rf-input { flex:1; border:none; background:transparent; padding:12px 10px 12px 0; font-size:14px; color:#222; outline:none; min-width:0; font-family:inherit; -webkit-appearance:none; appearance:none; }
.rf-input::placeholder { color:#bbb; }
.rf-input[readonly], .rf-input:disabled { color:#8a94a3; cursor:not-allowed; }
.rf-input-wrap.rf-locked { background:#f2f4f7; }

.rf-detail-list { margin-bottom:8px; }
.rf-detail-row { display:flex; align-items:baseline; gap:10px; padding:10px 2px; border-bottom:1px solid #eef1f5; font-size:14px; }
.rf-detail-row:last-child { border-bottom:none; }
.rf-detail-label { flex:0 0 110px; font-size:12px; font-weight:600; color:#555; }
.rf-detail-value { color:#222; word-break:break-word; }

.rf-search-results { position:absolute; left:0; right:0; top:100%; margin-top:4px; z-index:20; background:#fff; border:1.5px solid #dde4ed; border-radius:10px; box-shadow:0 8px 24px rgba(29,53,87,.14); max-height:220px; overflow-y:auto; }
.rf-search-item { display:flex; flex-direction:column; gap:1px; padding:9px 14px; cursor:pointer; border-bottom:1px solid #f0f2f6; font-size:13px; }
.rf-search-item:last-child { border-bottom:none; }
.rf-search-item:hover, .rf-search-item.active { background:#f4f8fc; }
.rf-search-item strong { color:#1d3557; font-weight:600; }
.rf-search-item small { color:#999; font-size:11px; }
.rf-search-empty { padding:10px 14px; font-size:12.5px; color:#999; }

.rf-select-wrap { position:relative; }
.rf-select { -webkit-appearance:none; appearance:none; cursor:pointer; padding-right:36px; }
.rf-caret  { position:absolute; right:12px; color:#a0aec0; font-size:12px; pointer-events:none; display:flex; align-items:center; }

.rf-textarea-wrap { align-items:flex-start; }
.rf-textarea { resize:vertical; padding:12px 10px 12px 0; min-height:60px; }

.rf-file-wrap { border:1.5px dashed #dde4ed; border-radius:10px; background:#f9fbff; transition:border-color .2s; overflow:hidden; }
.rf-file-wrap:hover { border-color:#457b9d; }
.rf-file-label { display:flex; align-items:center; gap:10px; padding:12px 16px; cursor:pointer; font-size:14px; color:#666; }
.rf-file-label i { color:#457b9d; font-size:18px; flex-shrink:0; }
.rf-file-input { display:none; }

.rf-photo-preview { position:relative; display:block; width:100%; max-width:100%; }
.rf-preview-img { width:100%; max-width:100%; height:auto; border-radius:12px; border:2px solid #dde4ed; display:block; }
.rf-preview-remove { position:absolute; top:8px; right:8px; background:rgba(230,57,70,.95); color:#fff; border:none; border-radius:50%; width:32px; height:32px; display:flex; align-items:center; justify-content:center; cursor:pointer; font-size:14px; transition:all .2s; box-shadow:0 2px 8px rgba(0,0,0,.3); }
.rf-preview-remove:hover { background:#e63946; transform:scale(1.1); }

.rf-camera-toggle { margin-top:8px; background:none; border:1.5px solid #457b9d; color:#457b9d; border-radius:8px; padding:7px 14px; font-size:13px; cursor:pointer; transition:all .2s; }
.rf-camera-toggle:hover { background:#457b9d; color:#fff; }

.rf-camera-live { position:relative; width:100%; aspect-ratio:4/3; max-height:60vh; border-radius:16px; overflow:hidden; border:3px solid #dde4ed; background:linear-gradient(155deg,#eef2f7,#e2e8f1); box-shadow:0 4px 14px rgba(29,53,87,.08); transition:border-color .25s, box-shadow .25s; }
.rf-camera-live.rf-face-detected { border-color:#2ecc71; box-shadow:0 0 0 4px rgba(46,204,113,.2), 0 4px 14px rgba(29,53,87,.08); }
.rf-camera-live video { width:100%; height:100%; object-fit:cover; display:block; position:relative; z-index:1; }
.rf-camera-live canvas.rf-camera-live-overlay { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; z-index:2; }
.rf-camera-live-placeholder { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:56px; color:#a8b7c9; z-index:0; }
.rf-camera-live-badge { position:absolute; left:0; right:0; bottom:0; background:rgba(21,41,69,.65); color:#fff; font-size:12px; text-align:center; padding:8px 6px; z-index:3; letter-spacing:.2px; }
.rf-attach-btn { display:block; width:100%; margin-top:14px; background:#1d3557; color:#fff; border:none; border-radius:10px; padding:14px 26px; font-size:15px; font-weight:700; letter-spacing:.2px; cursor:pointer; transition:background .2s, transform .1s; box-shadow:0 3px 10px rgba(29,53,87,.25); }
.rf-attach-btn:hover:not(:disabled) { background:#457b9d; }
.rf-attach-btn:active:not(:disabled) { transform:scale(.99); }
.rf-attach-btn:disabled { opacity:.45; cursor:not-allowed; box-shadow:none; }
.rf-camera-live-secondary { display:flex; justify-content:flex-start; margin-top:10px; }
.rf-camera-live-secondary .rf-camera-toggle { margin-top:0; }
.rf-camera-live video, .rf-camera-live canvas.rf-camera-live-overlay { transform-origin:center center; transform:scaleX(-1); }
.rf-cam-tools { display:flex; gap:8px; margin-top:10px; flex-wrap:wrap; }
.rf-cam-tool { background:#fff; border:1.5px solid #dde4ed; color:#1d3557; border-radius:8px; padding:7px 14px; font-size:13px; cursor:pointer; transition:all .2s; }
.rf-cam-tool:hover { border-color:#457b9d; }
.rf-cam-tool.active { background:#457b9d; border-color:#457b9d; color:#fff; }
.rf-cam-adjust { margin-top:10px; padding:12px 14px; border:1.5px solid #dde4ed; border-radius:10px; background:#f8fafc; display:grid; grid-template-columns:1fr 1fr; gap:10px 18px; }
.rf-cam-adjust[hidden] { display:none; }
.rf-cam-slider { display:flex; flex-direction:column; gap:4px; font-size:12px; color:#1d3557; font-weight:600; margin:0; }
.rf-cam-slider span { display:flex; align-items:center; gap:6px; }
.rf-cam-slider output { margin-left:auto; font-weight:400; color:#6b7c93; }
.rf-cam-slider input[type=range] { width:100%; accent-color:#457b9d; }
.rf-cam-adjust-actions { grid-column:1 / -1; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.rf-cam-adjust .rf-camera-toggle { margin-top:0; }
.rf-cam-save:not(:disabled) { background:#457b9d; color:#fff; }
.rf-cam-save:disabled { opacity:.5; cursor:default; }
.rf-cam-save:disabled:hover { background:none; color:#457b9d; }
.rf-cam-adjust-status { font-size:12px; color:#6b7c93; }
@media (max-width: 480px) { .rf-cam-adjust { grid-template-columns:1fr; } }

body.rf-camera-modal-active { overflow:hidden; }
.rf-camera-modal { display:none; position:fixed; inset:0; z-index:9999; background:rgba(0,0,0,.75); align-items:center; justify-content:center; padding:16px; }
.rf-camera-modal.rf-camera-modal-open { display:flex; }
.rf-camera-modal-inner { background:#fff; border-radius:14px; padding:16px; width:100%; max-width:340px; box-shadow:0 12px 40px rgba(0,0,0,.4); }
.rf-camera-modal-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; font-size:15px; font-weight:600; color:#333; }
.rf-camera-modal-close { border:none; background:#eef2f7; color:#555; width:30px; height:30px; border-radius:50%; cursor:pointer; font-size:14px; display:flex; align-items:center; justify-content:center; }
.rf-camera-modal-close:hover { background:#dde4ed; }
.rf-camera-box { width:100%; border-radius:12px; overflow:hidden; border:2px solid #dde4ed; background:#000; aspect-ratio:4/3; }
.rf-camera-box video { width:100%; height:100%; object-fit:cover; display:block; }
.rf-camera-actions { display:flex; gap:10px; margin-top:12px; flex-wrap:wrap; }
.rf-camera-btn { flex:1; border:none; border-radius:8px; padding:10px 16px; font-size:13px; cursor:pointer; transition:all .2s; }
.rf-camera-capture { background:#457b9d; color:#fff; }
.rf-camera-capture:hover { background:#33607e; }
.rf-camera-close { background:#eef2f7; color:#555; }
.rf-camera-close:hover { background:#dde4ed; }

.rf-submit { width:100%; padding:14px; background:#1d3557; color:#fff; border:none; border-radius:12px; font-size:16px; font-weight:700; cursor:pointer; letter-spacing:.5px; transition:background .2s, transform .1s; margin-top:18px; display:flex; align-items:center; justify-content:center; gap:8px; min-height:52px; }
.rf-submit:hover  { background:#457b9d; }
.rf-submit:active { transform:scale(.98); }
.rf-submit:disabled { opacity:.7; cursor:not-allowed; }

.reg-wait-spinner { width:64px; height:64px; border-radius:50%; border:5px solid #e5e9f0; border-top-color:#1d3557; margin:0 auto 18px; animation:regspin 1s linear infinite; }
@keyframes regspin { to { transform:rotate(360deg); } }

.idcard { max-width:380px; margin:0 auto; border-radius:16px; overflow:hidden; border:1.5px solid #dde4ed; box-shadow:0 6px 20px rgba(0,0,0,.1); }
.idcard-head { background:#1d3557; color:#fff; padding:14px 18px; display:flex; align-items:center; gap:10px; }
.idcard-head .idcard-logo { width:34px; height:34px; border-radius:50%; background:#fff; color:#1d3557; display:flex; align-items:center; justify-content:center; font-size:15px; flex-shrink:0; }
.idcard-head strong { font-size:15px; display:block; }
.idcard-head small { font-size:11px; color:#a8b8cf; }
.idcard-body { padding:20px 18px; text-align:center; }
.idcard-photo { width:100px; height:100px; border-radius:50%; object-fit:cover; border:3px solid #eef2ff; margin-bottom:10px; }
.idcard-name { font-size:18px; font-weight:700; color:#1d3557; margin:0 0 2px; }
.idcard-course { font-size:13px; color:#457b9d; margin:0 0 14px; }
.idcard-number { background:#f9fbff; border:1.5px dashed #dde4ed; border-radius:10px; padding:10px; margin-bottom:14px; }
.idcard-number span { font-size:10px; color:#888; text-transform:uppercase; letter-spacing:1px; display:block; }
.idcard-number strong { font-size:20px; color:#1d3557; letter-spacing:2px; }
.idcard-table { width:100%; text-align:left; font-size:12.5px; border-top:1px solid #eef1f5; padding-top:12px; }
.idcard-table td { padding:4px 0; color:#444; }
.idcard-table td:first-child { color:#888; width:42%; }

@media print {
  .reg-page { background:#fff; }
  .reg-header, .no-print { display:none !important; }
  .reg-wrap { padding:0; }
  .reg-card { box-shadow:none; padding:0; max-width:100%; }
}

.rf-add-course { display:inline-flex; align-items:center; gap:5px; margin-top:6px; background:none; border:none; padding:0; font-size:12px; font-weight:700; color:#457b9d; cursor:pointer; }
.rf-add-course:hover { color:#1d3557; text-decoration:underline; }
.rf-date-quick { display:flex; gap:14px; }

.rf-modal-overlay { display:none; position:fixed; inset:0; z-index:9999; background:rgba(0,0,0,.55); align-items:center; justify-content:center; padding:16px; }
.rf-modal-overlay.rf-modal-open { display:flex; }
body.rf-modal-active { overflow:hidden; }
.rf-modal { background:#fff; border-radius:16px; padding:22px 22px 20px; width:100%; max-width:460px; max-height:90vh; overflow-y:auto; box-shadow:0 12px 40px rgba(0,0,0,.4); }
.rf-modal-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.rf-modal-header h4 { margin:0; font-size:16px; font-weight:700; color:#1d3557; }
.rf-modal-close { border:none; background:#eef2f7; color:#555; width:30px; height:30px; border-radius:50%; cursor:pointer; font-size:14px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.rf-modal-close:hover { background:#dde4ed; }
.rf-modal-error { background:#fdecea; color:#b91c1c; border:1px solid #f5c2c7; border-radius:8px; padding:8px 12px; font-size:12.5px; margin-bottom:12px; display:none; }

@media (max-width:480px) {
  .reg-card  { padding:22px 16px 20px; border-radius:16px; }
  .reg-title { font-size:19px; }
  .rf-col-half { flex:1 1 100%; }
  .rf-input  { font-size:16px; }
}

.rf-upload-progress { height:8px; border-radius:6px; background:#eef1f5; overflow:hidden; margin-bottom:6px; }
.rf-upload-progress-bar { height:100%; width:0%; background:#457b9d; transition:width .15s ease; }

.reg-loadbar { position:fixed; top:0; left:0; height:3px; width:0; background:#a8dadc; z-index:99999; opacity:0; transition:width .35s ease, opacity .2s ease; pointer-events:none; }
.reg-loadbar.reg-loadbar-active { opacity:1; width:75%; }

/* ── Dedicated tablet (installed PWA, touch) ─────────────────────────
   800x1202 portrait / 1280x722 landscape, pointer:coarse. The card is
   already single-column and centred; this just enforces no sideways
   scroll and finger-sized controls. */
html, body { overflow-x: hidden; }

@media (pointer: coarse) {
  .rf-input, .rf-select          { padding-top: 14px; padding-bottom: 14px; font-size: 15px; }
  .rf-next, .rf-prev             { padding: 14px 28px; min-height: 48px; }
  .rf-camera-toggle, .rf-camera-btn { min-height: 44px; }
  .ks-result-item               { padding: 14px 16px; }
}

/* Installed-PWA landscape on the short 722px-tall viewport: tighten the
   outer chrome. Gated to standalone so laptop browsers are unaffected. */
@media all and (display-mode: standalone) and (orientation: landscape) and (max-height: 800px) {
  .reg-header { padding: 8px 24px; }
  .reg-wrap   { padding: 14px 16px 24px; }
  .reg-card   { padding: 20px 24px; }
  .reg-steps  { margin-bottom: 16px; }
}

/* One form field per line on phones and the tablet (portrait 800 and
   landscape 1280). Laptops (>= 1366) and desktop keep the side-by-side
   half-width pairs. Applies to the registration wizard and the kiosk
   "Change Timing" page (both use .rf-col-half). */
@media (max-width: 1300px) {
  .rf-col-half { flex: 1 1 100%; }
}
