:root {
  color-scheme: light;
  font-family: "Segoe UI", Arial, sans-serif;
  color: #17243a;
  background: #f3f5f8;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(ellipse at 50% 0, rgb(213 224 238 / 76%), transparent 58%),
    #f3f5f8;
}

.portal {
  width: min(100%, 760px);
  overflow: hidden;
  border: 1px solid #e4e9ef;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 70px rgb(23 36 58 / 10%);
}

.branding {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 8vw, 64px);
  min-height: 214px;
  padding: 32px 24px;
  background: #fbfcfd;
  border-bottom: 1px solid #edf0f4;
}

.brand-logo {
  display: block;
  width: 140px;
  height: 140px;
  object-fit: contain;
}

.brand-logo--college {
  width: 120px;
}

.branding-divider {
  width: 1px;
  height: 92px;
  background: #dce2e9;
}

.welcome {
  padding: clamp(38px, 8vw, 66px) 28px clamp(42px, 9vw, 72px);
  text-align: center;
}

.eyebrow {
  margin: 0 0 14px;
  color: #a77822;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  line-height: 1.6;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: #12233f;
  font-size: clamp(2rem, 7vw, 3.25rem);
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.intro {
  max-width: 440px;
  margin: 18px auto 28px;
  color: #596679;
  font-size: 1.04rem;
  line-height: 1.7;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid #e5e9ef;
  border-radius: 999px;
  background: #f8f9fb;
  color: #34445a;
  font-size: 0.9rem;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c28a2b;
  box-shadow: 0 0 0 4px rgb(194 138 43 / 13%);
}

.note {
  max-width: 420px;
  margin: 20px auto 0;
  color: #7a8594;
  font-size: 0.88rem;
  line-height: 1.7;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 14px 24px;
  border-top: 1px solid #edf0f4;
  color: #778293;
  font-size: 0.78rem;
}

.footer-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #12233f;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

@media (max-width: 440px) {
  .branding {
    min-height: 172px;
  }

  .brand-logo {
    width: 112px;
    height: 112px;
  }

  .brand-logo--college {
    width: 96px;
  }

  .branding-divider {
    height: 70px;
  }

  .footer {
    gap: 16px;
    font-size: 0.72rem;
  }
}

body.app-page {
  display: block;
  padding: 0;
  background: #f3f5f8;
}

.site-header {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 84px;
  padding: 12px clamp(18px, 5vw, 64px);
  border-bottom: 1px solid #e4e9ef;
  background: #fff;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #12233f;
  font-size: 1.05rem;
  font-weight: 750;
  text-decoration: none;
}

.brand-lockup img {
  width: auto;
  height: 48px;
  object-fit: contain;
}

.brand-lockup small {
  display: block;
  margin-top: 3px;
  color: #68768a;
  font-size: 0.72rem;
  font-weight: 500;
}

.page-shell {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  padding: 38px 0 64px;
}

.page-heading {
  margin: 0 0 26px;
}

.page-heading h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 5vw, 2.8rem);
}

.page-heading > p:last-child {
  max-width: 720px;
  margin: 0;
  color: #596679;
  line-height: 1.65;
}

.card {
  margin-bottom: 22px;
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid #e4e9ef;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 36px rgb(23 36 58 / 5%);
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
  color: #34445a;
  font-size: 0.88rem;
  font-weight: 650;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #d5dce5;
  border-radius: 9px;
  outline: none;
  background: #fff;
  color: #17243a;
  font: inherit;
  font-weight: 400;
}

