/* =========================================================
   REVIZEE — COMPONENT LIBRARY
   Every reusable UI piece lives here. One definition per
   component; pages compose these, they never redefine them.
========================================================= */




/* ===========================================================
   BUTTONS
=========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--btn-height);
  padding-inline: var(--space-4);
  border-radius: var(--radius-sm);
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background-color var(--transition-fast), border-color var(--transition-fast),
    color var(--transition-fast), box-shadow var(--transition-fast);
  user-select: none;
}




.btn:active:not([disabled]) {
  transform: translateY(1px);
}




.btn-sm {
  height: var(--btn-height-sm);
  padding-inline: var(--space-3);
  font-size: var(--font-size-xs);
}




.btn-lg {
  height: var(--btn-height-lg);
  padding-inline: var(--space-6);
  font-size: var(--font-size-base);
}




.btn-block {
  width: 100%;
}




/* Primary */
.btn-primary {
  background: var(--color-primary-500);
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-sm);
}




.btn-primary:hover:not([disabled]) {
  background: var(--color-primary-600);
  box-shadow: var(--shadow-md);
}




.btn-primary:focus-visible {
  outline: 2px solid var(--color-primary-400);
  outline-offset: 2px;
}




/* Secondary */
.btn-secondary {
  background: var(--color-primary-500);
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-sm);
}




.btn-secondary:hover:not([disabled]) {
  background: var(--color-primary-600);
}




/* Outline */
.btn-outline {
  background: transparent;
  border-color: var(--color-border-strong);
  color: var(--color-text-primary);
}




.btn-outline:hover:not([disabled]) {
  border-color: var(--color-primary-500);
  color: var(--color-primary-600);
  background: var(--color-primary-50);
}




/* Text */
.btn-text {
  background: transparent;
  color: var(--color-secondary-500);
  height: auto;
  padding-inline: var(--space-2);
}




.btn-text:hover:not([disabled]) {
  color: var(--color-secondary-600);
  text-decoration: underline;
}




/* Danger */
.btn-danger {
  background: var(--color-error);
  color: var(--color-text-inverse);
}




.btn-danger:hover:not([disabled]) {
  background: #DC2626;
}




/* Success */
.btn-success {
  background: var(--color-success);
  color: var(--color-text-inverse);
}




.btn-success:hover:not([disabled]) {
  background: #16A34A;
}




/* Disabled */
.btn[disabled] {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
  transform: none;
}




/* Loading */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}




.btn-loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}




.btn-outline.btn-loading::after,
.btn-text.btn-loading::after {
  border: 2px solid var(--color-border-strong);
  border-top-color: var(--color-primary-500);
}




@keyframes btn-spin {
  to { transform: rotate(360deg); }
}




/* Icon-only button */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast),
    border-color var(--transition-fast), box-shadow var(--transition-fast);
}




.btn-icon:hover:not([disabled]) {
  background: var(--color-bg-muted);
  color: var(--color-text-primary);
  border-color: var(--color-border-strong);
}




.btn-icon:focus-visible {
  outline: 2px solid var(--color-primary-400);
  outline-offset: 2px;
}




/* Profile avatar in header */
.site-header .btn-icon:has([data-user-initial]),
.site-header a.btn-icon[aria-label="Profile"] {
  background: var(--color-primary-500);
  border-color: var(--color-primary-500);
  color: var(--color-text-inverse);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}




.site-header .btn-icon:has([data-user-initial]):hover,
.site-header a.btn-icon[aria-label="Profile"]:hover {
  background: var(--color-primary-600);
  border-color: var(--color-primary-600);
  color: var(--color-text-inverse);
}




/* ===========================================================
   CARDS
=========================================================== */
.card {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}




.card-body {
  padding: var(--space-6);
}




/* App card — solid white surface (default across dashboard/library) */
.card-glass {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
  transition: border-color var(--transition-base), box-shadow var(--transition-base),
    transform var(--transition-base);
}




.card-glass:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-md);
}

.card-glass--emphasis {
  border-color: var(--color-primary-500);
  box-shadow: var(--shadow-md);
}

.card-glass--emphasis:hover {
  border-color: var(--color-primary-600);
}




/* Glass variant — hero / landing banners only */
.hero .card-glass,
.card-glass--hero {
  background: var(--glass-bg);
  border-color: var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-glass);
}




/* Statistics card (dashboard progress overview) */
.card-stat {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}




.card-stat:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-md);
}




.card-stat__value {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  line-height: 1;
  letter-spacing: var(--letter-spacing-tight);
}




.card-stat__label {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}




