/* =========================================================================
   PHARMA INSIGHTS ACADEMY — Shared Quiz Theme
   One stylesheet for EVERY test on the site: weekly mock tests, PYQ papers,
   model tests and the All Pharmacist PYQ Test Series topic pages.
   Built on the same tokens as css/site.css (Manrope + Inter, brand blue,
   teal and gold) so a test looks like part of the course, not a separate app.

   The quiz engine's class names and IDs are unchanged. The old purple token
   names (--purple, --paper, --gold …) are mapped onto the new palette below,
   so inline styles that reference them pick up the new theme automatically.
   ========================================================================= */

:root{
  /* brand (same values as css/site.css) */
  --brand:#1565C0; --brand-dark:#0D47A1; --brand-deep:#0A2F6B; --brand-light:#E3F2FD;
  --teal:#0C8479; --accent:#F5A623; --accent-light:#FEF1DC;
  --review:#7B1FA2; --review-light:#F3E5F5;
  --ink:#12202F; --grey:#55677A; --line:#E1EAF5; --bg:#F4F8FD;
  --green:#1E8E5A; --green-light:#E4F5EA; --red:#D32F2F; --red-light:#FBEAEA;
  --palette-grey:#E3E9F1;

  /* legacy token names used by the quiz markup + inline styles → new palette */
  --purple:var(--brand); --purple-dark:var(--brand-dark); --purple-light:var(--brand-light);
  --navy:var(--brand); --gold:var(--accent); --gold-light:var(--accent-light);
  --paper:var(--bg); --paper-line:var(--line);

  --font-display:'Manrope','Poppins',system-ui,sans-serif;
  --font-body:'Inter',system-ui,-apple-system,'Segoe UI',sans-serif;
  --font-mono:'JetBrains Mono',ui-monospace,monospace;
  --radius:16px; --radius-sm:10px;
  --shadow-sm:0 1px 2px rgba(13,50,110,.05), 0 4px 14px rgba(13,50,110,.06);
  --shadow-md:0 2px 4px rgba(13,50,110,.05), 0 14px 32px rgba(13,50,110,.11);
  --shadow-lg:0 4px 8px rgba(13,50,110,.06), 0 28px 64px rgba(13,50,110,.20);
  --ring:0 0 0 4px rgba(21,101,192,.18);
  --ease:cubic-bezier(.22,1,.36,1);
}

*,*::before,*::after{box-sizing:border-box;}
html,body{margin:0; padding:0;}
html{-webkit-text-size-adjust:100%; text-size-adjust:100%;}
body{
  background:var(--bg); color:var(--ink); font-family:var(--font-body); font-size:15px;
  min-height:100vh; line-height:1.6; -webkit-font-smoothing:antialiased;
  -webkit-user-select:none; user-select:none;
}
@media (prefers-reduced-motion: reduce){ *,*::before,*::after{animation-duration:.001ms !important; transition-duration:.001ms !important;} }
.hidden{display:none !important;}
a{color:var(--brand);}
:focus-visible{outline:3px solid rgba(21,101,192,.5); outline-offset:2px; border-radius:6px;}
h1,h2,h3{font-family:var(--font-display); letter-spacing:-.015em;}

