/* Gujarat PSI Prep — deep blue + saffron, dark readable theme, mobile-first */
:root {
  --bg: #0b1220;
  --bg2: #101a30;
  --card: #16213a;
  --card2: #1c2a4a;
  --line: #2a3c66;
  --text: #e8eefc;
  --muted: #9fb0d0;
  --blue: #2f6bff;
  --blue-d: #1e4fd1;
  --saffron: #ff9933;
  --saffron-d: #e07b12;
  --green: #34d17b;
  --red: #ff5d5d;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  line-height: 1.55;
}
.hidden { display: none !important; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(1000px 500px at 50% -10%, #1b2c55 0%, var(--bg) 60%); }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 36px 30px; max-width: 420px; width: 100%; text-align: center; }
.login-badge { font-size: 52px; }
.login-card h1 { margin: 10px 0 6px; color: var(--saffron); }
.login-sub { color: var(--muted); font-size: 14px; }
.login-card input { width: 100%; padding: 12px; margin: 14px 0 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg2); color: var(--text); font-size: 16px; }
.login-msg { min-height: 22px; font-size: 14px; color: var(--muted); }
.warn { background: #3a2a10; border: 1px solid var(--saffron); color: #ffd9a0;
  padding: 10px; border-radius: 8px; font-size: 13px; margin-bottom: 10px; }

/* ---------- buttons / inputs ---------- */
.btn-primary { background: linear-gradient(180deg, var(--saffron), var(--saffron-d));
  color: #201303; border: 0; border-radius: 8px; padding: 12px 20px; font-size: 15px;
  font-weight: 700; cursor: pointer; width: 100%; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { opacity: .5; cursor: default; }
.btn-blue { background: var(--blue); color: #fff; border: 0; border-radius: 8px;
  padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-blue:hover { background: var(--blue-d); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 14px; cursor: pointer; font-size: 13px; }
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }
.btn-danger { background: #5a1d1d; color: #ffb3b3; border: 1px solid #7a2a2a;
  border-radius: 8px; padding: 8px 14px; cursor: pointer; font-size: 13px; }
input[type="text"], input[type="number"], input[type="date"], select, textarea {
  background: var(--bg2); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 10px 12px; font-size: 14px; font-family: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); border-color: var(--blue); }
label { font-size: 13px; color: var(--muted); display: block; margin: 10px 0 4px; }

/* ---------- layout ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px; background: var(--bg2); border-bottom: 2px solid var(--saffron);
  position: sticky; top: 0; z-index: 50; }
.brand { font-weight: 800; font-size: 18px; }
.brand span { color: var(--saffron); }
.userbox { display: flex; align-items: center; gap: 10px; }
.user-email { font-size: 13px; color: var(--muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 10px 14px; background: var(--bg2);
  border-bottom: 1px solid var(--line); position: sticky; top: 57px; z-index: 40; }
.tabs button { flex: 0 0 auto; background: transparent; border: 1px solid var(--line);
  color: var(--muted); border-radius: 20px; padding: 8px 14px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.tabs button.active { background: var(--saffron); border-color: var(--saffron); color: #201303; font-weight: 700; }
.content { max-width: 960px; margin: 0 auto; padding: 20px 16px 60px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade .2s ease-in; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 18px; border-top: 1px solid var(--line); }

/* ---------- cards / grids ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px; }
.card h2 { margin: 0 0 10px; font-size: 19px; color: var(--saffron); }
.card h3 { margin: 16px 0 8px; font-size: 16px; color: var(--text); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--card2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; text-align: center; }
.stat .num { font-size: 26px; font-weight: 800; color: var(--saffron); }
.stat .lbl { font-size: 12px; color: var(--muted); margin-top: 4px; }
.note { background: #12233f; border-left: 4px solid var(--blue); padding: 10px 14px;
  border-radius: 0 8px 8px 0; font-size: 13px; color: var(--muted); margin: 12px 0; }
.note b { color: var(--text); }
.empty { text-align: center; color: var(--muted); padding: 26px 12px; border: 1px dashed var(--line);
  border-radius: var(--radius); font-size: 14px; }
.err { color: var(--red); font-size: 13px; margin-top: 8px; }
.ok { color: var(--green); font-size: 13px; margin-top: 8px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 10px 0; }
table.data th, table.data td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
table.data th { background: var(--card2); color: var(--saffron); }
table.data tr:nth-child(even) td { background: #131e36; }

/* ---------- syllabus ---------- */
.subj { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 12px; overflow: hidden; }
.subj-head { padding: 14px 16px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.subj-head:hover { background: var(--card2); }
.subj-title { font-weight: 700; }
.subj-marks { font-size: 12px; color: var(--saffron); border: 1px solid var(--saffron);
  border-radius: 12px; padding: 2px 10px; margin-left: 8px; }
.pbar { height: 8px; background: var(--bg2); border-radius: 4px; margin-top: 8px; overflow: hidden; }
.pbar > div { height: 100%; background: linear-gradient(90deg, var(--blue), var(--saffron)); border-radius: 4px; transition: width .3s; }
.topic { display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-top: 1px solid var(--line); font-size: 14px; }
.topic input { width: 18px; height: 18px; accent-color: var(--saffron); }
.topic.done span { text-decoration: line-through; color: var(--muted); }

/* ---------- PYQ cards ---------- */
.pyq { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 10px; flex-wrap: wrap; }
.pyq .meta { font-size: 12px; color: var(--muted); }
.tag { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 2px 10px; margin-right: 6px; }
.tag.new { background: #123f2a; color: var(--green); }
.tag.old { background: #3f3412; color: var(--saffron); }
.tag.miss { background: #3a1a1a; color: var(--red); }

/* ---------- mock runner ---------- */
.q-palette { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.q-palette button { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg2); color: var(--text); cursor: pointer; font-weight: 700; }
.q-palette button.answered { background: var(--green); border-color: var(--green); color: #06210f; }
.q-palette button.review { background: var(--saffron); border-color: var(--saffron); color: #201303; }
.q-palette button.current { outline: 2px solid var(--blue); }
.opt { display: block; width: 100%; text-align: left; background: var(--bg2); border: 1px solid var(--line);
  color: var(--text); border-radius: 8px; padding: 12px; margin: 8px 0; cursor: pointer; font-size: 15px; }
.opt:hover { border-color: var(--blue); }
.opt.sel { border-color: var(--saffron); background: #2a2113; }
.opt.correct { border-color: var(--green); background: #0f2f1d; }
.opt.wrong { border-color: var(--red); background: #331414; }
.timer { font-size: 22px; font-weight: 800; color: var(--saffron); }
.timer.danger { color: var(--red); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .4; } }
.review-q { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.mockrow { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 10px; flex-wrap: wrap; }

/* ---------- PDF review ---------- */
.pq { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px; }
.pq textarea { width: 100%; min-height: 60px; margin-bottom: 8px; }
.pq .opts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pq input[type="text"] { width: 100%; }
.pq .row { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }

/* ---------- tracker ---------- */
.big-timer { font-size: 46px; font-weight: 800; color: var(--saffron); text-align: center; margin: 10px 0; }
.chart-box { position: relative; height: 260px; }

/* ---------- guide ---------- */
.guide h3 { color: var(--saffron); margin-top: 22px; }
.guide ul { padding-left: 20px; }
.guide li { margin-bottom: 6px; }
.plan { background: var(--card2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin: 10px 0; }
.plan b.slot { color: var(--saffron); }

@media (max-width: 640px) {
  .content { padding: 14px 10px 50px; }
  .user-email { display: none; }
  .pq .opts-row { grid-template-columns: 1fr; }
  .stat .num { font-size: 22px; }
}