/* Question card (library / bookmarks list item) */
.card-question {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}




.card-question:hover {
  border-color: var(--color-primary-200);
  box-shadow: var(--shadow-md);
}




/* PDF card (library grid item) */
.card-pdf {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-base), box-shadow var(--transition-base),
    transform var(--transition-base);
  height: 100%;
}




.card-pdf:hover {
  border-color: var(--color-primary-200);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}




.card-pdf .card-feature__icon {
  width: 44px;
  height: 44px;
  margin-bottom: 0;
}




.card-pdf .text-h6 {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
}




/* Feature card (landing page) */
.card-feature {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  padding: var(--space-8);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}




.card-feature:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}




.card-feature__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--color-primary-50);
  color: var(--color-primary-600);
  margin-bottom: var(--space-4);
  flex-shrink: 0;
}




/* Pricing card */
.card-pricing {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}




.card-pricing--highlight {
  border: 2px solid var(--color-primary-500);
  box-shadow: var(--shadow-xl);
  position: relative;
}




/* ===========================================================
   BADGES / STATUS PILLS
=========================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-normal);
  text-transform: none;
}




.badge-success { background: var(--color-success-bg); color: var(--color-success-text); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning-text); }
.badge-error   { background: var(--color-error-bg);   color: var(--color-error-text); }
.badge-info    { background: var(--color-info-bg);    color: var(--color-secondary-600); }
.badge-neutral { background: var(--color-bg-muted);   color: var(--color-text-secondary); }




/* ===========================================================
   FORM INPUTS
=========================================================== */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}




.field-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
}




.field-hint {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}




.field-error {
  font-size: var(--font-size-xs);
  color: var(--color-error-text);
}




.input,
.textarea,
.select {
  width: 100%;
  height: var(--input-height);
  padding-inline: var(--space-3);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}




.input::placeholder,
.textarea::placeholder {
  color: var(--color-text-muted);
}




.input:hover,
.textarea:hover,
.select:hover {
  border-color: var(--color-text-muted);
}




.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 3px var(--color-primary-50);
}




.input.is-error,
.textarea.is-error,
.select.is-error {
  border-color: var(--color-error);
}




.input.is-error:focus,
.textarea.is-error:focus {
  box-shadow: 0 0 0 4px var(--color-error-bg);
}




.textarea {
  height: auto;
  min-height: 120px;
  padding-block: var(--space-3);
  resize: vertical;
}




.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234B5568' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-8);
}




/* Input with leading/trailing icon (search, password) */
.input-group {
  position: relative;
  display: flex;
  align-items: center;
}




.input-group .input {
  padding-left: var(--space-10);
}




.input-group__icon {
  position: absolute;
  left: var(--space-4);
  display: flex;
  align-items: center;
  color: var(--color-text-muted);
  pointer-events: none;
}




.input-group__action {
  position: absolute;
  right: var(--space-4);
  display: flex;
  align-items: center;
  color: var(--color-text-muted);
  background: none;
  border: none;
  cursor: pointer;
}




/* Checkbox */
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}




.checkbox input[type="checkbox"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--color-border-strong);
  background: var(--color-bg-surface);
  display: grid;
  place-content: center;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}




.checkbox input[type="checkbox"]::after {
  content: "";
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform var(--transition-fast);
}




.checkbox input[type="checkbox"]:checked {
  background: var(--color-primary-500);
  border-color: var(--color-primary-500);
}




.checkbox input[type="checkbox"]:checked::after {
  transform: rotate(45deg) scale(1);
}




/* Radio */
.radio {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}




.radio input[type="radio"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--color-border-strong);
  background: var(--color-bg-surface);
  display: grid;
  place-content: center;
  transition: border-color var(--transition-fast);
}




.radio input[type="radio"]::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-primary-500);
  transform: scale(0);
  transition: transform var(--transition-fast);
}




.radio input[type="radio"]:checked {
  border-color: var(--color-primary-500);
}




.radio input[type="radio"]:checked::after {
  transform: scale(1);
}




/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}




.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}




.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--color-border-strong);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition-fast);
}




.toggle-track::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}




.toggle input:checked + .toggle-track {
  background: var(--color-primary-500);
}




.toggle input:checked + .toggle-track::before {
  transform: translateX(20px);
}




