/* Online Test Site — shared styles. Tokens match project-brief.md section 8. */

@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700&display=swap');

:root{
  --blue:#3462E8;
  --blue-text:#1F45B8;
  --lime:#A7E22F;
  --ink:#131A33;
  --muted:#4A5372;
  --white:#FFFFFF;
  --ground:#EEF2FC;
  --tint:#E6ECFD;
  --panel:#F4F6FD;
  --border1:#D5DCEF;
  --border2:#C9D3EE;
  --border3:#E3E8F5;
  --correct-fg:#1D6B35; --correct-bg:#E4F3E8;
  --wrong-fg:#A8261D;   --wrong-bg:#FBE9E7;
  --warn-fg:#8A4A06;    --warn-bg:#FFF1E3; --warn-border:#E07B12;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:'Atkinson Hyperlegible', system-ui, sans-serif;
  color:var(--ink);
  background:var(--white);
  -webkit-user-select:none;
  user-select:none;
  -webkit-tap-highlight-color:transparent;
}
body.dashboard{background:var(--ground)}
img,svg{display:block}
button,input,select{font-family:inherit}

/* Anti-cheating basics: no copy/paste/select/right-click on student pages */
body.student{ -webkit-touch-callout:none; }
body.student input, body.student textarea{ -webkit-user-select:text; user-select:text; }

.app-shell{
  max-width:520px;
  margin:0 auto;
  min-height:100vh;
  min-height:100dvh;
  display:flex;
  flex-direction:column;
  background:var(--white);
}

.brand{display:flex;align-items:center;gap:10px}
.brand-mark{width:40px;height:40px;border-radius:12px;background:var(--blue);color:var(--lime);display:flex;align-items:center;justify-content:center;flex-shrink:0}
.brand-name{font-size:20px;font-weight:700}

.btn{
  height:58px;border-radius:16px;border:none;font-size:19px;font-weight:700;
  display:flex;align-items:center;justify-content:center;gap:8px;cursor:pointer;
  text-decoration:none;color:var(--ink);
}
.btn-primary{background:var(--lime)}
.btn-primary:disabled{background:var(--tint);color:var(--muted);cursor:not-allowed}
.btn-outline{background:var(--white);border:2px solid var(--border2)}
.btn-outline:disabled{color:var(--muted);cursor:not-allowed}
.btn-sq{width:58px;height:58px;flex-shrink:0;padding:0}
.btn-sm{height:46px;font-size:16px;border-radius:14px;padding:0 16px}

.field-label{font-size:16px;font-weight:700}
.input-box{
  height:62px;box-sizing:border-box;padding:0 16px;border-radius:16px;
  border:2px solid var(--blue);background:var(--white);
  font-size:22px;color:var(--ink);outline:none;width:100%;
}
.help-text{font-size:16px;color:var(--muted);line-height:1.45}

.answer-row{
  width:100%;min-height:62px;box-sizing:border-box;padding:10px 16px;
  display:flex;align-items:center;gap:14px;border-radius:16px;
  border:2px solid var(--border1);background:var(--white);
  font-size:19px;color:var(--ink);text-align:left;cursor:pointer;
}
.answer-row.selected{border-color:var(--blue);background:var(--tint)}
.answer-chip{
  width:38px;height:38px;flex-shrink:0;border-radius:19px;display:flex;
  align-items:center;justify-content:center;font-size:17px;font-weight:700;
  background:#EEF2FC;color:var(--blue-text);
}
.answer-row.selected .answer-chip{background:var(--blue);color:var(--white)}
.answer-text{flex-grow:1}