/* ---------- Site header strip (start, gate and result screens) ---------- */
.q-header{position:sticky; top:0; z-index:40; background:rgba(255,255,255,.92); backdrop-filter:saturate(1.6) blur(14px); -webkit-backdrop-filter:saturate(1.6) blur(14px); border-bottom:1px solid var(--line);}
.q-header .in{max-width:1100px; margin:0 auto; padding:0 18px; height:62px; display:flex; align-items:center; justify-content:space-between; gap:12px;}
.q-brand{display:flex; align-items:center; gap:10px; text-decoration:none;}
.q-brand img{height:36px; width:auto; border-radius:8px;}
.q-brand span{font-family:var(--font-display); font-weight:800; color:var(--brand); font-size:1rem; letter-spacing:-.015em; white-space:nowrap;}
.q-brand span b{color:var(--teal);}
.q-links{display:flex; align-items:center; gap:4px;}
.q-links a{font-family:var(--font-display); font-weight:700; font-size:.86rem; color:var(--brand-dark); text-decoration:none; padding:8px 14px; border-radius:999px; white-space:nowrap; transition:background .2s ease;}
.q-links a:hover{background:var(--brand-light);}
.q-links a.q-cta{background:var(--brand-dark); color:#fff;}
.q-links a.q-cta:hover{background:var(--brand-deep);}
@media (max-width:560px){
  .q-brand span{display:none;}
  .q-links a{padding:8px 10px; font-size:.82rem;}
  .q-links a.q-hide-sm{display:none;}
}
/* the exam screen has its own top bar, so the site strip steps aside while a test runs */
body:has(#screen-exam:not(.hidden)) .q-header{display:none;}

/* ---------- Start / Gate / Result layout ---------- */
.wrap{max-width:800px; margin:0 auto; padding:28px 18px 64px;}
.q-backrow{display:flex; flex-wrap:wrap; gap:6px 18px; margin:0 0 18px; font-size:.84rem;}
.q-backrow a{color:var(--brand-dark); font-weight:700; text-decoration:none;}
.q-backrow a:hover{text-decoration:underline; text-underline-offset:3px;}

.masthead{text-align:center; padding:6px 0 22px; margin-bottom:22px; border-bottom:1px solid var(--line); position:relative;}
.masthead::after{content:""; position:absolute; left:50%; bottom:-2px; width:64px; height:3px; margin-left:-32px; border-radius:3px; background:linear-gradient(90deg,var(--brand),var(--teal));}
/* the old "PIA" seal now shows the academy logo */
.seal{
  position:relative; width:64px; height:64px; margin:0 auto 12px; border-radius:16px;
  background:#fff url('/images/logo.png') center/82% no-repeat;
  box-shadow:var(--shadow-sm); border:1px solid var(--line);
  display:flex; align-items:center; justify-content:center;
}
.seal span{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0);}
.masthead h1{font-size:clamp(1.45rem,1.15rem + 1.4vw,2rem); font-weight:800; color:var(--brand-dark); margin:0 0 6px; line-height:1.2; text-wrap:balance;}
.masthead .sub{display:inline-block; font-size:.74rem; color:var(--teal); text-transform:uppercase; letter-spacing:.14em; font-weight:800; font-family:var(--font-display);}

.card{background:#fff; border:1px solid var(--line); border-radius:var(--radius); padding:clamp(20px,3.5vw,28px); box-shadow:var(--shadow-sm); animation:qFade .4s var(--ease) both;}
.card + .card{margin-top:16px;}
#continue-banner{border-color:#BBD6F0; background:linear-gradient(135deg,#fff,var(--brand-light));}
#continue-banner h3{font-size:1.08rem; color:var(--brand-dark);}
h2.section-title{font-family:var(--font-display); font-size:1.08rem; font-weight:800; color:var(--brand-dark); margin:0 0 14px; padding-left:12px; border-left:4px solid var(--accent); line-height:1.35;}
.topics-list{margin:0; padding-left:20px; font-size:.94rem; line-height:1.65;}
.topics-list li{margin-bottom:8px;}
.topics-list li::marker{color:var(--teal);}
.info-list{margin:0; padding-left:20px; font-size:.92rem; color:var(--grey); line-height:1.65;}
.info-list li{margin-bottom:8px;}
.info-list b{color:var(--ink);}

input[type=text], input[type=password], input[type=email], input[type=tel]{
  width:100%; min-height:50px; padding:12px 16px; font-size:16px; border:1.5px solid var(--line); border-radius:12px;
  font-family:var(--font-body); margin-bottom:12px; background:#fff; color:var(--ink); transition:border-color .2s ease, box-shadow .2s ease;
}
input[type=text]:focus, input[type=password]:focus, input[type=email]:focus, input[type=tel]:focus{outline:none; border-color:var(--brand); box-shadow:var(--ring);}
.err-text{color:var(--red); font-size:.86rem; display:none; margin:-4px 0 12px; font-weight:600;}

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:46px;
  font-family:var(--font-display); font-weight:800; font-size:.92rem; letter-spacing:-.005em;
  border:1.5px solid transparent; border-radius:12px; padding:10px 20px; cursor:pointer; text-decoration:none;
  transition:transform .2s var(--ease), box-shadow .2s ease, background .2s ease, border-color .2s ease, color .2s ease, filter .2s ease;
  -webkit-tap-highlight-color:transparent;
}
.btn:hover{transform:translateY(-1px);}
.btn:active{transform:scale(.98);}
.btn:disabled{opacity:.45; cursor:not-allowed; transform:none; box-shadow:none;}
.btn-block{display:flex; width:100%;}
.btn-primary{background:linear-gradient(135deg,var(--brand),var(--brand-dark)); color:#fff; box-shadow:0 8px 20px rgba(13,71,161,.26);}
.btn-primary:hover{box-shadow:0 12px 26px rgba(13,71,161,.34); filter:brightness(1.05);}
.btn-ghost{background:#fff; border-color:#C9DAEE; color:var(--brand-dark);}
.btn-ghost:hover{background:var(--brand-light); border-color:var(--brand);}
.btn-pause{background:var(--accent-light); color:#7A4B00; border-color:#F3C77A;}
.btn-pause:hover{background:#FDE6BE;}
.btn-mark{background:var(--review-light); color:var(--review); border-color:#E1C4EA;}
.btn-mark:hover{background:#ECD5F2;}
.btn-clear{background:#fff; border-color:var(--line); color:var(--grey);}
.btn-clear:hover{border-color:#C9DAEE; color:var(--ink);}
.btn-submit{background:linear-gradient(135deg,#22A06B,var(--green)); color:#fff; box-shadow:0 8px 20px rgba(30,142,90,.26);}
.btn-submit:hover{box-shadow:0 12px 26px rgba(30,142,90,.34);}

/* ---------- Exam shell ---------- */
.exam-shell{min-height:100vh; display:flex; flex-direction:column; background:var(--bg);}
.exam-topbar{
  background:linear-gradient(120deg,var(--brand-deep),var(--brand-dark) 60%,var(--brand)); color:#fff;
  display:flex; align-items:center; justify-content:space-between; padding:10px 22px;
  position:sticky; top:0; z-index:20; flex-wrap:wrap; gap:10px; box-shadow:0 6px 20px rgba(10,47,107,.25);
}
.exam-topbar .brand{display:flex; align-items:center; gap:12px; min-width:0;}
.exam-topbar .brand .seal{width:38px; height:38px; margin:0; border-radius:10px; border:none; box-shadow:none;}
.exam-topbar h1{font-family:var(--font-display); font-size:1rem; font-weight:800; margin:0; color:#fff; line-height:1.3;}
.timer-block{display:flex; align-items:center; gap:10px;}
.timer{
  background:#fff; color:var(--brand-dark); font-family:var(--font-mono); font-weight:700; font-size:1.05rem;
  padding:8px 14px; border-radius:10px; font-variant-numeric:tabular-nums; min-width:86px; text-align:center;
}
.timer.low{color:var(--red); background:#FFF1F1; animation:qPulse 1s infinite;}
@keyframes qPulse{0%,100%{opacity:1;}50%{opacity:.6;}}
.exam-topbar .btn-pause{min-height:40px; padding:8px 14px;}

.exam-grid{display:grid; grid-template-columns:minmax(0,1fr) 310px; gap:0; flex:1; align-items:start; max-width:1240px; width:100%; margin:0 auto;}
.question-panel{padding:24px clamp(16px,3vw,32px) 32px;}
.question-panel > .qtop, .question-panel > .qtext, .question-panel > #opts, .question-panel > .action-row, .question-panel > .nav-row{max-width:760px;}
.qtop{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:16px; flex-wrap:wrap;}
.qnum-badge{background:var(--brand-dark); color:#fff; font-family:var(--font-display); font-weight:800; font-size:.84rem; padding:7px 14px; border-radius:999px;}
.qstatus-tag{font-size:.78rem; font-weight:700; color:var(--grey); background:var(--palette-grey); padding:6px 12px; border-radius:999px;}
.qtext{font-size:clamp(1.02rem,.98rem + .25vw,1.14rem); font-weight:600; margin-bottom:20px; line-height:1.6; color:var(--ink); background:#fff; border:1px solid var(--line); border-radius:var(--radius); padding:20px 22px; box-shadow:var(--shadow-sm);}
#opts label{
  display:flex; align-items:center; gap:12px; background:#fff; border:1.5px solid var(--line); border-radius:14px;
  padding:14px 16px; margin-bottom:10px; cursor:pointer; font-size:.96rem; line-height:1.45; min-height:54px;
  transition:border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s var(--ease);
}
#opts label:hover{border-color:var(--brand); box-shadow:var(--shadow-sm); transform:translateX(2px);}
#opts label.selected{border-color:var(--brand); background:var(--brand-light); font-weight:600; box-shadow:0 0 0 3px rgba(21,101,192,.12);}
#opts input{margin:0; width:18px; height:18px; flex-shrink:0; accent-color:var(--brand);}

.action-row{display:flex; justify-content:space-between; margin-top:22px; flex-wrap:wrap; gap:10px;}
.left-actions, .right-actions{display:flex; gap:10px; flex-wrap:wrap;}
.nav-row{display:flex; justify-content:space-between; gap:10px; margin-top:16px; border-top:1px solid var(--line); padding-top:16px;}

.palette-panel{
  background:#fff; border-left:1px solid var(--line); padding:20px 18px; position:sticky; top:60px;
  max-height:calc(100vh - 60px); overflow-y:auto; align-self:stretch;
}
.palette-title{font-family:var(--font-display); font-weight:800; color:var(--brand-dark); font-size:.98rem; margin-bottom:4px;}
.palette-summary{font-size:.78rem; color:var(--grey); margin-bottom:14px; line-height:1.5;}
.palette-grid{display:grid; grid-template-columns:repeat(5,1fr); gap:7px; margin-bottom:18px;}
.pbtn{
  aspect-ratio:1; border-radius:10px; border:none; font-family:var(--font-display); font-weight:800; font-size:.8rem; cursor:pointer;
  display:flex; align-items:center; justify-content:center; position:relative; color:#fff; transition:transform .15s var(--ease), box-shadow .15s ease;
}
.pbtn:hover{transform:translateY(-1px); box-shadow:var(--shadow-sm);}
.pbtn.not-visited{background:var(--palette-grey); color:var(--ink);}
.pbtn.not-answered{background:var(--red);}
.pbtn.answered{background:var(--green);}
.pbtn.marked{background:var(--review);}
.pbtn.answered-marked{background:var(--review);}
.pbtn.answered-marked::after{
  content:'✓'; position:absolute; bottom:-4px; right:-4px; background:var(--green); border:2px solid #fff; border-radius:50%;
  width:16px; height:16px; font-size:9px; display:flex; align-items:center; justify-content:center;
}
.pbtn.current{outline:3px solid var(--accent); outline-offset:2px;}
.legend{font-size:.76rem; color:var(--grey); border-top:1px solid var(--line); padding-top:14px; margin-bottom:16px;}
.legend .row{display:flex; align-items:center; gap:8px; margin-bottom:7px;}
.sw{width:14px; height:14px; border-radius:4px; display:inline-block; flex-shrink:0;}
.sw.not-visited{background:var(--palette-grey);}
.sw.not-answered{background:var(--red);}
.sw.answered{background:var(--green);}
.sw.marked, .sw.answered-marked{background:var(--review);}

/* ---------- Overlays & modals ---------- */
.overlay{position:fixed; inset:0; background:rgba(10,25,50,.55); backdrop-filter:blur(4px); -webkit-backdrop-filter:blur(4px); z-index:100; display:flex; align-items:center; justify-content:center; padding:20px;}
.modal{background:#fff; border-radius:20px; padding:28px; max-width:440px; width:100%; box-shadow:var(--shadow-lg); animation:qPop .3s var(--ease) both;}
.modal h3{font-family:var(--font-display); font-weight:800; color:var(--brand-dark); margin:0 0 10px; font-size:1.2rem;}
.modal p{font-size:.92rem; color:var(--grey); margin:0 0 18px;}
.pause-modal{text-align:center;}
.pause-modal .icon{font-size:40px; margin-bottom:8px;}
.modal-actions{display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap;}
.summary-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,130px),1fr)); gap:10px; margin-bottom:18px;}
.summary-cell{background:var(--bg); border:1px solid var(--line); border-radius:12px; padding:14px 10px; text-align:center;}
.summary-cell .n{font-family:var(--font-mono); font-size:1.35rem; font-weight:700; color:var(--brand-dark); line-height:1.2;}
.summary-cell .l{font-size:.74rem; color:var(--grey); font-weight:700; text-transform:uppercase; letter-spacing:.05em; margin-top:2px;}

/* ---------- Result screen ---------- */
.score-hero{text-align:center; padding:18px 0 6px;}
.score-hero .big{font-family:var(--font-display); font-size:clamp(2.6rem,2rem + 3vw,3.6rem); font-weight:800; color:var(--brand-dark); letter-spacing:-.03em; line-height:1.05;}
.score-hero .msg{font-size:.98rem; color:var(--grey); margin-top:8px; font-weight:600;}
.review-item{border:1px solid var(--line); border-radius:12px; padding:14px 16px; margin-bottom:12px;}
.review-item .qh{font-weight:700; font-size:.96rem; margin-bottom:8px;}
.opt-line{font-size:.9rem; padding:8px 12px; border-radius:10px; margin-bottom:6px; border:1px solid transparent;}
.opt-line.correct{background:var(--green-light); color:#146B43; font-weight:700; border-color:#BFE3CB;}
.opt-line.wrong{background:var(--red-light); color:var(--red); font-weight:700; border-color:#F3C3C3;}
.opt-line.neutral{background:var(--bg); border-color:var(--line);}
.exp-box{background:var(--brand-light); border-left:4px solid var(--brand); padding:12px 14px; font-size:.9rem; line-height:1.65; margin-top:10px; border-radius:0 12px 12px 0; color:var(--ink);}
.exp-box b{color:var(--brand-dark);}
details summary{cursor:pointer; font-weight:700; color:var(--brand); margin:14px 0;}

.result-actions{display:flex; flex-wrap:wrap; gap:10px; justify-content:center; margin-top:22px;}
.result-actions .btn{width:auto; text-decoration:none;}
.result-tabs{display:flex; gap:6px; margin-bottom:18px; border-bottom:2px solid var(--line); overflow-x:auto;}
.result-tab{background:none; border:none; padding:12px 18px; font-family:var(--font-display); font-weight:800; font-size:.92rem; color:var(--grey); cursor:pointer; border-bottom:3px solid transparent; margin-bottom:-2px; white-space:nowrap; transition:color .2s ease, border-color .2s ease;}
.result-tab:hover{color:var(--brand-dark);}
.result-tab.active{color:var(--brand-dark); border-bottom-color:var(--brand);}
.result-tab-panel.hidden{display:none;}
.qw-list{display:flex; flex-direction:column; gap:10px; margin-top:4px;}
.qw-row{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:13px 16px; border:1px solid var(--line); border-radius:12px; background:#fff; flex-wrap:wrap; transition:border-color .2s ease, box-shadow .2s ease;}
.qw-row:hover{border-color:#BBD6F0; box-shadow:var(--shadow-sm);}
.qw-left{display:flex; align-items:center; gap:14px; flex-wrap:wrap;}
.qw-qnum{font-family:var(--font-mono); font-weight:700; color:var(--brand-dark); min-width:36px;}
.qw-ans{font-size:.84rem; color:var(--ink); line-height:1.5;}
.qw-ans b{color:var(--grey); font-weight:600;}
.qw-status{font-size:.84rem; font-weight:800; white-space:nowrap;}
.qw-status.correct{color:var(--green);}
.qw-status.wrong{color:var(--red);}
.qw-status.skip{color:var(--grey);}
.btn-view-sol{background:var(--brand-light); color:var(--brand-dark); border:none; padding:9px 16px; border-radius:999px; font-family:var(--font-display); font-weight:800; font-size:.8rem; cursor:pointer; white-space:nowrap; transition:background .2s ease;}
.btn-view-sol:hover{background:#CFE6FB;}
.sol-overlay{z-index:200;}
.sol-modal{max-width:680px; max-height:88vh; overflow-y:auto; padding:26px 28px; position:relative;}
.sol-modal .close-x{position:absolute; top:12px; right:14px; width:36px; height:36px; border-radius:50%; background:var(--bg); border:none; font-size:20px; cursor:pointer; color:var(--grey); line-height:1;}
.sol-modal .close-x:hover{background:var(--brand-light); color:var(--brand-dark);}
.sol-modal .sol-qnum{font-family:var(--font-display); font-weight:800; color:var(--teal); font-size:.78rem; text-transform:uppercase; letter-spacing:.1em; margin-bottom:8px;}
.sol-modal .sol-qtext{font-size:1.04rem; font-weight:600; color:var(--ink); margin-bottom:14px; line-height:1.55; padding-right:30px;}
.sol-nav{display:flex; justify-content:space-between; margin-top:20px; gap:10px; border-top:1px solid var(--line); padding-top:16px;}
.sol-nav .btn{width:auto; min-height:42px; padding:8px 16px; font-size:.86rem;}
.qw-detail{display:none; margin-top:12px; padding-top:12px; border-top:1px dashed var(--line); width:100%;}
.qw-list.show-all .qw-detail{display:block;}
.qw-detail-q{font-weight:700; color:var(--ink); margin-bottom:10px; font-size:.96rem; line-height:1.5;}
.perf-item{display:flex; gap:12px; padding:13px 0; border-bottom:1px solid var(--line); align-items:flex-start;}
.perf-item:last-child{border-bottom:none;}
.perf-icon{font-size:20px; line-height:1.4;}
.perf-text{font-size:.9rem; color:var(--ink); line-height:1.6;}
.perf-text b{color:var(--brand-dark);}

/* ---------- Watermark & toast ---------- */
#watermark-layer{position:fixed; inset:0; pointer-events:none; z-index:50; overflow:hidden; display:flex; flex-wrap:wrap; align-content:flex-start; transform:rotate(-28deg) scale(1.3); opacity:.06;}
#watermark-layer span{font-size:13px; font-weight:700; color:#0A2F6B; white-space:nowrap; margin:26px 34px; font-family:var(--font-display);}
#toast{position:fixed; bottom:calc(24px + env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%) translateY(20px); background:var(--brand-deep); color:#fff; padding:11px 20px; border-radius:12px; font-size:.88rem; font-weight:600; opacity:0; transition:.3s var(--ease); z-index:200; pointer-events:none; box-shadow:var(--shadow-md);}
#toast.show{opacity:1; transform:translateX(-50%) translateY(0);}

/* ---------- Mobile ---------- */
.palette-toggle{display:none; width:100%; min-height:46px; padding:12px; background:var(--brand-light); color:var(--brand-dark); border:none; font-family:var(--font-display); font-weight:800; font-size:.9rem; border-radius:12px; cursor:pointer; margin-bottom:12px;}
@media (max-width:860px){
  .exam-grid{grid-template-columns:1fr;}
  .palette-panel{position:static; max-height:none; border-left:none; border-top:1px solid var(--line);}
  .palette-toggle{display:block;}
  .palette-toggle-body{display:none;}
  .palette-toggle-body.open{display:block;}
  .palette-grid{grid-template-columns:repeat(8,1fr);}
}
@media (max-width:560px){
  .exam-topbar{padding:8px 14px;}
  .exam-topbar h1{font-size:.88rem;}
  .exam-topbar .brand .seal{display:none;}
  .timer{font-size:.98rem; min-width:76px; padding:7px 10px;}
  .question-panel{padding:18px 14px 26px;}
  .qtext{padding:16px;}
  .action-row .left-actions, .action-row .right-actions{width:100%;}
  .action-row .btn{flex:1 1 auto;}
  .right-actions .btn{width:100%;}
  .palette-grid{grid-template-columns:repeat(6,1fr);}
  .qw-row{padding:12px 13px;}
  .btn-view-sol{width:100%;}
  .sol-modal{padding:22px 18px;}
}


/* stat grids: even rows (6 result cells = 3×2, 4 submit cells = 2×2) */
#result-summary{grid-template-columns:repeat(3,minmax(0,1fr));}
#submit-summary{grid-template-columns:repeat(2,minmax(0,1fr));}
@media (max-width:560px){ #result-summary{grid-template-columns:repeat(2,minmax(0,1fr));} }

/* site-wide floating WhatsApp pill (added by js/site.js) — styled to match, hidden during a running test */
.float-pill{position:fixed; right:16px; bottom:calc(16px + env(safe-area-inset-bottom)); z-index:60; background:#25D366; color:#fff; border-radius:999px; min-height:44px; padding:0 18px 0 14px; display:flex; align-items:center; gap:8px; text-decoration:none; box-shadow:0 10px 24px rgba(37,211,102,.35); font-family:var(--font-display); font-weight:800; font-size:.84rem; border:2px solid #fff;}
.float-pill .dot-anim{width:8px; height:8px; border-radius:50%; background:#fff; animation:qPulse 1.6s infinite;}
body:has(#screen-exam:not(.hidden)) .float-pill{display:none;}

@keyframes qFade{from{opacity:0; transform:translateY(10px);} to{opacity:1; transform:none;}}
@keyframes qPop{from{opacity:0; transform:scale(.96) translateY(8px);} to{opacity:1; transform:none;}}

/* ========== ACCESS-CODE GATES (shared with css/site.css) ========== */
/* QGATE-START */
.q-gate-overlay{position:fixed; inset:0; z-index:99999; background:rgba(10,25,50,.88); backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px); display:flex; align-items:center; justify-content:center; padding:20px; overflow-y:auto; font-family:'Inter',system-ui,sans-serif;}
.q-gate-card{background:#fff; border-radius:22px; padding:32px 28px; max-width:440px; width:100%; text-align:center; box-shadow:0 30px 70px rgba(0,0,0,.35); border-top:5px solid #1565C0; animation:qGatePop .35s cubic-bezier(.22,1,.36,1) both;}
.q-gate-logo{width:60px; height:60px; margin:0 auto 12px; border-radius:16px; background:#fff url('/images/logo.png') center/82% no-repeat; border:1px solid #E1EAF5; box-shadow:0 4px 14px rgba(13,50,110,.08);}
.q-gate-icon{width:56px; height:56px; margin:0 auto 12px; border-radius:50%; background:#E3F2FD; display:flex; align-items:center; justify-content:center; font-size:26px;}
.q-gate-brand{font-family:'Manrope',system-ui,sans-serif; font-weight:800; color:#0D47A1; font-size:1.08rem;}
.q-gate-kicker{font-family:'Manrope',system-ui,sans-serif; font-size:.7rem; color:#0C8479; letter-spacing:.14em; font-weight:800; text-transform:uppercase; margin:2px 0 14px;}
.q-gate-title{font-family:'Manrope',system-ui,sans-serif; color:#0D47A1; font-weight:800; margin:4px 0 8px; font-size:1.2rem; line-height:1.3; letter-spacing:-.01em;}
.q-gate-text{color:#55677A; font-size:.92rem; line-height:1.6; margin:0 0 18px;}
.q-gate-input{width:100%; min-height:50px; padding:12px 14px; border:1.5px solid #E1EAF5; border-radius:12px; font-size:16px; text-align:center; letter-spacing:1px; text-transform:uppercase; margin-bottom:12px; box-sizing:border-box; font-family:'Inter',system-ui,sans-serif;}
.q-gate-input:focus{outline:none; border-color:#1565C0; box-shadow:0 0 0 4px rgba(21,101,192,.18);}
.q-gate-err{display:none; color:#D32F2F; font-size:.84rem; font-weight:600; margin:0 0 10px;}
.q-gate-btn{display:flex; align-items:center; justify-content:center; width:100%; min-height:50px; background:linear-gradient(135deg,#1565C0,#0D47A1); color:#fff; border:none; border-radius:12px; padding:12px; font-family:'Manrope',system-ui,sans-serif; font-weight:800; font-size:.98rem; cursor:pointer; margin-bottom:16px; box-shadow:0 10px 22px rgba(13,71,161,.28); transition:transform .2s ease, box-shadow .2s ease;}
.q-gate-btn:hover{transform:translateY(-1px); box-shadow:0 14px 28px rgba(13,71,161,.34);}
.q-gate-foot{border-top:1px solid #E1EAF5; padding-top:14px; font-size:.86rem; color:#55677A; line-height:1.55;}
.q-gate-foot a{color:#0D47A1; font-weight:800;}
.q-gate-links{margin-top:14px; display:flex; flex-wrap:wrap; gap:8px 18px; justify-content:center;}
.q-gate-links a{color:#55677A; font-size:.8rem; text-decoration:none; font-weight:600;}
.q-gate-links a:hover{color:#0D47A1;}
.q-gate-help{margin-top:14px; text-align:center;}
.q-gate-help a.q-gate-signin{display:block; border:1.5px solid #1565C0; color:#0D47A1; border-radius:12px; padding:11px 12px; font-weight:800; font-size:.86rem; text-decoration:none; background:#fff; font-family:'Manrope',system-ui,sans-serif; transition:background .2s ease;}
.q-gate-help a.q-gate-signin:hover{background:#E3F2FD;}
.q-gate-promo{margin-top:12px; font-size:.84rem; color:#55677A; line-height:1.55;}
.q-gate-promo b{color:#0D47A1;}
.q-gate-promo a{color:#1565C0; font-weight:800;}
.q-paid-wall{position:fixed; inset:0; z-index:2147483000; background:#F4F8FD; overflow:auto; display:flex; align-items:center; justify-content:center; padding:18px; font-family:'Inter',system-ui,sans-serif;}
@keyframes qGatePop{from{opacity:0; transform:scale(.96) translateY(10px);} to{opacity:1; transform:none;}}
/* QGATE-END */

/* ===== "Buy the course" bar for signed-in free students (js/site.js) ===== */
/* BUYBAR-START */
.pia-buybar{position:fixed; left:12px; right:12px; bottom:calc(12px + env(safe-area-inset-bottom)); z-index:950; max-width:880px; margin:0 auto; display:flex; align-items:center; gap:12px; padding:12px 14px 12px 18px; background:linear-gradient(120deg,#0A2F6B,#1565C0); color:#fff; border-radius:16px; box-shadow:0 16px 40px rgba(10,47,107,.35); font-family:'Inter',system-ui,sans-serif; font-size:.9rem; line-height:1.45; animation:piaBuyIn .45s cubic-bezier(.22,1,.36,1) both;}
.pia-buybar-txt{flex:1; min-width:0; color:#E3F2FD;}
.pia-buybar-txt b{color:#fff;}
.pia-buybar-btn{flex-shrink:0; background:#F5A623; color:#2A1D02 !important; font-family:'Manrope',system-ui,sans-serif; font-weight:800; text-decoration:none; padding:10px 18px; border-radius:12px; white-space:nowrap; transition:transform .2s ease, box-shadow .2s ease;}
.pia-buybar-btn:hover{transform:translateY(-1px); box-shadow:0 8px 18px rgba(245,166,35,.45);}
.pia-buybar-x{flex-shrink:0; width:32px; height:32px; border-radius:50%; border:none; background:rgba(255,255,255,.14); color:#fff; font-size:18px; cursor:pointer; line-height:1;}
.pia-buybar-x:hover{background:rgba(255,255,255,.25);}
body.has-buybar .float-social, body.has-buybar .float-pill{bottom:calc(96px + env(safe-area-inset-bottom));}
body:has(#screen-exam:not(.hidden)) .pia-buybar{display:none;}
@media(max-width:600px){ .pia-buybar{flex-wrap:wrap; font-size:.84rem; padding:12px 12px 12px 14px;} .pia-buybar-txt{flex:1 1 calc(100% - 44px);} .pia-buybar-btn{flex:1 1 auto; text-align:center;} body.has-buybar .float-social, body.has-buybar .float-pill{bottom:calc(150px + env(safe-area-inset-bottom));} }
@keyframes piaBuyIn{from{opacity:0; transform:translateY(20px);} to{opacity:1; transform:none;}}
/* BUYBAR-END */

/* on test pages the buy bar replaces the floating WhatsApp pill so nothing covers the form */
body.has-buybar .float-pill{display:none !important;}