/* ===========================================================
   MODALS
=========================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(20, 30, 50, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}




.modal {
  width: 100%;
  max-width: 440px;
  background: var(--color-bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: var(--space-8);
}




.modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
}




.modal-icon--warning { background: var(--color-warning-bg); color: var(--color-warning-text); }
.modal-icon--danger  { background: var(--color-error-bg);   color: var(--color-error-text); }
.modal-icon--success { background: var(--color-success-bg); color: var(--color-success-text); }




.modal-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-2);
}




.modal-body {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-6);
}




.modal-actions {
  display: flex;
  gap: var(--space-3);
}




.modal-actions .btn {
  flex: 1;
}




/* ===========================================================
   TOAST / NOTIFICATIONS
=========================================================== */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + var(--space-4));
  right: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 360px;
  width: 100%;
}




.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-lg);
  padding: var(--space-4);
  border-left: 4px solid var(--color-secondary-500);
}




.toast-success { border-left-color: var(--color-success); }
.toast-warning { border-left-color: var(--color-warning); }
.toast-error   { border-left-color: var(--color-error); }
.toast-info    { border-left-color: var(--color-secondary-500); }




.toast-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}




.toast-message {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}




.toast-close {
  margin-left: auto;
  color: var(--color-text-muted);
  background: none;
  border: none;
  cursor: pointer;
}




/* ===========================================================
   LOADERS
=========================================================== */
.loader-circular {
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary-500);
  border-radius: 50%;
  animation: loader-spin 0.8s linear infinite;
}




@keyframes loader-spin {
  to { transform: rotate(360deg); }
}




.loader-linear {
  width: 100%;
  height: 6px;
  background: var(--color-bg-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
}




.loader-linear__bar {
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, var(--color-primary-500), var(--color-primary-400));
  border-radius: var(--radius-full);
  animation: loader-slide 1.2s ease-in-out infinite;
}




@keyframes loader-slide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}




/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--color-bg-muted) 25%, #E8ECF3 37%, var(--color-bg-muted) 63%);
  background-size: 400% 100%;
  border-radius: var(--radius-sm);
  animation: skeleton-shimmer 1.4s ease infinite;
}




@keyframes skeleton-shimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}




.skeleton-text {
  height: 14px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
}




.skeleton-title {
  height: 22px;
  width: 60%;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-3);
}




.skeleton-card {
  height: 140px;
  border-radius: var(--radius-lg);
}




/* ===========================================================
   PROGRESS BAR (result / accuracy display)
=========================================================== */
.progress-bar {
  width: 100%;
  height: 10px;
  background: var(--color-bg-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
}




.progress-bar__fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-primary-500), var(--color-primary-400));
  transition: width var(--transition-slow) var(--easing-emphasized);
}




.progress-bar__fill--success { background: linear-gradient(90deg, var(--color-success), #34C98A); }
.progress-bar__fill--error   { background: linear-gradient(90deg, var(--color-error), #F0656A); }




/* ===========================================================
   QUESTION PALETTE (test engine side panel)
=========================================================== */
.palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-2);
}




.palette-item {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  background: var(--color-bg-muted);
  color: var(--color-text-secondary);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform var(--transition-fast);
}




.palette-item:hover {
  transform: translateY(-1px);
}




.palette-item--answered   { background: var(--color-success-bg); color: var(--color-success-text); }
.palette-item--unanswered { background: var(--color-bg-muted);   color: var(--color-text-secondary); }
.palette-item--marked     { background: var(--color-warning-bg); color: var(--color-warning-text); }
.palette-item--current    { border-color: var(--color-secondary-500); box-shadow: 0 0 0 3px var(--color-secondary-50); }




/* ===========================================================
   MOBILE NAV DRAWER
   Paired with router.js's initMobileNav(), which toggles
   [data-mobile-nav]'s "is-open" class via [data-nav-toggle].
=========================================================== */
.mobile-nav {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  background: var(--glass-bg-strong);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  padding: var(--space-2) var(--container-padding-mobile);
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-base), transform var(--transition-base), visibility var(--transition-base);
}




.mobile-nav.is-open {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
}




.mobile-nav__link {
  display: block;
  padding: var(--space-3) var(--space-1);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  border-bottom: 1px solid var(--color-divider);
}




.mobile-nav__link:last-child {
  border-bottom: none;
}




.mobile-nav__link.is-active {
  color: var(--color-primary-600);
}




/* ===========================================================
   BOOKMARK TOGGLE BUTTON
   Used in the test-review screen next to each question.
=========================================================== */
.bookmark-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-bg-muted);
  color: var(--color-text-muted);
  border: 1px solid transparent;
  flex: none;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}




.bookmark-btn:hover {
  background: var(--color-primary-50);
  color: var(--color-primary-600);
}




.bookmark-btn.is-active {
  background: var(--color-primary-50);
  color: var(--color-primary-600);
  border-color: var(--color-primary-200);
}




