/* ================================================================
   IBPS-style online test interface
   Layout, colours and controls modelled on the official IBPS
   candidate screen. The CBT frame stays light (as on exam day);
   the band above it and the page around it use the dark site theme.
   ================================================================ */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 14px;
  color: #111;
  background: #0d0d1a;
}
body { overflow-x: hidden; }

/* Tamil needs a slightly larger body size and looser line height to stay
   legible at the same optical scale as Latin text. */
body.lang-ta .qtext,
body.lang-ta .opt-label,
body.lang-ta .directions,
body.lang-ta .passage {
  font-size: 15px;
  line-height: 1.75;
  font-family: "Nirmala UI", "Latha", "Noto Sans Tamil", sans-serif;
}

/* ------------------------------------------------------- site band */

.site-band {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 20px 18px;
  color: #e8e8ff;
  font-family: 'Poppins', "Segoe UI", sans-serif;
}
.site-band .crumb { color: #9999c0; font-size: .8rem; margin-bottom: 10px; }
.site-band .crumb a { color: #ff8c00; text-decoration: none; }
.band-row { display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.band-row > div { flex: 1 1 520px; min-width: 0; }
.band-title { margin: 0 0 6px; font-size: 1.35rem; line-height: 1.3; color: #fff; }
.band-title span { color: #ff8c00; font-weight: 600; font-size: .85em; }
.band-note { margin: 0; color: #b9b9dc; font-size: .88rem; line-height: 1.6; max-width: 860px; }
.band-note b { color: #ffd700; }
.back-link {
  flex: none;
  display: inline-block;
  color: #ff8c00;
  border: 1px solid rgba(255,140,0,.45);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
}
.back-link:hover { background: rgba(255,140,0,.12); }

/* ---------------------------------------------------------- CBT frame */

.cbt {
  background: #fff;
  color: #111;
  max-width: 1400px;
  margin: 0 auto 40px;
  border-top: 3px solid #ff8c00;
}

/* ---------------------------------------------------------------- top */

.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 50px;
  border-bottom: 1px solid #c8c8c8;
  background: #fff;
}
.topbar .logo {
  position: absolute;
  left: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: 700;
  line-height: 1;
  color: #1b1b8f;
}
.topbar .logo .mark { font-size: 20px; letter-spacing: -1px; }
.topbar .logo .name { font-size: 9px; letter-spacing: .5px; }
.topbar h1 {
  margin: 0;
  font-size: 18px;
  color: #1b1b8f;
  font-weight: 700;
}

.blackbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 26px;
  padding: 0 10px;
  background: #2b2b2b;
  color: #ffd24d;
  font-size: 12px;
}
.blackbar .instr-link {
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.blackbar .instr-link:hover { text-decoration: underline; }
.icon-i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: #2d8fd5;
  color: #fff;
  font-style: italic;
  font-size: 11px;
  font-weight: 700;
}

/* ------------------------------------------------------------ shell */

.shell {
  display: flex;
  height: calc(100vh - 76px);
  min-height: 560px;
  overflow: hidden;
}
.main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid #000;
}

/* section tab strips */
.tabstrip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  background: #efefef;
  border-bottom: 1px solid #d5d5d5;
}
.tabstrip .arrow {
  color: #888;
  padding: 0 3px;
  user-select: none;
}
.tabhost {
  display: flex;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 3px 3px 0 0;
  background: #d9d9d9;
  color: #333;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}
.tab.active {
  background: #2d8fd5;
  color: #fff;
  font-weight: 600;
}
.tab .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: rgba(255,255,255,.85);
  color: #2d8fd5;
  font-size: 10px;
  font-style: italic;
  font-weight: 700;
}
.tab.active .badge { background: #fff; }

.sectionrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px;
  border-bottom: 1px solid #d5d5d5;
  font-size: 13px;
}
.sectionrow .label { color: #333; }
.timer { font-weight: 600; }
.timer.low { color: #c62828; }

.qtyperow {
  padding: 5px 10px;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 1px solid #d5d5d5;
}

/* language bar */
.langbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 6px 12px;
  background: #4a7ebb;
  color: #fff;
  font-size: 13px;
}
.langbar select {
  font-size: 13px;
  padding: 2px 4px;
  min-width: 92px;
}

/* question body */
.qbody {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 14px 14px;
}
.qno {
  font-weight: 700;
  font-size: 15px;
  padding: 8px 0 6px;
  border-bottom: 1px solid #ddd;
  margin-bottom: 10px;
}
.directions {
  background: #f4f8fb;
  border-left: 3px solid #4a7ebb;
  padding: 8px 10px;
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.directions .dir-word { font-weight: 700; font-style: italic; }
.passage {
  max-height: 260px;
  overflow: auto;
  border: 1px solid #e2e2e2;
  background: #fcfcfc;
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.65;
  text-align: justify;
}
.passage p { margin: 0 0 9px; }
.passage p:last-child { margin-bottom: 0; }

.qtext {
  font-size: 14.5px;
  line-height: 1.7;
  margin-bottom: 14px;
  overflow-wrap: anywhere;
}

.opts { list-style: none; margin: 0; padding: 0; }
.opts li { margin: 0 0 9px; }
.opt {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  padding: 3px 4px;
  border-radius: 3px;
  line-height: 1.6;
}
.opt:hover { background: #f2f7fb; }
.opt input { margin: 4px 0 0; flex: none; }
.opt-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.opt-letter { font-weight: 700; margin-right: 4px; }
/* review mode */
.opt.is-correct { background: #e7f4e4; outline: 1px solid #6aa84f; }
.opt.is-wrong   { background: #fbe6e2; outline: 1px solid #d0452b; }

.fb { margin-top: 12px; font-size: 13px; }
.sol {
  margin-top: 12px;
  border: 1px solid #cfe0ef;
  border-left: 4px solid #2d8fd5;
  background: #f6fafd;
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.sol h3 { margin: 0 0 4px; font-size: 13.5px; color: #1b1b8f; }
.sol .sol-note { color: #6b5310; font-size: 12px; margin: 0 0 6px; }

.review-banner {
  display: none;
  padding: 6px 12px;
  background: #e8f1fb;
  border-bottom: 1px solid #b9d2ea;
  color: #1b3f63;
  font-size: 12.5px;
}
.review-banner.show { display: block; }

/* fraction / radical rendering produced by the LaTeX converter */
.frac { display: inline-block; text-align: center; vertical-align: -0.55em; }
.frac sup, .frac sub {
  display: block;
  font-size: .78em;
  line-height: 1.05;
  padding: 0 .18em;
}
.frac sup { border-bottom: 1px solid currentColor; }
.rad { font-size: 1.05em; }
.radicand { border-top: 1px solid currentColor; padding: 0 .12em; }

.dtbl {
  border-collapse: collapse;
  margin: 6px 14px 10px 0;
  display: inline-table;
  vertical-align: top;
  font-size: 13px;
}
.dtbl th, .dtbl td {
  border: 1px solid #999;
  padding: 3px 9px;
  text-align: center;
}
.dtbl th { background: #eef2f6; }
.tbl-cap { margin: 4px 0; font-size: 13px; }
.tbl-note {
  margin: 2px 0 6px;
  font-size: 12px;
  color: #666;
  font-style: italic;
}

/* untranslated-section notice */
.notice {
  border: 1px solid #f0c36d;
  background: #fdf6e3;
  padding: 8px 11px;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.6;
  border-radius: 3px;
}
.notice b { color: #8a6d1f; }

/* machine-translation warning banner */
.mt-banner {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: #fff3cd;
  border-bottom: 1px solid #e0c675;
  color: #6b5310;
  font-size: 12.5px;
}
body.lang-ta .mt-banner { display: flex; }

/* footer buttons */
.footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 9px 12px;
  border-top: 1px solid #ccc;
  background: #fafafa;
}
.footer .spacer { flex: 1; }
.btn {
  font-family: inherit;
  font-size: 13px;
  padding: 7px 14px;
  border: 1px solid #b5b5b5;
  background: #fff;
  color: #111;
  cursor: pointer;
  border-radius: 2px;
  text-decoration: none;
  display: inline-block;
}
.btn:hover { background: #f0f0f0; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary {
  background: #1f77c1;
  border-color: #1a659f;
  color: #fff;
  font-weight: 600;
}
.btn-primary:hover { background: #1a67a8; }
.btn-submit {
  background: #7fb2d6;
  border-color: #6ba0c6;
  color: #fff;
  font-weight: 600;
}
.btn-submit:hover { background: #6ba0c6; }

/* ----------------------------------------------------------- right */

.side {
  flex: 0 0 300px;
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
}
.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid #ddd;
}
.avatar {
  width: 56px; height: 56px;
  border-radius: 3px;
  background: #c9d3dc linear-gradient(#dbe3ea, #b9c6d2);
  border: 1px solid #9fb0bf;
  display: flex; align-items: flex-end; justify-content: center;
  overflow: hidden;
}
.avatar svg { width: 46px; height: 46px; }
.profile .who { font-size: 15px; font-weight: 600; color: #2b4a63; }

.legend {
  padding: 8px 10px;
  border-bottom: 1px solid #ddd;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
  font-size: 11.5px;
  line-height: 1.3;
}
.legend .li { display: flex; align-items: center; gap: 6px; }
.legend .li.wide { grid-column: 1 / -1; }
.pill {
  flex: none;
  min-width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
}
/* palette / legend shapes, matching the official screen */
.pill.answered   { background: #6aa84f; clip-path: polygon(0 0,100% 0,100% 72%,50% 100%,0 72%); }
.pill.notans     { background: #d0452b; clip-path: polygon(0 0,100% 0,100% 72%,50% 100%,0 72%); }
.pill.notvisited { background: #e6e6e6; color: #333; border: 1px solid #b5b5b5; }
.pill.review     { background: #6d3f9e; border-radius: 50%; }
.pill.reviewans  { background: #6d3f9e; border-radius: 50%; position: relative; }
.pill.reviewans::after {
  content: "";
  position: absolute; right: -1px; bottom: -1px;
  width: 9px; height: 9px;
  background: #6aa84f;
  border: 1px solid #fff;
  border-radius: 2px;
}

.palette-head {
  background: #2d8fd5;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 5px 10px;
}
.palette-sub { padding: 6px 10px 2px; font-size: 12px; font-weight: 600; }
.palette {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 6px 10px 12px;
  background: #eaf4fb;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  align-content: start;
}
.pbtn {
  height: 34px;
  border: 1px solid #b5b5b5;
  background: #ececec;
  color: #222;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 2px;
}
.pbtn:hover { outline: 2px solid #2d8fd5; }
.pbtn.answered {
  background: #6aa84f; color: #fff; border-color: #58913f;
  clip-path: polygon(0 0,100% 0,100% 74%,50% 100%,0 74%);
  height: 38px;
}
.pbtn.notans {
  background: #d0452b; color: #fff; border-color: #b13a23;
  clip-path: polygon(0 0,100% 0,100% 74%,50% 100%,0 74%);
  height: 38px;
}
.pbtn.review { background: #6d3f9e; color: #fff; border-color: #5b3484; border-radius: 50%; }
.pbtn.reviewans {
  background: #6d3f9e; color: #fff; border-color: #5b3484; border-radius: 50%;
  box-shadow: inset -6px -6px 0 -2px #6aa84f;
}
.pbtn.current { outline: 3px solid #ff9800; outline-offset: 1px; }

.side-foot { padding: 8px 10px; border-top: 1px solid #ddd; text-align: center; }

/* --------------------------------------------------------- overlays */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100000;
}
.overlay.show { display: flex; }
.modal {
  background: #fff;
  color: #111;
  max-width: 560px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 4px;
  padding: 18px 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,.3);
  font-size: 14px;
  line-height: 1.55;
}
.modal h2 { margin: 0 0 10px; font-size: 17px; color: #1b1b8f; }
.modal p { margin: 0 0 10px; }
.modal .modal-lead { font-weight: 600; color: #2b4a63; }
.modal .small-note { font-size: 12.5px; color: #555; }
.modal table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 13px; }
.modal th, .modal td { border: 1px solid #bbb; padding: 5px 8px; text-align: center; }
.modal th { background: #eef2f6; }
.modal .modal-foot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.modal ol { padding-left: 20px; line-height: 1.65; }
.modal li { margin-bottom: 6px; }

.result-score {
  text-align: center;
  font-size: 15px;
  margin: 10px 0 4px;
}
.result-score .big { font-size: 30px; font-weight: 700; color: #1f77c1; }
.result-net { text-align: center; font-size: 13px; color: #444; margin-bottom: 6px; }

@media (max-width: 900px) {
  .shell { flex-direction: column; height: auto; min-height: 0; }
  .qbody { overflow: visible; }
  .side { flex: none; width: 100%; border-top: 2px solid #000; }
  .palette { max-height: 260px; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); }
  .main { border-right: none; }
}
@media (max-width: 600px) {
  .site-band { padding: 20px 16px 14px; }
  .band-title { font-size: 1.1rem; }
  .topbar { justify-content: flex-end; padding-right: 10px; }
  .topbar h1 { font-size: 13px; text-align: right; max-width: 70%; }
  .footer .btn { padding: 7px 10px; font-size: 12.5px; }
  .footer .spacer { display: none; }
  .passage { text-align: left; }
}
