/* ============================================================
   UV Campus Connect - STUDENT TEST PORTAL (student/*.php)
   ============================================================ */
:root{
  --st-ink:#0f172a; --st-muted:#64748b; --st-line:#e2e8f0; --st-soft:#f1f5f9;
  --st-brand:#0d9488; --st-brand2:#059669; --st-deep:#064e3b;
  --st-ok:#16a34a; --st-bad:#dc2626; --st-warn:#d97706; --st-mark:#7c3aed; --st-blue:#2563eb;
}
*{box-sizing:border-box;}
body{font-family:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;color:var(--st-ink);}
.stu-body{background:#f4f7f6;min-height:100vh;display:flex;flex-direction:column;}
.stu-body > main{flex:1 0 auto;}
a{color:var(--st-brand);}
.btn-st{background:linear-gradient(90deg,var(--st-brand),var(--st-brand2));color:#fff;border:0;font-weight:600;}
.btn-st:hover,.btn-st:focus{color:#fff;filter:brightness(.95);}
.btn-st:disabled{opacity:.55;color:#fff;}

/* top bar */
.stu-nav{background:#fff;border-bottom:1px solid var(--st-line);padding:10px 0;position:sticky;top:0;z-index:50;}
.stu-brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--st-ink);}
.stu-brand img{height:40px;width:auto;}
.stu-brand span{font-weight:700;font-size:14px;color:var(--st-deep);border-left:1px solid var(--st-line);padding-left:10px;}
@media(max-width:480px){.stu-brand span{display:none;}}
.stu-me{background:none;border:1px solid var(--st-line);border-radius:30px;padding:3px 10px 3px 3px;display:flex;align-items:center;gap:8px;font-size:13.5px;font-weight:600;color:var(--st-ink);}
.stu-av{width:30px;height:30px;border-radius:50%;background:var(--st-brand);color:#fff;display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:13px;}
.stu-foot{text-align:center;color:var(--st-muted);font-size:12.5px;padding:22px 0;}

/* login */
.stu-auth{min-height:calc(100vh - 140px);display:flex;align-items:center;justify-content:center;padding:30px 16px;}
.stu-auth-card{width:100%;max-width:920px;background:#fff;border-radius:20px;overflow:hidden;box-shadow:0 20px 50px -20px rgba(6,78,59,.35);display:grid;grid-template-columns:1fr 1fr;}
.stu-auth-side{background:linear-gradient(160deg,var(--st-deep),var(--st-brand));color:#e6fffa;padding:38px 34px;position:relative;}
.stu-auth-side h2{color:#fff;font-weight:800;font-size:27px;line-height:1.2;margin:10px 0 14px;}
.stu-auth-side .kick{font-size:11.5px;letter-spacing:1.2px;text-transform:uppercase;font-weight:700;color:#99f6e4;}
.stu-auth-side ul{list-style:none;padding:0;margin:22px 0 0;}
.stu-auth-side li{padding:7px 0 7px 28px;position:relative;font-size:14px;}
.stu-auth-side li i{position:absolute;left:0;top:7px;color:#5eead4;}
.stu-auth-form{padding:38px 34px;}
.stu-auth-form h3{font-weight:800;font-size:22px;margin-bottom:4px;}
.stu-auth-form .form-control{padding:11px 14px;border-radius:10px;}
.stu-auth-form label{font-size:13px;font-weight:600;color:#334155;}
@media(max-width:767px){.stu-auth-card{grid-template-columns:1fr;}.stu-auth-side{padding:26px 24px;}.stu-auth-side ul{display:none;}.stu-auth-form{padding:26px 24px;}}

/* dashboard */
.stu-hello{background:linear-gradient(120deg,var(--st-deep),var(--st-brand));color:#fff;border-radius:18px;padding:24px 26px;margin:24px 0 20px;display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;}
.stu-hello h1{font-size:22px;font-weight:800;margin:0;}
.stu-hello p{margin:4px 0 0;color:#ccfbf1;font-size:13.5px;}
.stu-hello .stu-mini{display:flex;gap:10px;}
.stu-hello .stu-mini div{background:rgba(255,255,255,.12);border-radius:12px;padding:8px 16px;text-align:center;min-width:86px;}
.stu-hello .stu-mini b{display:block;font-size:20px;}
.stu-hello .stu-mini span{font-size:11.5px;color:#ccfbf1;}
.stu-sec{font-size:13px;font-weight:800;letter-spacing:.8px;text-transform:uppercase;color:#334155;margin:26px 0 12px;display:flex;align-items:center;gap:8px;}
.stu-sec .n{background:var(--st-soft);border-radius:20px;padding:1px 9px;font-size:11.5px;color:var(--st-muted);}
.stu-tcard{background:#fff;border:1px solid var(--st-line);border-radius:16px;padding:18px;height:100%;display:flex;flex-direction:column;transition:box-shadow .15s, transform .15s;}
.stu-tcard:hover{box-shadow:0 10px 26px -14px rgba(15,23,42,.3);transform:translateY(-1px);}
.stu-tcard .tt{font-weight:700;font-size:16px;margin:8px 0 4px;line-height:1.3;}
.stu-tcard .meta{font-size:12.5px;color:var(--st-muted);display:flex;flex-wrap:wrap;gap:4px 14px;margin-bottom:12px;}
.stu-tcard .foot{margin-top:auto;display:flex;align-items:center;justify-content:space-between;gap:8px;}
.stu-chip{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:700;border-radius:20px;padding:3px 10px;}
.chip-mcq{background:#dbeafe;color:#1d4ed8;} .chip-qa{background:#fce7f3;color:#be185d;}
.chip-open{background:#dcfce7;color:#15803d;} .chip-up{background:#fef3c7;color:#b45309;} .chip-miss{background:#f1f5f9;color:#64748b;}
.chip-prog{background:#ede9fe;color:#6d28d9;} .chip-pass{background:#dcfce7;color:#15803d;} .chip-fail{background:#fee2e2;color:#b91c1c;}
.stu-empty{background:#fff;border:1px dashed #cbd5e1;border-radius:16px;padding:34px;text-align:center;color:var(--st-muted);}
.stu-score-pill{font-weight:800;font-size:15px;}

/* instructions page */
.stu-panel{background:#fff;border:1px solid var(--st-line);border-radius:18px;padding:24px;}
.stu-facts{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:16px 0;}
.stu-facts div{background:var(--st-soft);border-radius:12px;padding:12px;text-align:center;}
.stu-facts b{display:block;font-size:20px;}
.stu-facts span{font-size:12px;color:var(--st-muted);}
@media(max-width:575px){.stu-facts{grid-template-columns:repeat(2,1fr);}}
.stu-rules li{margin-bottom:7px;font-size:14px;}
.stu-legend{display:flex;flex-wrap:wrap;gap:8px 16px;font-size:12.5px;color:#475569;}
.stu-legend i{display:inline-block;width:14px;height:14px;border-radius:4px;vertical-align:-2px;margin-right:4px;}

/* ================= EXAM SCREEN ================= */
.stu-exam{background:#eef2f1;height:100vh;overflow:hidden;}
.ex-wrap{display:flex;flex-direction:column;height:100vh;}
.ex-top{background:#fff;border-bottom:1px solid var(--st-line);padding:9px 16px;display:flex;align-items:center;justify-content:space-between;gap:12px;flex:0 0 auto;}
.ex-top .ttl{min-width:0;}
.ex-top .ttl b{display:block;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.ex-top .ttl small{color:var(--st-muted);font-size:12px;}
.ex-timer{display:flex;align-items:center;gap:7px;background:var(--st-deep);color:#fff;border-radius:10px;padding:7px 14px;font-weight:800;font-size:18px;font-variant-numeric:tabular-nums;letter-spacing:.5px;}
.ex-timer.warn{background:var(--st-warn);}
.ex-timer.danger{background:var(--st-bad);animation:exPulse 1s infinite;}
@keyframes exPulse{50%{opacity:.75;}}
.ex-body{flex:1 1 auto;display:flex;min-height:0;}
.ex-main{flex:1 1 auto;overflow-y:auto;padding:20px;}
.ex-side{flex:0 0 300px;background:#fff;border-left:1px solid var(--st-line);display:flex;flex-direction:column;min-height:0;}
.ex-card{background:#fff;border-radius:16px;border:1px solid var(--st-line);max-width:880px;margin:0 auto;}
.ex-qhead{display:flex;justify-content:space-between;align-items:center;padding:14px 20px;border-bottom:1px solid var(--st-line);gap:10px;flex-wrap:wrap;}
.ex-qno{font-weight:800;font-size:15px;}
.ex-qbody{padding:20px;}
.ex-qtext{font-size:16.5px;line-height:1.6;white-space:pre-wrap;font-weight:500;margin-bottom:18px;user-select:none;-webkit-user-select:none;}
.ex-opt{display:flex;align-items:flex-start;gap:12px;border:2px solid var(--st-line);border-radius:12px;padding:12px 14px;margin-bottom:10px;cursor:pointer;transition:border-color .12s, background .12s;font-size:15px;user-select:none;-webkit-user-select:none;}
.ex-opt:hover{border-color:#99f6e4;background:#f0fdfa;}
.ex-opt .lt{flex:0 0 30px;height:30px;border-radius:50%;border:2px solid #cbd5e1;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:13px;color:#475569;}
.ex-opt .tx{padding-top:3px;white-space:pre-wrap;}
.ex-opt.on{border-color:var(--st-brand);background:#f0fdfa;}
.ex-opt.on .lt{background:var(--st-brand);border-color:var(--st-brand);color:#fff;}
.ex-ta{width:100%;min-height:220px;border:2px solid var(--st-line);border-radius:12px;padding:14px;font-size:15px;line-height:1.6;resize:vertical;}
.ex-ta:focus{outline:none;border-color:var(--st-brand);}
.ex-tainfo{display:flex;justify-content:space-between;font-size:12px;color:var(--st-muted);margin-top:6px;}
.ex-actions{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;padding:14px 20px;border-top:1px solid var(--st-line);background:#fafcfc;border-radius:0 0 16px 16px;}
.ex-actions .btn{font-weight:600;font-size:14px;}
.ex-save{font-size:12px;color:var(--st-muted);}
.ex-save.err{color:var(--st-bad);font-weight:600;}
.ex-me{padding:14px 16px;border-bottom:1px solid var(--st-line);display:flex;gap:10px;align-items:center;}
.ex-me b{font-size:13.5px;display:block;}
.ex-me small{color:var(--st-muted);font-size:12px;}
.ex-counts{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:12px 16px;font-size:12px;border-bottom:1px solid var(--st-line);}
.ex-counts span{display:flex;align-items:center;gap:6px;}
.ex-pal{padding:14px 16px;overflow-y:auto;flex:1 1 auto;}
.ex-pal h6{font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.6px;color:#475569;}
.ex-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;}
.ex-pb{position:relative;height:40px;border-radius:9px;border:1px solid #cbd5e1;background:#fff;font-weight:700;font-size:13.5px;color:#334155;cursor:pointer;}
.ex-pb.nv{background:#fff;}
.ex-pb.na{background:#fee2e2;border-color:#fca5a5;color:#b91c1c;}
.ex-pb.an{background:var(--st-ok);border-color:var(--st-ok);color:#fff;}
.ex-pb.mk{background:var(--st-mark);border-color:var(--st-mark);color:#fff;}
.ex-pb.am{background:var(--st-mark);border-color:var(--st-mark);color:#fff;}
.ex-pb.am::after{content:'';position:absolute;right:4px;bottom:4px;width:9px;height:9px;border-radius:50%;background:#4ade80;border:1.5px solid #fff;}
.ex-pb.cur{outline:3px solid #fbbf24;outline-offset:1px;}
.sw{display:inline-block;width:14px;height:14px;border-radius:4px;border:1px solid #cbd5e1;}
.sw.nv{background:#fff;} .sw.na{background:#fee2e2;border-color:#fca5a5;} .sw.an{background:var(--st-ok);border-color:var(--st-ok);} .sw.mk{background:var(--st-mark);border-color:var(--st-mark);}
.ex-side-foot{padding:12px 16px;border-top:1px solid var(--st-line);}
.ex-palbtn{display:none;}
@media(max-width:991px){
  .ex-side{position:fixed;right:0;top:0;bottom:0;width:300px;z-index:60;transform:translateX(100%);transition:transform .2s;box-shadow:-10px 0 30px rgba(0,0,0,.15);}
  .ex-side.open{transform:none;}
  .ex-palbtn{display:inline-flex;}
  .ex-main{padding:12px;}
  .ex-qtext{font-size:15.5px;}
}
.ex-shade{display:none;position:fixed;inset:0;background:rgba(15,23,42,.35);z-index:55;}
.ex-shade.on{display:block;}
.ex-busy{position:fixed;inset:0;background:rgba(255,255,255,.92);z-index:2000;display:none;align-items:center;justify-content:center;flex-direction:column;gap:14px;text-align:center;padding:20px;}
.ex-busy.on{display:flex;}
.ex-busy .bot{width:70px;height:70px;border-radius:50%;background:linear-gradient(135deg,var(--st-brand),var(--st-mark));display:flex;align-items:center;justify-content:center;color:#fff;font-size:32px;animation:exPulse 1.2s infinite;}
.ex-warnbar{background:#fef3c7;color:#92400e;font-size:13px;padding:7px 16px;text-align:center;display:none;}
.ex-warnbar.on{display:block;}

/* ================= RESULT ================= */
.rs-hero{background:#fff;border:1px solid var(--st-line);border-radius:20px;padding:26px;margin:24px 0 18px;display:grid;grid-template-columns:auto 1fr;gap:26px;align-items:center;}
@media(max-width:640px){.rs-hero{grid-template-columns:1fr;text-align:center;}}
.rs-ring{width:150px;height:150px;border-radius:50%;display:flex;align-items:center;justify-content:center;margin:0 auto;}
.rs-ring .in{width:118px;height:118px;border-radius:50%;background:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;}
.rs-ring b{font-size:30px;font-weight:800;line-height:1;}
.rs-ring span{font-size:12px;color:var(--st-muted);margin-top:4px;}
.rs-hero h1{font-size:24px;font-weight:800;margin:6px 0 4px;}
.rs-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-top:16px;}
.rs-stats div{border-radius:12px;padding:10px;text-align:center;background:var(--st-soft);}
.rs-stats b{display:block;font-size:20px;}
.rs-stats span{font-size:12px;color:var(--st-muted);}
.rs-stats .g{background:#dcfce7;} .rs-stats .g b{color:#15803d;}
.rs-stats .r{background:#fee2e2;} .rs-stats .r b{color:#b91c1c;}
@media(max-width:575px){.rs-stats{grid-template-columns:repeat(2,1fr);}}
.rs-q{background:#fff;border:1px solid var(--st-line);border-left:5px solid #cbd5e1;border-radius:14px;padding:16px 18px;margin-bottom:12px;}
.rs-q.ok{border-left-color:var(--st-ok);} .rs-q.bad{border-left-color:var(--st-bad);} .rs-q.skip{border-left-color:#94a3b8;}
.rs-q .qh{display:flex;justify-content:space-between;gap:10px;align-items:flex-start;margin-bottom:8px;}
.rs-q .qt{font-weight:600;white-space:pre-wrap;}
.rs-o{display:flex;gap:10px;align-items:flex-start;padding:7px 10px;border-radius:9px;font-size:14px;margin-bottom:4px;}
.rs-o .lt{flex:0 0 24px;height:24px;border-radius:50%;background:#e2e8f0;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:12px;}
.rs-o.right{background:#dcfce7;} .rs-o.right .lt{background:var(--st-ok);color:#fff;}
.rs-o.wrong{background:#fee2e2;} .rs-o.wrong .lt{background:var(--st-bad);color:#fff;}
.rs-o .tag{margin-left:auto;font-size:11.5px;font-weight:700;white-space:nowrap;}
.rs-exp{background:#f8fafc;border-radius:9px;padding:9px 12px;font-size:13.5px;color:#334155;margin-top:8px;white-space:pre-wrap;}
.rs-filter .btn{font-size:13px;font-weight:600;}
@media print{.stu-nav,.stu-foot,.no-print{display:none!important;}body{background:#fff;}}