.bookmark-btn.is-active .bookmark-btn__icon svg {
  fill: currentColor;
}




/* ===========================================================
   EMPTY STATE
=========================================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-16) var(--space-6);
  color: var(--color-text-muted);
}




.empty-state__icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--color-bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
}




.empty-state__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}




/* ===========================================================
   CHECK LIST (pricing plan inclusions, feature bullets)
=========================================================== */
.check-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}




.check-list__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}




.check-list__icon {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-success-bg);
  color: var(--color-success-text);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}




/* ===========================================================
   PRICING PLAN DETAIL
=========================================================== */
.plan-name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary-600);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
}




.plan-price {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}




.plan-price__amount {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-extrabold);
  color: var(--color-text-primary);
}




.plan-price__period {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}




.plan-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-600));
  color: #fff;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-primary-glow);
}




/* ===========================================================
   FAQ ACCORDION (native <details>/<summary>, no JS needed)
=========================================================== */
.faq-item {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-5);
  margin-bottom: var(--space-3);
}




.faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-4);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
}




.faq-item summary::-webkit-details-marker {
  display: none;
}




.faq-item__icon {
  flex: none;
  color: var(--color-text-muted);
  transition: transform var(--transition-base);
}




.faq-item[open] .faq-item__icon {
  transform: rotate(45deg);
  color: var(--color-primary-500);
}




.faq-item__answer {
  padding-bottom: var(--space-4);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
}




/* ===========================================================
   ILLUSTRATION MOCKUP CARD
   Used in the hero section in place of a raster illustration —
   a lightweight glass mockup of the test interface itself.
=========================================================== */
.mockup-card {
  width: 100%;
  max-width: 380px;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-xl);
  padding: var(--space-6);
  position: relative;
}




.mockup-card::before {
  content: "";
  position: absolute;
  inset: -24px;
  z-index: -1;
  background: radial-gradient(circle, rgba(255, 122, 48, 0.16), transparent 70%);
  filter: blur(8px);
}




.mockup-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}




.mockup-card__option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  margin-bottom: var(--space-3);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}




.mockup-card__option--selected {
  border-color: var(--color-primary-400);
  background: var(--color-primary-50);
  color: var(--color-primary-700);
  font-weight: var(--font-weight-semibold);
}




.mockup-card__bullet {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  flex: none;
}




/* ===========================================================
   TEST ENGINE INTERFACE COMPONENTS (CBT / Testbook Style)
=========================================================== */


body.test-body {
  background-color: var(--color-bg-surface);
  font-family: var(--font-primary);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  color: var(--color-text-primary);
}


.test-app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}


/* HEADER BAR */
.tb-header {
  background: var(--cbt-header-bg);
  color: var(--cbt-header-text);
  height: var(--cbt-header-h);
  min-height: var(--cbt-header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}


.tb-header-left,
.tb-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
}


.tb-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: var(--cbt-radius);
  background: transparent;
  color: var(--cbt-header-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition-fast), color var(--transition-fast);
}


.tb-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--cbt-header-text);
}


.tb-icon-btn:focus-visible {
  outline: 2px solid var(--color-secondary-400);
  outline-offset: 2px;
}


.tb-timer-wrap {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-sm);
  font-family: var(--font-mono);
  color: var(--cbt-header-text);
  background: rgba(255, 255, 255, 0.08);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--cbt-radius);
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}


.tb-timer-wrap svg {
  color: var(--cbt-header-muted);
  flex-shrink: 0;
}


.tb-timer-wrap span {
  letter-spacing: 0.04em;
}


.tb-timer-wrap.is-warning {
  border-color: var(--cbt-timer-warn);
  color: var(--color-primary-200);
}


.tb-timer-wrap.is-danger {
  border-color: var(--cbt-timer-danger);
  color: #fecaca;
  animation: tb-timer-pulse 1s ease-in-out infinite;
}


@keyframes tb-timer-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}


.tb-test-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--cbt-header-muted);
  min-width: 0;
}


.tb-lang-toggle {
  color: var(--cbt-header-muted);
  font-size: var(--font-size-xs);
  flex-shrink: 0;
}


.tb-select-sm {
  appearance: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--cbt-radius);
  color: var(--cbt-header-text);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  padding: var(--space-1) var(--space-6) var(--space-1) var(--space-2);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-2) center;
}

.tb-select-sm:focus-visible {
  outline: 2px solid var(--color-secondary-400);
  outline-offset: 2px;
}

/* Fix dropdown option text contrast without breaking header UI */
.tb-select-sm option {
  color: #0f172a !important;
  background-color: #ffffff !important;
}

