/* Researchium mock CBT — layout inspired by standard online assessment portals (original content only) */
* { box-sizing: border-box; margin: 0; padding: 0; }

body.gate-exam-body {
  font-family: Tahoma, Arial, Helvetica, sans-serif;
  font-size: 13px;
  color: #222;
  background: #e8e8e8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.gate-app-header {
  background: linear-gradient(180deg, #3d5a73 0%, #2c4558 100%);
  color: #fff;
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  border-bottom: 2px solid #1e3344;
}
.gate-app-brand { font-weight: 700; }
.gate-app-ver { opacity: 0.85; font-size: 11px; }

.gate-app-footer {
  margin-top: auto;
  padding: 8px;
  text-align: center;
  font-size: 11px;
  color: #666;
  background: #ddd;
  border-top: 1px solid #bbb;
}

.gate-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.gate-screen-title {
  background: #b8d4e8;
  border-bottom: 1px solid #7aa8c4;
  padding: 6px 14px;
  font-weight: 700;
  color: #1a3a4a;
}

/* —— Login panel (sign-in screen) —— */
.gate-login-panel {
  display: flex;
  max-width: 820px;
  margin: 24px auto;
  background: #fff;
  border: 2px solid #666;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.15);
}

.gate-login-main {
  flex: 1;
  padding: 20px 24px 24px;
  border-right: 1px solid #ccc;
}

.gate-login-photo {
  width: 200px;
  padding: 20px 16px;
  text-align: center;
  background: #f7f7f7;
}

.gate-info-table { width: 100%; border-collapse: collapse; }
.gate-info-table-spaced { margin-top: 16px; }
.gate-info-label {
  width: 140px;
  padding: 6px 8px 6px 0;
  font-weight: 600;
  vertical-align: top;
}
.gate-info-value { padding: 6px 0; }
.gate-info-highlight { color: #1565a8; font-weight: 700; }

.gate-verify-link {
  margin: 12px 0;
  font-size: 12px;
  color: #333;
}
.gate-verify-link a { color: #1565a8; }

.gate-login-actions {
  margin: 24px 0 16px;
  text-align: center;
}

.gate-btn-signin {
  padding: 10px 32px;
  font-size: 14px;
  font-weight: 700;
  background: #2e6da4;
  color: #fff;
  border: 1px solid #245682;
  cursor: pointer;
  border-radius: 3px;
}
.gate-btn-signin:hover { background: #245682; }

.gate-lang-row {
  font-size: 12px;
  color: #444;
  display: flex;
  align-items: center;
  gap: 8px;
}
.gate-lang-select {
  padding: 4px 8px;
  border: 1px solid #999;
  font-size: 12px;
}

.gate-photo-frame {
  width: 120px;
  height: 150px;
  margin: 0 auto;
  border: 2px solid #888;
  background: #e3edf5;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gate-photo-frame-sm { width: 90px; height: 110px; }
.gate-photo-frame-xs { width: 64px; height: 78px; }
.gate-photo-placeholder { font-size: 12px; color: #5a7a92; font-weight: 600; }
.gate-photo-caption { font-size: 11px; color: #666; margin-top: 8px; }

/* —— Instruction panels —— */
.gate-panel-layout {
  display: flex;
  flex: 1;
  background: #fff;
  margin: 0;
  border-bottom: 1px solid #ccc;
  min-height: calc(100vh - 120px);
}

.gate-panel-main {
  flex: 1;
  padding: 20px 28px 88px;
  overflow: auto;
  border-right: 1px solid #ccc;
}
.gate-panel-main-center { text-align: center; }

.gate-panel-side {
  width: 200px;
  padding: 20px 12px;
  background: #f5f5f5;
  text-align: center;
}

.gate-heading-center { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.gate-heading-sub { font-weight: 700; margin-bottom: 14px; }
.gate-instructions { text-align: left; max-width: 720px; margin: 0 auto; line-height: 1.55; }
.gate-instructions ol { margin-left: 22px; }
.gate-instructions li { margin-bottom: 8px; }

.gate-legend-table { border-collapse: collapse; margin: 10px 0; font-size: 12px; }
.gate-legend-table td { border: 1px solid #bbb; padding: 5px 10px; vertical-align: middle; }

.gate-palette-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.gate-palette-icon.not-visited { background: #9e9e9e; border-radius: 3px; }
.gate-palette-icon.not-answered { background: #c62828; clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%); }
.gate-palette-icon.answered { background: #2e7d32; clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%); }
.gate-palette-icon.marked { background: #7b1fa2; border-radius: 50%; }
.gate-palette-icon.answered-marked { background: #7b1fa2; border-radius: 50%; position: relative; }
.gate-palette-icon.answered-marked::after {
  content: "✓";
  position: absolute;
  right: -3px;
  bottom: -3px;
  background: #2e7d32;
  color: #fff;
  font-size: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  line-height: 12px;
}

.gate-paper-table { border-collapse: collapse; margin: 14px auto; }
.gate-paper-table th,
.gate-paper-table td { border: 1px solid #333; padding: 8px 18px; }
.gate-instr-summary { margin-bottom: 12px; }
.gate-instr-note { margin-top: 10px; font-size: 12px; color: #444; }

.gate-declare {
  display: flex;
  gap: 10px;
  text-align: left;
  max-width: 640px;
  margin: 20px auto 0;
  font-size: 12px;
  line-height: 1.45;
}

.gate-side-name { color: #1565a8; font-weight: 700; font-size: 12px; margin-top: 8px; }

.gate-footer-bar {
  position: fixed;
  bottom: 28px;
  left: 0;
  right: 0;
  background: #ececec;
  border-top: 1px solid #aaa;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  z-index: 50;
}

.gate-btn-nav {
  padding: 6px 20px;
  border: 1px solid #777;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}
.gate-btn-begin {
  padding: 10px 28px;
  background: #2e6da4;
  color: #fff;
  border: 1px solid #245682;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
}
.gate-btn-begin:disabled { opacity: 0.5; cursor: not-allowed; }

/* —— Live examination —— */
#view-exam.gate-screen { background: #fff; }

.gate-exam-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #d4e8f4;
  border-bottom: 2px solid #7aa8c4;
  padding: 6px 12px;
}

.gate-exam-subject-tab {
  background: #2e6da4;
  color: #fff;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 12px;
  border-radius: 2px;
}

.gate-exam-toolbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.gate-tool-btn {
  padding: 4px 12px;
  border: 1px solid #666;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.gate-timer {
  font-weight: 700;
  color: #b71c1c;
  font-size: 14px;
  min-width: 130px;
  text-align: right;
}

.gate-exam-body {
  display: flex;
  flex: 1;
  min-height: calc(100vh - 100px);
}

.gate-exam-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-right: 2px solid #999;
  min-width: 0;
}

.gate-section-tabs {
  display: flex;
  background: #eee;
  border-bottom: 1px solid #999;
}
.gate-exam-tab {
  padding: 8px 14px;
  border: none;
  border-right: 1px solid #bbb;
  background: #ddd;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #333;
}
.gate-exam-tab.active {
  background: #2e6da4;
  color: #fff;
}

.gate-question-panel {
  flex: 1;
  padding: 14px 18px;
  overflow: auto;
}

.gate-q-meta {
  display: flex;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid #ccc;
  font-size: 12px;
  color: #444;
  flex-wrap: wrap;
  gap: 8px;
}

.gate-q-text { font-size: 14px; margin: 12px 0 6px; }
.gate-q-body { margin-bottom: 14px; line-height: 1.5; font-size: 14px; }

.gate-options label {
  display: block;
  margin: 8px 0;
  padding: 6px 8px;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 2px;
}
.gate-options label:hover { background: #f0f7fc; }
.gate-options input { margin-right: 8px; }

.gate-exam-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #f0f0f0;
  border-top: 1px solid #bbb;
  flex-wrap: wrap;
  gap: 8px;
}
.gate-exam-actions-left { display: flex; flex-wrap: wrap; gap: 6px; }

.gate-btn-action {
  padding: 6px 14px;
  border: 1px solid #666;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
}
.gate-btn-save { font-weight: 700; background: #e8f4fc; }

.gate-exam-palette {
  width: 260px;
  flex-shrink: 0;
  padding: 10px;
  background: #fafafa;
  overflow-y: auto;
  font-size: 11px;
}

.gate-palette-profile {
  text-align: center;
  padding-bottom: 10px;
  border-bottom: 1px solid #ccc;
  margin-bottom: 10px;
}

.gate-palette-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}
.gate-stat {
  background: #fff;
  border: 1px solid #bbb;
  padding: 6px;
  text-align: center;
  font-size: 10px;
}
.gate-stat-n { display: block; font-size: 16px; font-weight: 700; }
.gate-stat-red { color: #c62828; }
.gate-stat-green { color: #2e7d32; }
.gate-stat-purple { color: #7b1fa2; }

.gate-palette-legend-title { font-weight: 700; margin-bottom: 4px; }
.gate-palette-section { font-weight: 600; color: #2e6da4; margin-bottom: 4px; }
.gate-palette-hint { margin-bottom: 8px; color: #555; }

.gate-q-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  margin-bottom: 12px;
}

.gate-q-btn {
  aspect-ratio: 1;
  border: 1px solid #666;
  background: #9e9e9e;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  min-height: 28px;
}
.gate-q-btn.not-answered { background: #c62828; }
.gate-q-btn.answered { background: #2e7d32; }
.gate-q-btn.marked { background: #7b1fa2; border-radius: 50%; }
.gate-q-btn.answered-marked { background: #7b1fa2; border-radius: 50%; box-shadow: inset 0 0 0 2px #2e7d32; }
.gate-q-btn.current { outline: 2px solid #2e6da4; outline-offset: 1px; }
.gate-q-btn.review-correct { background: #2e7d32; }
.gate-q-btn.review-wrong { background: #c62828; }
.gate-q-btn.review-skipped { background: #f57c00; }

.gate-score-strip {
  margin: 0;
  padding: 14px 18px;
  background: linear-gradient(135deg, #4c1d95, #6d28d9);
  color: #fff;
  border-bottom: 2px solid #3b0764;
}
.gate-score-strip__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.gate-score-strip__title { font-size: 15px; font-weight: 700; margin: 0 0 4px; }
.gate-score-strip__sub { font-size: 12px; margin: 0; opacity: 0.9; }
.gate-score-strip__pct { font-size: 28px; font-weight: 800; margin: 0; line-height: 1; }
.gate-score-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.gate-score-card {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 10px 8px;
  text-align: center;
}
.gate-score-card__val { display: block; font-size: 18px; font-weight: 700; }
.gate-score-card__lbl { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.85; }
.gate-score-strip__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}
.gate-score-strip__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.gate-score-strip__actions .gate-btn-nav,
.gate-score-strip__actions button.gate-btn-nav {
  display: inline-block;
  text-decoration: none;
  white-space: nowrap;
}
.gate-solutions-aside {
  display: none;
  flex-direction: column;
  width: min(42vw, 440px);
  min-width: 280px;
  max-width: 480px;
  border-left: 2px solid #999;
  background: #f8fafc;
  overflow: hidden;
}
.gate-solutions-aside__head {
  flex-shrink: 0;
  padding: 10px 12px;
  background: #e8f0f8;
  border-bottom: 1px solid #b8c9dc;
}
.gate-solutions-aside__title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  color: #1e3a5f;
}
.gate-solutions-aside__hint {
  margin: 0;
  font-size: 11px;
  color: #555;
  line-height: 1.4;
}
.gate-solutions-aside__body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px 16px;
  -webkit-overflow-scrolling: touch;
}
.gate-integrated-review .gate-solutions-aside {
  display: flex;
}
.gate-integrated-review.gate-solutions-collapsed .gate-solutions-aside {
  display: none;
}
.gate-integrated-review .gate-exam-left {
  min-width: 0;
}
@media (max-width: 960px) {
  .gate-integrated-review .gate-exam-body {
    flex-wrap: wrap;
  }
  .gate-integrated-review .gate-solutions-aside {
    width: 100%;
    max-width: none;
    min-width: 0;
    max-height: 42vh;
    border-left: none;
    border-top: 2px solid #999;
  }
}
.gate-score-strip__hint { opacity: 0.92; max-width: 420px; }
.gate-score-strip__foot .gate-btn-nav {
  background: #fff;
  color: #4c1d95;
  border-color: #fff;
  text-decoration: none;
  padding: 6px 14px;
}

.gate-review-mode .gate-exam-actions { display: none; }
.gate-review-mode #btnSubmitExam { display: none; }
.gate-review-mode #btnCalculator { display: none; }
.gate-integrated-review .gate-score-strip__hint {
  max-width: none;
}

.gate-solution-panel {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid #c9d8ef;
  border-left: 4px solid #2e6da4;
  background: #f0f7ff;
  font-size: 13px;
  line-height: 1.55;
}
.gate-solution-panel.gate-solution--correct { border-left-color: #2e7d32; background: #ecfdf5; }
.gate-solution-panel.gate-solution--incorrect { border-left-color: #c62828; background: #fef2f2; }
.gate-solution-panel.gate-solution--skipped { border-left-color: #f57c00; background: #fff8e6; }
.gate-solution-panel strong { display: block; margin-bottom: 6px; font-size: 13px; }
.gate-solution-panel p { margin: 4px 0; }
.gate-solution-panel .gs-solution-head { margin-top: 10px; }
.gate-solution-panel .gs-correct-pick { color: #065f46; margin: 0 0 6px; font-weight: 400; }
.gate-solution-panel .gs-correct-pick strong,
.gate-solution-panel .gs-your-pick strong { display: inline; margin: 0; }
.gate-solution-panel .gs-your-pick { margin: 0 0 8px; }
.gate-solution-panel .gs-your-pick--bad { color: #991b1b; }
.gate-solution-panel .gs-your-pick--ok { color: #065f46; }
.gate-solution-panel .gs-explanation--main {
  margin: 10px 0;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 6px;
  border-left: 3px solid #93c5fd;
}
.gate-solution-panel .gs-explanation--main strong { display: inline; }
.gate-solution-panel .gs-option-details { margin-top: 10px; padding-top: 10px; border-top: 1px dashed #ccc; }
.gate-solution-panel .gs-option-details__title { margin: 0 0 8px; }
.gate-solution-panel .gs-option-details__title strong { display: inline; }
.gate-solution-panel .gs-option-details__list { list-style: none; padding: 0; margin: 0; }
.gate-solution-panel .gs-opt-detail {
  font-size: 12px;
  line-height: 1.5;
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: 6px;
  border: 1px solid #ddd;
  background: rgba(255, 255, 255, 0.7);
}
.gate-solution-panel .gs-opt-detail--correct { background: #e8f5e9; border-color: #81c784; }
.gate-solution-panel .gs-opt-detail--wrong-pick { background: #ffebee; border-color: #e57373; }
.gate-solution-panel .gs-opt-detail__key { font-weight: 700; }
.gate-solution-panel .gs-opt-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
}
.gate-solution-panel .gs-opt-tag--ok { background: #c8e6c9; color: #1b5e20; }
.gate-solution-panel .gs-opt-tag--bad { background: #ffcdd2; color: #b71c1c; }
.gate-solution-panel .gs-understanding,
.gate-solution-panel .gs-solution-steps,
.gate-solution-panel .gs-concept-box {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.55;
}
.gate-solution-panel .gs-understanding {
  padding: 10px 12px;
  background: #f0f4ff;
  border-left: 3px solid #5c6bc0;
  border-radius: 6px;
}
.gate-solution-panel .gs-solution-steps__body {
  margin: 6px 0 0;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  white-space: pre-wrap;
  line-height: 1.65;
}
.gate-solution-panel .gs-concept-box {
  padding: 10px 12px;
  background: #e3f2fd;
  border-left: 3px solid #1976d2;
  border-radius: 6px;
}
.gate-solution-panel .gs-understanding strong,
.gate-solution-panel .gs-solution-steps strong,
.gate-solution-panel .gs-concept-box strong { display: inline; margin: 0; }
.gate-solution-loading {
  margin: 8px 0 0;
  font-size: 12px;
  color: #5c6bc0;
  font-style: italic;
}

.gate-options label.gate-opt-correct {
  border: 2px solid #2e7d32;
  background: #e8f5e9;
}
.gate-options label.gate-opt-wrong {
  border: 2px solid #c62828;
  background: #ffebee;
}
.gate-options label.gate-opt-neutral {
  opacity: 0.85;
}
.gate-review-mode .gate-options input[type="radio"] {
  pointer-events: none;
}

.gate-btn-submit-exam {
  width: 100%;
  padding: 10px;
  border: 2px solid #333;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
  font-size: 12px;
}
.gate-btn-submit-exam:hover { background: #ffe0e0; }
.gate-btn-submit-exam:disabled {
  opacity: 0.7;
  cursor: wait;
}
.gate-submit-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  vertical-align: -2px;
  border: 2px solid #666;
  border-top-color: transparent;
  border-radius: 50%;
  animation: gate-submit-spin 0.7s linear infinite;
}
.gate-submit-spinner.gate-hidden { display: none; }
@keyframes gate-submit-spin {
  to { transform: rotate(360deg); }
}

/* Result */
.gate-result-panel {
  max-width: 480px;
  margin: 40px auto;
  padding: 28px;
  background: #fff;
  border: 2px solid #666;
  text-align: center;
}
.gate-result-score { font-size: 18px; font-weight: 700; margin: 12px 0 8px; color: #2e6da4; }
.gate-result-detail {
  color: #555;
  font-size: 13px;
  margin: 0 0 4px;
  line-height: 1.5;
}
.gate-result-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-top: 20px;
  width: 100%;
}
.gate-result-actions .gate-btn-begin,
.gate-result-actions .gate-btn-nav,
.gate-result-actions a.gate-btn-begin {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-decoration: none;
  text-align: center;
  line-height: 1.35;
}
.gate-result-actions a.gate-btn-begin:hover,
.gate-result-actions a.gate-btn-begin:focus {
  color: #fff;
  text-decoration: none;
}
.gate-result-actions__primary {
  padding: 12px 16px;
}
.gate-result-actions__secondary {
  padding: 10px 16px;
}

.gate-load-error {
  margin: 0 0 14px;
  padding: 12px 14px;
  background: #fff3cd;
  border: 1px solid #c9a227;
  color: #664d03;
  font-size: 13px;
  line-height: 1.5;
}

.gate-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.gate-modal-box {
  background: #fff;
  border: 2px solid #666;
  padding: 20px 24px;
  max-width: 360px;
  text-align: center;
}
.gate-modal-title { font-weight: 700; margin-bottom: 10px; }
.gate-modal-text { font-size: 12px; margin-bottom: 14px; color: #444; line-height: 1.55; }

.gate-modal-box--confirm {
  max-width: 400px;
  text-align: left;
}

.gate-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.gate-modal-actions .gate-btn-submit-exam {
  min-width: 100px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
}

.gate-hidden { display: none !important; }

@media (max-width: 768px) {
  .gate-login-panel { flex-direction: column; margin: 12px; }
  .gate-login-photo { width: 100%; border-top: 1px solid #ccc; }
  .gate-panel-layout { flex-direction: column; }
  .gate-panel-side { width: 100%; }
  .gate-exam-body { flex-direction: column; }
  .gate-exam-palette { width: 100%; }
  .gate-q-grid { grid-template-columns: repeat(8, 1fr); }
}