.top-header{padding:20px 20px 0;display:flex;flex-direction:column;gap:12px}
.top-header-row{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.top-header-title{font-size:15px;color:var(--muted)}
.top-header-part{font-size:22px;font-weight:700;line-height:1.2}
.progress-track{height:8px;border-radius:4px;background:var(--tint);overflow:hidden}
.progress-fill{height:8px;border-radius:4px;background:var(--blue)}
.qcount-row{display:flex;justify-content:space-between;align-items:center;font-size:16px}
.save-ok{display:flex;align-items:center;gap:6px;color:var(--correct-fg)}
.save-busy{display:flex;align-items:center;gap:6px;color:var(--muted)}
.save-err{display:flex;align-items:center;gap:6px;color:var(--wrong-fg)}

.qbody{padding:24px 20px 16px;display:flex;flex-direction:column;gap:14px}
.qprompt{font-size:23px;line-height:1.5}
.qinstruction{font-size:16px;color:var(--muted)}

.passage-box{background:var(--panel);border-radius:18px;padding:14px 18px 18px;display:flex;flex-direction:column;gap:8px}
.passage-title-row{display:flex;justify-content:space-between;align-items:center;gap:12px}
.passage-title{font-size:16px;font-weight:700;color:var(--blue-text)}
.passage-text{margin:0;font-size:18px;line-height:1.6}

.bottom-nav{margin-top:auto;padding:14px 20px 28px;display:flex;gap:10px;border-top:1px solid var(--border3)}

.pin-boxes{display:flex;gap:12px;justify-content:center}
.pin-box{width:68px;height:76px;box-sizing:border-box;border-radius:16px;border:2px solid var(--border2);background:var(--white);display:flex;align-items:center;justify-content:center}
.pin-box.next{border-color:var(--blue)}
.pin-box.filled{border-color:var(--ink)}
.pin-box.error{border-color:var(--wrong-fg);background:var(--wrong-bg)}
.pin-dot{width:16px;height:16px;border-radius:8px;background:var(--ink)}
.keypad{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.keypad button{height:64px;border-radius:16px;border:none;background:var(--panel);color:var(--ink);font-size:26px;font-weight:700;display:flex;align-items:center;justify-content:center;cursor:pointer}
.keypad button:disabled{visibility:hidden}
.error-banner{display:flex;align-items:center;gap:10px;padding:12px 14px;border-radius:14px;background:var(--wrong-bg);color:var(--wrong-fg);font-size:17px;font-weight:700;line-height:1.35}
.warn-banner{background:var(--warn-bg);color:var(--warn-fg);border-radius:14px;padding:12px 14px;font-size:16px;line-height:1.45}

.map-legend{display:flex;gap:16px;font-size:15px}
.map-legend-item{display:flex;align-items:center;gap:8px}
.map-swatch{width:18px;height:18px;border-radius:5px}
.map-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px}
.map-cell{height:44px;border-radius:12px;font-size:16px;font-weight:700;display:flex;align-items:center;justify-content:center;text-decoration:none;cursor:pointer;border:none}
.map-cell.answered{background:var(--blue);color:var(--white)}
.map-cell.missing{background:var(--warn-bg);border:2px solid var(--warn-border);color:var(--warn-fg)}

.ord-list{display:flex;flex-direction:column;gap:10px}
.ord-item{display:flex;align-items:center;gap:10px;border:2px solid var(--border3);border-radius:16px;padding:12px 14px;background:var(--white);font-size:19px}
.ord-item.dragging{opacity:.5}
.ord-handle{cursor:grab;color:var(--muted)}
.ord-arrows{display:flex;flex-direction:column;gap:4px;margin-left:auto}
.ord-arrows button{width:34px;height:28px;border-radius:8px;border:none;background:var(--panel);color:var(--ink);cursor:pointer;font-size:14px}
.ord-arrows button:disabled{opacity:.35;cursor:default}

.match-card{border:2px solid var(--border3);border-radius:18px;padding:14px 16px 16px;display:flex;flex-direction:column;gap:10px}
.match-card select{height:58px;box-sizing:border-box;border-radius:14px;border:2px solid var(--border2);background:var(--white);padding:0 12px;font-size:18px;color:var(--ink)}
.match-card select.chosen{border-color:var(--blue);background:var(--tint)}

.tfng-row{display:flex;gap:10px}
.tfng-row .answer-row{justify-content:center;text-align:center}

.center-screen{flex-grow:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:28px;text-align:center}

/* ---------- Teacher dashboard ---------- */
.dash-shell{max-width:1200px;margin:0 auto;padding:24px 32px 48px;display:flex;flex-direction:column;gap:24px}
.dash-top{display:flex;justify-content:space-between;align-items:center;gap:24px;flex-wrap:wrap}
.pill-nav{display:flex;gap:4px;padding:6px;border-radius:28px;background:var(--white)}
.pill-nav a,.pill-nav span{height:44px;padding:0 20px;border-radius:22px;color:var(--ink);font-size:16px;display:flex;align-items:center;text-decoration:none;cursor:pointer;border:none;background:none;font-family:inherit}
.pill-nav .active{background:var(--tint);color:var(--blue-text);font-weight:700}
.card{background:var(--white);border-radius:22px;padding:22px 24px}
.card-title{font-size:21px;font-weight:700}
.stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:16px}
.stat-card{background:var(--white);border-radius:20px;padding:18px 20px;display:flex;flex-direction:column;gap:4px}
.stat-value{font-size:30px;font-weight:700;line-height:1.1}
.stat-label{font-size:15px;color:var(--muted)}
.table-wrap{overflow-x:auto}
table.dash-table{width:100%;border-collapse:collapse;font-size:16px}
table.dash-table th{text-align:left;font-size:14px;color:var(--muted);font-weight:700;padding:8px 10px;border-bottom:1px solid var(--border3)}
table.dash-table td{padding:10px;border-bottom:1px solid var(--border3);vertical-align:middle}
.status-chip{display:inline-flex;padding:5px 12px;border-radius:12px;font-size:14px;font-weight:700}
.status-notjoined{background:#F1F3F8;color:var(--muted)}
.status-working{background:var(--tint);color:var(--blue-text)}
.status-submitted{background:var(--correct-bg);color:var(--correct-fg)}
.join-block{background:var(--white);border-radius:20px;padding:12px 14px 12px 12px;display:flex;align-items:center;gap:16px;flex-wrap:wrap}
.join-code-num{font-size:30px;font-weight:700;letter-spacing:3px}
.qr-modal{position:fixed;inset:0;background:var(--white);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;z-index:50}
.login-shell{max-width:420px;margin:80px auto;padding:0 20px;display:flex;flex-direction:column;gap:20px}
.field{display:flex;flex-direction:column;gap:8px}
.field input{height:56px;border-radius:14px;border:2px solid var(--border2);padding:0 14px;font-size:18px;outline:none}
.field input:focus{border-color:var(--blue)}

.hidden{display:none !important}