.tb-select-sm option:checked,
.tb-select-sm option:hover {
  color: #ffffff !important;
  background-color: #2563eb !important;
}


/* SECTIONS TAB */
.tb-section-bar {
  background: var(--cbt-section-bg);
  border-bottom: 1px solid var(--cbt-section-border);
  display: flex;
  align-items: flex-end;
  padding: 0 var(--space-5);
  height: var(--cbt-section-h);
  min-height: var(--cbt-section-h);
  gap: var(--space-3);
  flex-shrink: 0;
}


.tb-section-tabs {
  display: flex;
  align-items: flex-end;
  gap: var(--space-1);
}


.tb-section-tag {
  font-size: 0.6875rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  align-self: center;
  margin-right: var(--space-2);
}


.tb-section-btn {
  border: none;
  background: var(--cbt-teal);
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-inverse);
  border-radius: var(--cbt-radius) var(--cbt-radius) 0 0;
  cursor: pointer;
  line-height: 1.2;
  transition: background var(--transition-fast);
}


.tb-section-btn:hover {
  background: var(--cbt-teal-hover);
}


.tb-section-btn:focus-visible {
  outline: 2px solid var(--color-secondary-500);
  outline-offset: 2px;
}


/* MAIN CONTENT LAYOUT */
.tb-main {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
  min-height: 0;
}


.tb-question-container {
  flex: 1;
  background: var(--color-bg-surface);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: var(--space-4) var(--space-6);
  min-width: 0;
  height: 100%;
  max-height: 100%;
}


.tb-q-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-4);
  flex-shrink: 0;
}


.tb-q-number {
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
}


.tb-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 var(--space-2);
  border-radius: var(--cbt-radius);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
}


.tb-tag-time {
  background: var(--color-bg-muted);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}


.tb-tag-pos {
  background: var(--cbt-answered);
  color: var(--color-text-inverse);
}


.tb-tag-neg {
  background: var(--cbt-not-answered);
  color: var(--color-text-inverse);
}


.tb-icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: var(--cbt-radius);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}


.tb-icon-action:hover {
  background: var(--color-bg-muted);
  color: var(--color-text-primary);
}


.tb-icon-action:focus-visible {
  outline: 2px solid var(--color-secondary-500);
  outline-offset: 2px;
}


.tb-icon-action.is-active {
  color: var(--color-primary-500);
}


.tb-icon-action.is-active svg {
  fill: currentColor;
}

.tb-report-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  height: auto;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--color-border-strong, var(--color-border));
  border-radius: var(--cbt-radius);
  background: var(--color-bg-surface, #fff);
  color: var(--color-text-primary);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}

.tb-report-btn:hover {
  background: var(--color-bg-muted);
  border-color: var(--color-primary-500);
  color: var(--color-text-primary);
}

.tb-report-btn:focus-visible {
  outline: 2px solid var(--color-secondary-500);
  outline-offset: 2px;
}

.tb-report-modal {
  max-width: 440px;
  background: #ffffff;
}

.tb-report-reasons {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.tb-report-reason {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--cbt-radius);
  background: #ffffff;
  color: #0f172a;
  cursor: pointer;
  font-size: var(--font-size-sm);
}

.tb-report-reason:has(input:checked) {
  border-color: var(--color-primary-500);
  background: var(--color-primary-50, #eff6ff);
}
}


.tb-q-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.tb-q-body--long {
  gap: var(--space-2);
}


.tb-q-text {
  font-size: 1.1rem;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  white-space: pre-line;
  word-break: break-word;
  line-height: 1.5;
  max-width: 72ch;
  margin-bottom: var(--space-6);
  flex-shrink: 0;
}

.tb-q-text--medium {
  font-size: 0.95rem;
  line-height: 1.5;
}

.tb-q-text--long {
  font-size: 0.85rem;
  line-height: 1.45;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-1);
}

.tb-q-text .question-fig-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: var(--space-3) 0;
  border-radius: 8px;
  border: 1px solid var(--color-border-strong, #cbd5e1);
  background: #fff;
}

.tb-q-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  margin: var(--space-3) 0;
  -webkit-overflow-scrolling: touch;
}

.tb-q-text table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 280px;
}

