/* =====================================================
   Bright Top Exam System v9.0 — Front CSS
   ===================================================== */
body.bte-exam-active{overflow:hidden !important}
.bte-wrap{min-height:80vh;display:flex;align-items:center;justify-content:center;padding:20px;background:#f0f4ff}
.bte-card{background:#fff;border-radius:20px;padding:36px;max-width:500px;width:100%;box-shadow:0 8px 40px rgba(30,45,107,.1)}
.bte-form .bte-field{margin-bottom:18px}
.bte-form label{display:block;font-weight:700;color:#1E2D6B;font-size:14px;margin-bottom:6px}
.bte-form input,.bte-form select,.bte-form textarea{width:100%;box-sizing:border-box;padding:11px 14px;border:1.5px solid #dde3f0;border-radius:10px;font-size:15px;color:#1E2D6B;font-family:inherit;transition:border-color .15s}
.bte-form input:focus,.bte-form select:focus,.bte-form textarea:focus{outline:none;border-color:#1E2D6B;box-shadow:0 0 0 3px rgba(30,45,107,.08)}
.bte-req{color:#ef4444;margin-right:2px}
.bte-alert{padding:12px 16px;border-radius:10px;margin-bottom:18px;font-size:14px}
.bte-alert-warn{background:#fff9f0;border:1px solid #fde68a;color:#92400e}
.bte-alert-err{background:#fff1f2;border:1px solid #fecdd3;color:#be123c}
.bte-alert-ok{background:#f0fdf4;border:1px solid #86efac;color:#166534}
.bte-btn-primary{display:block;width:100%;padding:14px;background:#1E2D6B;color:#fff;border:none;border-radius:12px;font-size:16px;font-weight:700;cursor:pointer;font-family:inherit;transition:background .15s;margin-top:8px}
.bte-btn-primary:hover{background:#26388a}
.bte-logo-wrap{text-align:center;margin-bottom:24px}
.bte-logo-wrap img{height:70px;border-radius:8px}
.bte-logo-sub{font-size:12px;color:#64748b;margin-top:6px}

/* ── Fullscreen exam layout ── */
.bte-fullscreen-exam{position:fixed;inset:0;background:#f0f4ff;z-index:9999;overflow-y:auto;display:flex;flex-direction:column}
#bte-exam-hdr{background:#1E2D6B;color:#fff;padding:10px 20px;display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:100;flex-shrink:0}
.bte-hdr-left{display:flex;align-items:center;gap:14px}
.bte-hdr-logo{height:42px;border-radius:6px}
.bte-hdr-info strong{font-size:15px;display:block}
.bte-hdr-info small{font-size:12px;color:rgba(255,255,255,.6)}
#bte-timer-wrap{text-align:center}
.bte-timer-label{font-size:10px;color:rgba(255,255,255,.6);margin-bottom:2px}
#bte-timer{font-size:28px;font-weight:800;letter-spacing:2px;color:#fff;font-variant-numeric:tabular-nums}
.bte-timer-red{color:#fbbf24 !important}
.bte-timer-critical{color:#ef4444 !important;animation:bte-blink .8s infinite}
@keyframes bte-blink{50%{opacity:.4}}

/* ── Exam body layout ── */
#bte-exam-body{display:flex;flex:1;overflow:hidden}
#bte-q-nav-panel{width:220px;background:#fff;border-left:1px solid #e5e7eb;padding:16px;overflow-y:auto;flex-shrink:0}
#bte-q-nav-panel h4{color:#1E2D6B;font-size:13px;font-weight:700;margin:0 0 12px}
#bte-q-nav{display:flex;flex-wrap:wrap;gap:6px}
.bte-nav-btn{width:38px;height:38px;border-radius:8px;border:1.5px solid #dde3f0;background:#fff;color:#374151;font-size:13px;font-weight:600;cursor:pointer;transition:all .15s;font-family:inherit}
.bte-nav-btn:hover{border-color:#1E2D6B;color:#1E2D6B}
.bte-nav-btn.bte-nav-answered{background:#1E2D6B;border-color:#1E2D6B;color:#fff}
.bte-nav-btn.bte-nav-current{border-color:#B8860B;color:#B8860B;font-weight:800}
.bte-nav-btn.bte-nav-answered.bte-nav-current{background:#B8860B;border-color:#B8860B;color:#fff}

/* ── Nav stats ── */
.bte-nav-stats{font-size:12px;color:#64748b;margin-bottom:12px;background:#f8faff;border-radius:8px;padding:8px 10px}

#bte-q-container{flex:1;overflow-y:auto;padding:24px}

/* ── Question card ── */
.bte-qcard{background:#fff;border-radius:14px;padding:24px;margin-bottom:20px;box-shadow:0 2px 8px rgba(30,45,107,.06);border:2px solid transparent;transition:border-color .2s}
.bte-qcard.bte-qcard-answered{border-color:#22c55e}
.bte-qhead{display:flex;gap:14px;margin-bottom:16px;align-items:flex-start}
.bte-qnum{background:#1E2D6B;color:#fff;width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;flex-shrink:0}
.bte-qtext{font-size:16px;color:#1E2D6B;font-weight:600;line-height:1.6;flex:1}
.bte-qimg{max-width:100%;border-radius:8px;margin-bottom:12px;display:block}
.bte-qtype-label{font-size:11px;background:#EEF1F8;color:#1E2D6B;padding:2px 10px;border-radius:10px;margin-bottom:14px;display:inline-block;font-weight:600}

/* ── Multiple choice options ── */
.bte-opts{display:flex;flex-direction:column;gap:8px}
.bte-opt{display:flex;align-items:center;gap:12px;padding:12px 16px;border:1.5px solid #dde3f0;border-radius:10px;cursor:pointer;transition:all .15s}
.bte-opt:hover{border-color:#1E2D6B;background:#f8faff}
.bte-opt input{display:none}
.bte-opt-ltr{background:#EEF1F8;color:#1E2D6B;width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;flex-shrink:0}
.bte-opt-text{flex:1;font-size:15px;color:#374151;direction:rtl}
.bte-opt input:checked ~ * { color:#1E2D6B }
.bte-opt:has(input:checked){border-color:#1E2D6B;background:#EEF1F8}
.bte-opt:has(input:checked) .bte-opt-ltr{background:#1E2D6B;color:#fff}

/* ── True/False ── */
.bte-tf-opts{display:flex;gap:12px}
.bte-tf-opt{flex:1;padding:16px;border:2px solid #dde3f0;border-radius:12px;cursor:pointer;text-align:center;font-size:16px;font-weight:700;transition:all .15s}
.bte-tf-opt:hover{border-color:#1E2D6B}
.bte-tf-opt input{display:none}
.bte-tf-opt:has(input:checked){border-color:#1E2D6B;background:#EEF1F8;color:#1E2D6B}
.bte-tf-true:has(input:checked){background:#f0fdf4;border-color:#22c55e;color:#166534}
.bte-tf-false:has(input:checked){background:#fff1f2;border-color:#ef4444;color:#dc2626}

/* ── Short answer / Essay ── */
.bte-short-input{width:100%;padding:12px 14px;border:1.5px solid #dde3f0;border-radius:10px;font-size:15px;font-family:inherit;color:#374151;box-sizing:border-box;resize:vertical}
.bte-short-input:focus{outline:none;border-color:#1E2D6B}

/* ── Multiple select ── */
.bte-ms-opt{display:flex;align-items:center;gap:12px;padding:12px 16px;border:1.5px solid #dde3f0;border-radius:10px;cursor:pointer;transition:all .15s;margin-bottom:8px}
.bte-ms-opt:hover{border-color:#1E2D6B;background:#f8faff}
.bte-ms-opt:has(input:checked){border-color:#B8860B;background:#fef9ee}
.bte-ms-opt input[type=checkbox]{width:18px;height:18px;accent-color:#1E2D6B}
.bte-ms-opt-text{font-size:15px;color:#374151}

/* ── Fill blank ── */
.bte-fill-blank-input{border:none;border-bottom:2px solid #1E2D6B;padding:4px 8px;font-size:15px;color:#1E2D6B;font-weight:600;background:transparent;min-width:120px;text-align:center;font-family:inherit}
.bte-fill-blank-input:focus{outline:none;border-bottom-color:#B8860B}

/* ── Matching ── */
.bte-match-pair{display:flex;align-items:center;gap:12px;margin-bottom:10px}
.bte-match-left{flex:1;padding:10px 14px;background:#EEF1F8;border-radius:8px;font-size:14px;font-weight:600;color:#1E2D6B}
.bte-match-arrow{color:#94a3b8;font-size:20px}
.bte-match-select{flex:1;padding:10px 14px;border:1.5px solid #dde3f0;border-radius:8px;font-size:14px;color:#374151;font-family:inherit}
.bte-match-select:focus{outline:none;border-color:#1E2D6B}

/* ── Ordering ── */
.bte-order-list{display:flex;flex-direction:column;gap:8px}
.bte-order-item{display:flex;align-items:center;gap:12px;padding:12px 16px;background:#fff;border:1.5px solid #dde3f0;border-radius:10px;cursor:grab;user-select:none;transition:all .15s}
.bte-order-item:active{cursor:grabbing;box-shadow:0 4px 12px rgba(0,0,0,.1);z-index:10}
.bte-order-item.bte-dragging{opacity:.5;border-color:#1E2D6B}
.bte-order-item.bte-drag-over{border-color:#B8860B;background:#fef9ee}
.bte-order-handle{color:#94a3b8;font-size:20px;cursor:grab}
.bte-order-num{background:#EEF1F8;color:#1E2D6B;width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;flex-shrink:0}
.bte-order-text{flex:1;font-size:15px;color:#374151}

/* ── File / Image upload ── */
.bte-file-zone{border:2px dashed #dde3f0;border-radius:12px;padding:24px;text-align:center;transition:all .15s}
.bte-file-zone:hover{border-color:#1E2D6B;background:#f8faff}
.bte-file-zone .bte-file-icon{font-size:36px;display:block;margin-bottom:8px}
.bte-file-zone label{cursor:pointer;font-size:14px;color:#1E2D6B;font-weight:600}
.bte-file-zone input[type=file]{display:none}
.bte-file-preview{margin-top:12px;font-size:13px;color:#64748b}
.bte-file-preview a{color:#1E2D6B;font-weight:600}
.bte-upload-progress{background:#dde3f0;border-radius:4px;height:6px;margin-top:8px}
.bte-upload-progress-inner{height:100%;background:#1E2D6B;border-radius:4px;width:0;transition:width .3s}

/* ── Submit zone ── */
.bte-submit-zone{padding:24px;background:#fff;border-radius:14px;margin-top:16px;text-align:center}
#bte-progress-bar-wrap{background:#e5e7eb;border-radius:8px;height:12px;margin-bottom:8px;overflow:hidden}
#bte-progress-bar{height:100%;background:linear-gradient(90deg,#1E2D6B,#B8860B);border-radius:8px;width:0;transition:width .4s}
#bte-progress-text{font-size:13px;color:#64748b;margin-bottom:16px}
.bte-btn-submit{background:#1E2D6B;color:#fff;border:none;border-radius:12px;padding:16px 40px;font-size:17px;font-weight:700;cursor:pointer;font-family:inherit;transition:all .2s;opacity:.5}
.bte-btn-submit:disabled{cursor:not-allowed}
.bte-btn-submit.bte-btn-ready{opacity:1;background:#B8860B;box-shadow:0 4px 16px rgba(184,134,11,.3)}
.bte-btn-submit.bte-btn-ready:hover{background:#a07509}

/* ── Camera ── */
#bte-cam-screen{position:fixed;inset:0;background:#f0f4ff;z-index:10000;display:flex;align-items:center;justify-content:center}
.bte-cam-prompt-card{background:#fff;border-radius:20px;padding:40px;max-width:480px;width:90%;text-align:center;box-shadow:0 8px 40px rgba(30,45,107,.15)}
.bte-cam-icon{font-size:64px;margin-bottom:16px}
.bte-exam-meta{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin:16px 0}
.bte-exam-meta span{background:#EEF1F8;color:#1E2D6B;padding:6px 14px;border-radius:20px;font-size:13px;font-weight:600}
.bte-btn-lg{padding:16px 40px;font-size:18px;font-family:inherit}
#bte-cam-float{position:fixed;bottom:20px;left:20px;z-index:200;width:160px;background:#1E2D6B;border-radius:12px;overflow:hidden;box-shadow:0 4px 16px rgba(0,0,0,.3)}
#bte-cam-drag-handle{color:#B8860B;font-size:12px;font-weight:700;padding:6px 10px;cursor:move;user-select:none;background:rgba(0,0,0,.2)}
#bte-cam-float video{width:100%;display:block}
.bte-cam-live-badge{background:rgba(0,0,0,.5);color:#fff;font-size:10px;padding:4px 8px;display:flex;align-items:center;gap:6px}
.bte-live-dot{width:8px;height:8px;background:#ef4444;border-radius:50%;animation:bte-pulse 1.5s infinite}
@keyframes bte-pulse{50%{opacity:.3}}

/* ── Modals & Overlays ── */
.bte-modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.6);z-index:10001;display:none;align-items:center;justify-content:center;padding:20px}
.bte-modal-box{background:#fff;border-radius:20px;padding:32px;max-width:500px;width:100%;text-align:center;box-shadow:0 16px 60px rgba(0,0,0,.2)}
.bte-modal-box h2{color:#1E2D6B;margin:0 0 16px;font-size:20px}
.bte-confirm-stats{display:flex;gap:16px;justify-content:center;margin:20px 0}
.bte-confirm-stat{background:#f8faff;border-radius:12px;padding:16px 24px;text-align:center}
.bte-confirm-stat-num{font-size:32px;font-weight:800;color:#1E2D6B}
.bte-confirm-stat-label{font-size:12px;color:#64748b}
.bte-confirm-stat.danger .bte-confirm-stat-num{color:#ef4444}
.bte-unanswered-list{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin:12px 0}
.bte-unanswered-num{background:#fff1f2;color:#be123c;width:36px;height:36px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;cursor:pointer;border:none}
.bte-unanswered-num:hover{background:#fecdd3}
.bte-modal-btns{display:flex;gap:12px;justify-content:center;margin-top:20px}
.bte-btn-confirm{background:#1E2D6B;color:#fff;border:none;border-radius:10px;padding:12px 28px;font-size:15px;font-weight:700;cursor:pointer;font-family:inherit}
.bte-btn-cancel{background:#f1f5f9;color:#64748b;border:none;border-radius:10px;padding:12px 28px;font-size:15px;font-weight:600;cursor:pointer;font-family:inherit}
.bte-btn-confirm:hover{background:#26388a}
#bte-pause-overlay{position:fixed;inset:0;background:rgba(0,0,0,.85);z-index:10002;display:none;align-items:center;justify-content:center;flex-direction:column;color:#fff;text-align:center}
#bte-pause-overlay h2{font-size:32px;margin-bottom:12px}
#bte-pause-overlay p{font-size:16px;color:rgba(255,255,255,.7)}

/* ── Time warning toast ── */
#bte-time-warning{position:fixed;bottom:30px;right:30px;background:#ef4444;color:#fff;padding:14px 24px;border-radius:12px;font-size:15px;font-weight:700;z-index:500;transform:translateY(100px);opacity:0;transition:all .4s;box-shadow:0 4px 20px rgba(239,68,68,.4)}
#bte-time-warning.bte-warning-visible{transform:translateY(0);opacity:1}

/* ── Restore notice ── */
#bte-restore-notice{position:fixed;bottom:30px;left:30px;background:#1E2D6B;color:#fff;padding:12px 20px;border-radius:10px;font-size:14px;font-weight:600;z-index:500;display:none;box-shadow:0 4px 16px rgba(30,45,107,.3)}

/* ── Result cards ── */
.bte-result-card{max-width:560px}
.bte-result-icon{font-size:80px;text-align:center;margin-bottom:16px}
.bte-result-score{font-size:60px;font-weight:800;text-align:center;margin:12px 0}
.bte-result-pass{color:#22c55e}
.bte-result-fail{color:#ef4444}

/* ── Profile ── */
.bte-profile-wrap{max-width:900px;margin:0 auto;padding:20px}

/* ── Register ── */
.bte-reg-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}

@media(max-width:768px){
  .bte-reg-grid{grid-template-columns:1fr}
  #bte-q-nav-panel{display:none}
  #bte-exam-body{flex-direction:column}
  .bte-tf-opts{flex-direction:column}
  .bte-match-pair{flex-direction:column}
}