.field textarea {
  min-height: 72px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #3e6ba2;
  box-shadow: 0 0 0 3px rgb(62 107 162 / 14%);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.form-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-wide {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.form-actions .small-note {
  flex: 1 1 280px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.button-primary {
  background: #17365e;
  color: #fff;
}

.button-primary:hover:not(:disabled) {
  background: #102a4b;
}

.button-outline {
  border-color: #ccd5e0;
  background: #fff;
  color: #203650;
}

.button-danger {
  background: #a73737;
  color: #fff;
}

.button-small {
  min-height: 34px;
  padding: 5px 10px;
  font-size: 0.78rem;
}

.small-note,
.muted {
  color: #778293;
  font-size: 0.84rem;
  line-height: 1.6;
}

.form-message {
  min-height: 1.4em;
  margin: 0;
  color: #52657d;
}

.is-error {
  color: #a12e2e !important;
}

.site-footer {
  padding: 20px;
  border-top: 1px solid #e4e9ef;
  background: #fff;
  color: #778293;
  text-align: center;
  font-size: 0.8rem;
}

.exam-toolbar,
.progress-row,
.exam-actions,
.section-heading,
.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.exam-toolbar h2,
.section-heading h2,
.section-heading h3,
.result-panel h2 {
  margin: 0;
  color: #12233f;
}

.timer {
  display: flex;
  min-width: 132px;
  flex-direction: column;
  align-items: center;
  padding: 10px 16px;
  border: 1px solid #e0e6ee;
  border-radius: 12px;
  background: #f8fafc;
}

.timer-label {
  color: #68768a;
  font-size: 0.73rem;
}

.timer strong {
  color: #17365e;
  font-variant-numeric: tabular-nums;
  font-size: 1.45rem;
}

.progress-row {
  margin: 24px 0 14px;
  color: #52657d;
  font-size: 0.86rem;
}

.question-card {
  padding: clamp(18px, 4vw, 30px);
  border: 1px solid #e4e9ef;
  border-radius: 14px;
  background: #fbfcfe;
}

.question-position {
  margin: 0 0 14px;
  color: #a77822;
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.question-text {
  color: #17243a;
  font-size: 1.06rem;
  font-weight: 600;
  line-height: 1.65;
  white-space: pre-wrap;
}

.answer-options {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.answer-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid #dce3eb;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.answer-option:has(input:checked) {
  border-color: #3e6ba2;
  background: #f0f5fb;
}

.option-marker {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 50%;
  background: #edf1f6;
  color: #33475e;
  font-weight: 750;
}

.answer-option input {
  position: absolute;
  opacity: 0;
}

.option-text {
  color: #34445a;
  line-height: 1.5;
  white-space: pre-wrap;
}

.exam-actions {
  justify-content: flex-end;
  margin-top: 20px;
}

.exam-actions #previous-question {
  margin-right: auto;
}

.result-score {
  color: #17365e;
  font-size: 1.6rem;
  font-weight: 750;
}

.answer-review {
  margin: 24px 0;
}

.answer-review p {
  padding: 12px 0;
  border-bottom: 1px solid #edf0f4;
  color: #52657d;
  line-height: 1.6;
}

.admin-shell {
  width: min(1320px, calc(100% - 36px));
}

.dashboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.8fr);
  align-items: start;
  gap: 22px;
}

.dashboard-grid > .card {
  min-width: 0;
}

.workspace-card {
  min-height: 360px;
}

.stack-form {
  display: grid;
  gap: 16px;
}

.login-card {
  width: min(100%, 480px);
  margin: 3vh auto;
}

.login-card > p:not(.eyebrow) {
  color: #68768a;
  line-height: 1.6;
}

.test-list,
.campus-list {
  display: grid;
  gap: 9px;
  margin: 18px 0;
}

.test-list-item {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr auto;
  gap: 5px 12px;
  padding: 12px;
  border: 1px solid #e3e8ee;
  border-radius: 10px;
  background: #fff;
  color: #203650;
  cursor: pointer;
  text-align: left;
}

.test-list-item.is-active {
  border-color: #3e6ba2;
  background: #f0f5fb;
}

.test-list-item small {
  grid-column: 1 / 2;
  color: #778293;
}

.status-tag {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: #edf1f6;
  color: #52657d;
  font-size: 0.72rem;
}

.status-published {
  background: #e7f4ec;
  color: #257046;
}

.status-closed {
  background: #fbecec;
  color: #9c3939;
}

.inline-form,
.action-row {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.inline-form .field {
  flex: 1 1 240px;
}

.campus-card {
  margin-top: 24px;
}

.campus-chip {
  width: fit-content;
  padding: 7px 11px;
  border: 1px solid #e3e8ee;
  border-radius: 999px;
  color: #52657d;
  font-size: 0.83rem;
}

.workspace-section {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid #e9edf2;
}

.settings-form {
  margin: 20px 0;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #52657d;
  font-size: 0.88rem;
}

.preview-section {
  padding: 18px;
  border: 1px solid #e4e9ef;
  border-radius: 12px;
  background: #fbfcfe;
}

.question-edit-card {
  display: grid;
  gap: 12px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #e3e8ee;
  border-radius: 10px;
  background: #fff;
}

.question-edit-card .form-grid {
  gap: 12px;
}

.question-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.question-list-item {
  padding: 14px;
  border: 1px solid #e3e8ee;
  border-radius: 10px;
  color: #34445a;
  line-height: 1.55;
}

.result-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  margin-top: 14px;
  border: 1px solid #e3e8ee;
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.83rem;
  text-align: left;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid #edf0f4;
  white-space: nowrap;
}

th {
  background: #f7f9fb;
  color: #52657d;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.results-pagination {
  align-items: center;
  justify-content: flex-end;
  margin-top: 14px;
}

.results-pagination .small-note {
  margin-right: auto;
}

.question-analysis {
  margin-top: 24px;
}

.question-analysis h4 {
  margin: 0;
  color: #203650;
}

.global-message {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 5;
  max-width: min(420px, calc(100% - 36px));
  padding: 14px 18px;
  border: 1px solid #d9e0e9;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 32px rgb(23 36 58 / 15%);
  color: #34445a;
}

@media (max-width: 760px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-heading {
    align-items: flex-start;
  }

  .result-filters {
    grid-template-columns: 1fr;
  }

  .exam-toolbar {
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .site-header {
    padding: 10px 16px;
  }

  .brand-lockup img {
    height: 40px;
  }

  .brand-lockup {
    gap: 6px;
    font-size: 0.9rem;
  }

  .brand-lockup small {
    font-size: 0.66rem;
  }

  .page-shell,
  .admin-shell {
    width: min(100% - 24px, 1120px);
    padding-top: 26px;
  }

  .form-grid,
  .form-grid-two {
    grid-template-columns: 1fr;
  }

  .exam-toolbar {
    flex-direction: column;
  }

  .timer {
    width: 100%;
    align-items: flex-start;
  }

  .exam-actions {
    flex-wrap: wrap;
  }

  .exam-actions #previous-question {
    margin-right: 0;
  }

  .dashboard-heading {
    flex-direction: column;
  }
}