.tb-q-text table th,
.tb-q-text table td {
  border: 1px solid var(--color-border-strong, #cbd5e1);
  padding: 0.375rem 0.5rem;
  text-align: left;
  vertical-align: top;
}

.tb-q-text table th {
  background: #f1f5f9;
  font-weight: 600;
}

.tb-q-figure-wrap {
  margin: 0 0 var(--space-4);
  max-width: min(100%, 560px);
  padding: 8px;
  border: 1px solid var(--color-border-strong, #d1d5db);
  border-radius: var(--cbt-radius, 8px);
  background: var(--color-bg-surface, #fff);
}

.tb-q-figure-wrap img,
.tb-q-figure {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 360px;
  height: auto;
  object-fit: contain;
  margin: 0;
  border: none;
  background: #fff;
}


/* OPTIONS (TESTBOOK STYLE) */
.tb-options-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 720px;
  width: 100%;
  flex-shrink: 0;
  margin-top: auto;
  padding-top: var(--space-2);
}

.tb-options-list--compact {
  gap: var(--space-2);
  padding-top: var(--space-1);
}


.tb-option-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  text-align: left;
  background: var(--color-bg-surface);
  border: 1.5px solid #a3b1c6;
  border-radius: var(--cbt-radius);
  padding: var(--space-3) var(--space-4);
  min-height: 48px;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast),
    box-shadow var(--transition-fast);
  font-size: var(--font-size-sm);
  color: #2c3e50;
}


.tb-option-item:hover {
  background: var(--color-bg-muted);
  border-color: #7b8da8;
}


.tb-option-item.selected {
  background: var(--cbt-answered-bg);
  border-color: var(--cbt-answered);
  box-shadow: 0 0 0 1px var(--cbt-answered);
  color: #2c3e50;
}


.tb-option-item.selected:hover {
  background: var(--cbt-answered-bg);
  border-color: #12803c;
}


.tb-opt-label,
.tb-opt-text {
  color: #2c3e50;
}


.tb-opt-label {
  font-weight: 700;
  flex: none;
}


.tb-opt-text {
  flex: 1;
  line-height: var(--line-height-normal);
  font-weight: 600;
}


.tb-opt-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-bold);
  font-size: 0.8rem;
  flex: none;
}


.tb-option-item.selected .tb-opt-badge {
  background: var(--cbt-answered);
  color: var(--color-text-inverse);
  border-color: var(--cbt-answered);
}


.tb-option-item.selected .tb-opt-label,
.tb-option-item.selected .tb-opt-text {
  color: #2c3e50;
}


.tb-option-item:focus-visible {
  outline: 2px solid var(--color-secondary-500);
  outline-offset: 2px;
}


/* RIGHT SIDEBAR - QUESTION PALETTE */
.tb-palette-sidebar {
  width: var(--cbt-sidebar-w);
  flex-shrink: 0;
  background: var(--cbt-palette-bg);
  border-left: 1px solid var(--cbt-palette-border);
  display: flex;
  flex-direction: column;
  padding: var(--space-3);
  overflow-y: auto;
}


.tb-palette-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  gap: var(--space-2);
}


.tb-palette-header h3 {
  margin: 0;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
}


.tb-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: none;
  font-size: var(--font-size-xl);
  line-height: 1;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: var(--cbt-radius);
}


.tb-close-btn:hover {
  background: rgba(255, 255, 255, 0.5);
  color: var(--color-text-primary);
}


.tb-close-btn:focus-visible {
  outline: 2px solid var(--color-secondary-500);
  outline-offset: 2px;
}


/* PALETTE LEGEND */
.tb-palette-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-3);
}


.tb-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  line-height: 1.3;
}


.badge-num {
  width: 18px;
  height: 18px;
  border-radius: var(--cbt-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-inverse);
  font-weight: var(--font-weight-bold);
  font-size: 0.625rem;
  flex-shrink: 0;
}


.badge-num.answered {
  background: var(--cbt-answered);
  border-radius: 10px 10px 0 0;
}


.badge-num.marked {
  background: var(--cbt-marked);
  border-radius: 50%;
}


.badge-num.not-visited {
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-strong);
}


.badge-num.not-answered {
  background: var(--cbt-not-answered);
  border-radius: 0 0 10px 10px;
}


.badge-num.marked-ans {
  background: var(--cbt-marked);
  border-radius: 50%;
  position: relative;
}


/* PALETTE BUTTONS GRID */
.tb-palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-2) var(--space-2);
  margin-bottom: var(--space-4);
}


.tb-palette-btn {
  width: 36px;
  height: 32px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-xs);
  cursor: pointer;
  border: 1px solid var(--color-border-strong);
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  border-radius: var(--cbt-radius);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}


.tb-palette-btn:hover {
  transform: scale(1.05);
}


.tb-palette-btn:focus-visible {
  outline: 2px solid var(--color-secondary-500);
  outline-offset: 2px;
  z-index: 1;
}


