* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: #f1f5f9; color: #0f172a; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; background: #1e3a8a; color: #fff; position: sticky; top: 0; z-index: 20; }
.brand { font-size: 20px; font-weight: 800; }
.userbar { font-size: 14px; display: flex; gap: 10px; align-items: center; }
main { max-width: 1024px; margin: 0 auto; padding: 16px; }
.hero { background: linear-gradient(135deg, #1e3a8a, #2563eb); color: #fff; border-radius: 16px; padding: 28px 24px; margin-bottom: 16px; }
.hero h1 { margin: 0 0 8px; font-size: 28px; }
.disclaimer { background: rgba(255,255,255,.14); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.card { background: #fff; border-radius: 14px; padding: 18px; margin-bottom: 16px; box-shadow: 0 1px 4px rgba(15,23,42,.08); }
.hidden { display: none !important; }
label { display: block; font-size: 14px; margin: 8px 0; }
input, textarea, select { width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; margin-top: 4px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin: 10px 0; }
.row label { flex: 1; min-width: 140px; }
.btn { border: 1px solid #94a3b8; background: #fff; color: #0f172a; padding: 9px 16px; border-radius: 9px; cursor: pointer; font: inherit; font-size: 14px; }
.btn:hover { background: #f1f5f9; }
.btn.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn.primary:hover { background: #1d4ed8; }
.btn.danger { background: #dc2626; border-color: #dc2626; color: #fff; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.msg { color: #b91c1c; min-height: 18px; font-size: 14px; }
.note { color: #64748b; font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tile { border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px; }
.tile h3 { margin: 0 0 6px; font-size: 16px; }
.price { font-size: 20px; font-weight: 800; color: #1d4ed8; }
.badge { display: inline-block; background: #dbeafe; color: #1e40af; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 700; }
.badge.free { background: #dcfce7; color: #166534; }
.examhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.examwrap { display: grid; grid-template-columns: 1fr 240px; gap: 16px; align-items: start; }
.exammain { position: relative; overflow: hidden; }
.watermark { position: absolute; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.watermark span { position: absolute; transform: rotate(-24deg); color: rgba(30,58,138,.10); font-weight: 700; font-size: 15px; white-space: nowrap; }
.stem { font-size: 17px; line-height: 1.55; margin-bottom: 14px; }
.stem svg, .options svg, .review svg { max-width: 100%; height: auto; background: #f8fafc; border-radius: 8px; }
.options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.option { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid #cbd5e1; border-radius: 10px; padding: 11px 13px; cursor: pointer; text-align: left; background: #fff; font: inherit; width: 100%; }
.option:hover { border-color: #2563eb; }
.option.selected { border-color: #2563eb; background: #eff6ff; }
.option .letter { font-weight: 800; color: #1d4ed8; }
.navgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.navbtn { border: 1px solid #cbd5e1; background: #fff; border-radius: 7px; padding: 7px 0; cursor: pointer; font-size: 13px; }
.navbtn.answered { background: #2563eb; color: #fff; border-color: #2563eb; }
.navbtn.doubt { box-shadow: inset 0 0 0 2px #f59e0b; }
.navbtn.current { outline: 2px solid #0f172a; }
.scoregrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 14px 0; }
.scorebox { border-radius: 12px; padding: 14px; text-align: center; background: #f8fafc; border: 1px solid #e2e8f0; }
.scorebox .num { font-size: 30px; font-weight: 800; }
.pass { color: #15803d; font-weight: 700; }
.fail { color: #b91c1c; font-weight: 700; }
.review { border-top: 1px solid #e2e8f0; padding: 14px 0; }
.review .correct { color: #15803d; font-weight: 700; }
.review .wrong { color: #b91c1c; font-weight: 700; }
.adminq { border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; margin: 8px 0; font-size: 14px; }
.footer { text-align: center; color: #64748b; font-size: 13px; padding: 22px 10px; }
@media (max-width: 720px) {
  .examwrap { grid-template-columns: 1fr; }
  .hero h1 { font-size: 23px; }
}