.tb-palette-btn.active {
  outline: 2px solid var(--cbt-header-bg);
  outline-offset: 2px;
  z-index: 1;
}


/* TESTBOOK SPECIFIC BUTTON SHAPES & COLORS */
.tb-palette-btn.not-visited {
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  border-color: var(--color-border);
}


.tb-palette-btn.answered {
  background: var(--cbt-answered);
  color: var(--color-text-inverse);
  border: none;
  border-radius: 12px 12px 2px 2px;
}


.tb-palette-btn.not-answered {
  background: var(--cbt-not-answered);
  color: var(--color-text-inverse);
  border: none;
  border-radius: 2px 2px 12px 12px;
}


.tb-palette-btn.marked {
  background: var(--cbt-marked);
  color: var(--color-text-inverse);
  border: none;
  border-radius: 50%;
}


.tb-palette-btn.marked-ans {
  background: var(--cbt-marked);
  color: var(--color-text-inverse);
  border: none;
  border-radius: 50%;
  position: relative;
}


.tb-palette-btn.marked-ans::after {
  content: "✓";
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 10px;
  color: var(--cbt-answered);
  background: var(--color-bg-surface);
  border-radius: 50%;
  width: 12px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* SIDEBAR FOOTER BUTTONS */
.tb-palette-footer {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: auto;
  padding-top: var(--space-3);
}


.tb-palette-footer .btn-row {
  display: flex;
  gap: var(--space-2);
}


.tb-palette-footer .btn {
  height: 38px;
  font-size: var(--font-size-xs);
}


/* BOTTOM FOOTER BAR */
.tb-footer {
  background: var(--color-bg-surface);
  border-top: 1px solid var(--color-border-strong);
  height: var(--cbt-footer-h);
  min-height: var(--cbt-footer-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
  flex-shrink: 0;
  gap: var(--space-3);
}


.tb-footer-left,
.tb-footer-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}


.tb-footer .btn {
  height: 40px;
  padding: 0 var(--space-4);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--cbt-radius);
  cursor: pointer;
  white-space: nowrap;
}


.btn-secondary-outline {
  border: 1px solid var(--color-border-strong);
  color: var(--color-text-secondary);
  background: var(--color-bg-surface);
}


.btn-secondary-outline:hover:not([disabled]) {
  border-color: var(--color-secondary-400);
  color: var(--color-secondary-600);
  background: var(--color-secondary-50);
}


.btn-ghost {
  border: none;
  background: transparent;
  color: var(--color-text-muted);
}


.btn-ghost:hover:not([disabled]) {
  color: var(--color-text-primary);
  background: var(--color-bg-muted);
}


.btn-teal {
  background: var(--cbt-teal);
  color: var(--color-text-inverse);
  border: none;
}


.btn-teal:hover:not([disabled]) {
  background: var(--cbt-teal-hover);
}


.btn-primary-tb {
  background: var(--cbt-primary-action);
  color: var(--color-text-inverse);
  border: none;
  box-shadow: var(--shadow-md);
}


.btn-primary-tb:hover:not([disabled]) {
  background: var(--cbt-primary-hover);
  transform: translateY(-1px);
}


.tb-footer .btn:focus-visible,
.tb-palette-footer .btn:focus-visible {
  outline: 2px solid var(--color-secondary-500);
  outline-offset: 2px;
}


/* SUBMIT MODAL TABLE */
.tb-submit-modal {
  max-width: 650px !important;
  width: 90%;
  background: var(--color-bg-surface);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
}


.tb-summary-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}


.tb-summary-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--space-3);
  font-size: var(--font-size-sm);
}


.tb-summary-table th {
  background: var(--cbt-teal);
  color: var(--color-text-inverse);
  padding: var(--space-2) var(--space-3);
  text-align: center;
  font-weight: var(--font-weight-semibold);
}


.tb-summary-table td {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  text-align: center;
}


/* TEST INFO MODALS (Question Paper & Instructions) */
.tb-test-info-modal-overlay {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: none;
}


.tb-test-info-modal {
  max-width: 700px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  border-radius: 12px;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}


.tb-test-info-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-surface);
  flex-shrink: 0;
}


.tb-test-info-modal-title {
  margin: 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
}


.tb-test-info-modal-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}


.tb-test-info-modal-close:hover {
  background: var(--color-bg-muted);
  color: var(--color-text-primary);
}


.tb-test-info-modal-body {
  overflow-y: auto;
  padding: var(--space-5);
  color: var(--color-text-primary);
}


.tb-qp-item {
  padding-bottom: var(--space-5);
  margin-bottom: var(--space-5);
  border-bottom: 1px solid var(--color-border);
}


.tb-qp-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}


.tb-qp-num {
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}


.tb-qp-text {
  margin: 0 0 var(--space-3);
  line-height: 1.5;
  white-space: pre-line;
  word-break: break-word;
  color: #2c3e50;
}


.tb-qp-options {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}


.tb-qp-option {
  font-size: var(--font-size-sm);
  color: #2c3e50;
  line-height: 1.5;
}


.tb-qp-option-label {
  font-weight: 700;
  margin-right: var(--space-2);
}


.tb-instructions-body {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}


.tb-instructions-section + .tb-instructions-section {
  margin-top: var(--space-5);
}


.tb-instructions-section h4 {
  margin: 0 0 var(--space-3);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}


.tb-instructions-section ul {
  margin: 0;
  padding-left: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}


.tb-instructions-legend {
  list-style: none;
  padding-left: 0;
}


.tb-instructions-legend li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}


.tb-instructions-swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  flex-shrink: 0;
}


.tb-instructions-swatch.answered { background: var(--cbt-answered); }
.tb-instructions-swatch.not-answered { background: var(--cbt-not-answered); }
.tb-instructions-swatch.marked { background: var(--cbt-marked); }
.tb-instructions-swatch.not-visited { background: var(--color-border-strong); }


/* Legacy button aliases (backward compatibility) */
.btn-mark-review {
  border: 1px solid var(--color-border-strong);
  color: var(--color-text-secondary);
  background: var(--color-bg-surface);
}


.btn-clear-resp {
  border: none;
  background: transparent;
  color: var(--color-text-muted);
}


.btn-save-next {
  background: var(--cbt-primary-action);
  color: var(--color-text-inverse);
  border: none;
}


.btn-qp,
.btn-inst {
  background: var(--color-secondary-100);
  color: var(--color-secondary-700);
}


.btn-submit-test {
  background: var(--cbt-teal);
  color: var(--color-text-inverse);
  font-size: var(--font-size-sm) !important;
  font-weight: var(--font-weight-bold) !important;
}


/* USER PROFILE CARD (optional sidebar element) */
.tb-user-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  background: rgba(255, 255, 255, 0.6);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--cbt-radius);
}


.tb-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}


.tb-user-name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
}

.qb-medium-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  width: 100%;
}

.qb-medium-btn {
  appearance: none;
  min-height: 44px;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--color-border-strong, var(--color-border));
  background: var(--color-bg-surface, #fff);
  color: var(--color-text-primary);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.qb-medium-btn:hover {
  border-color: var(--color-primary-500);
  background: var(--color-bg-muted, #f8fafc);
}

.qb-medium-btn.is-active,
.qb-medium-btn[aria-pressed="true"] {
  border-color: var(--color-primary-500);
  background: color-mix(in srgb, var(--color-primary-500) 12%, #fff);
  color: var(--color-primary-700, #1d4ed8);
  box-shadow: 0 0 0 1px var(--color-primary-500);
}

/* Question Bank & Mock Sets Grid Styling */
.qb-set-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  width: 100%;
  align-items: stretch;
  margin-top: 1rem;
}

@media (max-width: 1023px) {
  .qb-set-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 639px) {
  .qb-set-grid {
    grid-template-columns: 1fr;
  }
}

/* Header back control — readable ghost button, not muted caption text */
.qb-back-btn,
.site-header .qb-back-btn {
  height: auto;
  min-height: 40px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--color-text-primary);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-strong, var(--color-border));
  box-shadow: var(--shadow-sm);
}

.site-header .qb-back-btn:hover:not([disabled]) {
  color: var(--color-text-primary);
  background: var(--color-bg-muted);
  border-color: var(--color-primary-500);
}

/* Individual Set Card Styling */
.qb-set-grid > .qb-set-card,
.qb-set-card {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  height: 100%;
  min-width: 0;
  box-sizing: border-box;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.qb-set-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
}

.qb-set-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: #1e293b;
}

.qb-set-card p {
  font-size: 0.875rem;
  color: #64748b;
  margin-bottom: 1rem;
}

.qb-set-card .btn {
  width: 100%;
  margin-top: auto;
  flex-shrink: 0;
}

.qb-set-card.is-resume .qb-continue-btn,
.qb-continue-btn {
  background: var(--cbt-teal, #0d9488);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.qb-set-card.is-resume .qb-continue-btn:hover,
.qb-continue-btn:hover {
  background: var(--cbt-teal-hover, #0f766e);
}





