﻿html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html { font-size: 16px; }
}

:root {
  --smartexam-primary: #0b3a82;
  --smartexam-primary-soft: #eef4ff;
  --smartexam-border: #dfe5ee;
  --smartexam-surface: #ffffff;
  --smartexam-page-bg: #f6f8fb;
  --smartexam-text-muted: #687386;
  --smartexam-sidebar-width: 248px;

  /* 6-2 Design System */
  --smartexam-primary-hover: #082f6a;
  --smartexam-success: #16794b;
  --smartexam-success-soft: #eaf7f0;
  --smartexam-warning: #9a6700;
  --smartexam-warning-soft: #fff7df;
  --smartexam-danger: #b42318;
  --smartexam-danger-soft: #fff0ef;
  --smartexam-info: #175cd3;
  --smartexam-info-soft: #eff8ff;
  --smartexam-neutral-soft: #f2f4f7;
  --smartexam-text: #202938;
  --smartexam-text-subtle: #475467;

  --smartexam-radius-sm: .5rem;
  --smartexam-radius-md: .75rem;
  --smartexam-radius-lg: 1rem;
  --smartexam-shadow-sm: 0 1px 3px rgba(16, 24, 40, .08);
  --smartexam-shadow-md: 0 8px 24px rgba(16, 24, 40, .10);

  --smartexam-space-1: .25rem;
  --smartexam-space-2: .5rem;
  --smartexam-space-3: .75rem;
  --smartexam-space-4: 1rem;
  --smartexam-space-5: 1.5rem;
  --smartexam-space-6: 2rem;
}

body.smartexam-body {
  margin-bottom: 60px;
  background: var(--smartexam-page-bg);
  color: #202938;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(37, 140, 251, .35);
}

.smartexam-header { z-index: 1030; }
.brand-logo { width: 36px; height: 36px; object-fit: contain; }
.brand-title { font-weight: 700; color: var(--smartexam-primary); letter-spacing: .02em; }

.smartexam-primary-nav .nav-link {
  color: #344054;
  border-radius: .5rem;
  margin-inline: .1rem;
  padding-inline: .8rem;
}

.smartexam-primary-nav .nav-link:hover,
.smartexam-primary-nav .nav-link.active {
  color: var(--smartexam-primary);
  background: var(--smartexam-primary-soft);
}

.smartexam-page-shell { min-height: calc(100vh - 150px); }
.smartexam-management-layout { display: flex; align-items: stretch; min-height: calc(100vh - 150px); }

.smartexam-sidebar {
  width: var(--smartexam-sidebar-width);
  flex: 0 0 var(--smartexam-sidebar-width);
  background: var(--smartexam-surface);
  border-right: 1px solid var(--smartexam-border);
  padding: 1.25rem .9rem;
  position: sticky;
  top: 61px;
  height: calc(100vh - 61px);
  overflow-y: auto;
}

.smartexam-main-content {
  flex: 1 1 auto;
  min-width: 0;
  padding: 1rem 1.25rem 2rem;
}

.smartexam-management-nav { padding: .5rem; }
.smartexam-nav-section-title {
  color: var(--smartexam-text-muted);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  padding: .55rem .75rem .4rem;
}

.smartexam-management-link {
  display: block;
  color: #344054;
  text-decoration: none;
  border-radius: .55rem;
  padding: .72rem .8rem;
  margin-bottom: .15rem;
}

.smartexam-management-link:hover,
.smartexam-management-link.active {
  color: var(--smartexam-primary);
  background: var(--smartexam-primary-soft);
  font-weight: 600;
}

.smartexam-mobile-management-bar { position: sticky; top: 61px; z-index: 1020; }
.smartexam-management-offcanvas { width: min(86vw, 320px); }
.smartexam-breadcrumb { margin-bottom: .5rem; padding: .65rem .2rem; font-size: .9rem; }
.smartexam-breadcrumb a { color: var(--smartexam-primary); text-decoration: none; }

.card { border-color: var(--smartexam-border); border-radius: .75rem; }
.card-header { background: #fff; border-bottom-color: var(--smartexam-border); }
.table-responsive { border-radius: 0 0 .75rem .75rem; }

.login-info-button { border: 0; background: transparent; }

@media (max-width: 991.98px) {
  .smartexam-main-content { padding: .75rem .75rem 1.5rem; width: 100%; }
  .navbar-collapse { padding-top: .75rem; max-height: calc(100vh - 70px); overflow-y: auto; }
  .smartexam-primary-nav .nav-link { margin-block: .1rem; }
  .navbar-nav .dropdown-menu { border: 0; background: #f8fafc; margin-left: .5rem; }
  .smartexam-breadcrumb { padding-inline: .25rem; overflow-x: auto; white-space: nowrap; }
}

@media (max-width: 575.98px) {
  .brand-title { display: none !important; }
  .smartexam-main-content { padding-inline: .5rem; }
  .btn-group { max-width: 100%; flex-wrap: wrap; }
  .table-responsive { font-size: .9rem; }
}

/* 登入資訊 Modal：移至 body 後使用 Bootstrap 標準層級 */
.login-info-modal {
  z-index: 1060;
}

.login-info-modal .modal-dialog {
  position: relative;
  z-index: 1061;
}


/* 練習作答操作列：危險操作靠左，主要操作固定靠右 */
.practice-action-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--smartexam-border);
}

.practice-action-danger,
.practice-action-primary {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.practice-action-danger {
  flex: 1 1 auto;
  flex-wrap: wrap;
}

.practice-action-primary {
  flex: 0 0 auto;
  margin-left: auto;
}

.practice-action-primary .btn {
  min-width: 104px;
  font-weight: 600;
}

@media (max-width: 575.98px) {
  .practice-action-bar {
    gap: .75rem;
  }

  .practice-action-danger {
    max-width: calc(100% - 98px);
    gap: .4rem;
  }

  .practice-action-danger .btn {
    width: auto;
    max-width: 100%;
    white-space: normal;
    text-align: left;
    font-size: .82rem;
    line-height: 1.25;
    padding: .45rem .6rem;
  }

  .practice-action-primary {
    align-self: flex-end;
  }

  .practice-action-primary .btn {
    min-width: 88px;
    padding-inline: .7rem;
  }
}

/* UIUX-EXAM-ACTION-V3
   正式考試操作列採兩欄 Grid，不依賴 Bootstrap 的 ms-auto。 */
#examActionBar.exam-submit-action-bar {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  column-gap: 1rem !important;
  width: 100% !important;
  margin-top: 1.5rem !important;
  padding-top: 1rem !important;
  border-top: 1px solid var(--smartexam-border) !important;
}

#examActionBar .exam-submit-danger {
  min-width: 0;
  justify-self: start;
}

#examActionBar .exam-submit-primary {
  justify-self: end !important;
}

#examActionBar .exam-submit-primary .btn {
  min-width: 132px;
  font-weight: 600;
}

@media (max-width: 575.98px) {
  #examActionBar.exam-submit-action-bar {
    grid-template-columns: minmax(0, 1fr) auto !important;
    column-gap: .75rem !important;
  }

  #examActionBar .exam-submit-danger .btn {
    max-width: 100%;
    white-space: normal;
    text-align: left;
    font-size: .82rem;
    line-height: 1.25;
    padding: .45rem .6rem;
  }

  #examActionBar .exam-submit-primary .btn {
    min-width: 118px;
    padding-inline: .7rem;
  }
}

/* =========================================================
   6-2 Design System 與共用元件
   ========================================================= */
.smartexam-content-container {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-block: .5rem 1.5rem;
}

.smartexam-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.smartexam-page-heading { min-width: 0; }
.smartexam-page-title {
  margin: 0 0 .35rem;
  color: var(--smartexam-text);
  font-size: clamp(1.55rem, 2vw, 2.15rem);
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -.02em;
}
.smartexam-page-description {
  margin: 0;
  color: var(--smartexam-text-muted);
  line-height: 1.65;
}
.smartexam-page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: .5rem;
}

.smartexam-section-card,
.smartexam-feature-card,
.smartexam-filter-card,
.smartexam-table-card,
.smartexam-chart-card,
.smartexam-stat-card {
  border: 1px solid var(--smartexam-border);
  border-radius: var(--smartexam-radius-lg);
  background: var(--smartexam-surface);
  box-shadow: var(--smartexam-shadow-sm);
}

.smartexam-section-card > .card-header,
.smartexam-filter-card > .card-header,
.smartexam-table-card > .card-header,
.smartexam-chart-card > .card-header {
  padding: 1rem 1.15rem;
  font-weight: 700;
  background: transparent;
}

.smartexam-feature-card {
  height: 100%;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.smartexam-feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--smartexam-shadow-md);
  border-color: #c9d4e5;
}
.smartexam-feature-card .card-title { font-weight: 700; }
.smartexam-feature-card .card-text { color: var(--smartexam-text-muted); }

.smartexam-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.smartexam-stat-card { padding: 1rem 1.1rem; min-width: 0; }
.smartexam-stat-label { color: var(--smartexam-text-muted); font-size: .9rem; }
.smartexam-stat-value {
  margin-top: .25rem;
  color: var(--smartexam-text);
  font-size: clamp(1.55rem, 2.6vw, 2.25rem);
  font-weight: 750;
  line-height: 1.15;
}
.smartexam-stat-help { margin-top: .35rem; color: var(--smartexam-text-muted); font-size: .82rem; }
.smartexam-stat-card.is-success { border-top: 3px solid var(--smartexam-success); }
.smartexam-stat-card.is-warning { border-top: 3px solid var(--smartexam-warning); }
.smartexam-stat-card.is-danger { border-top: 3px solid var(--smartexam-danger); }
.smartexam-stat-card.is-info { border-top: 3px solid var(--smartexam-info); }

.smartexam-filter-card { margin-bottom: 1.5rem; }
.smartexam-filter-card .card-body { padding: 1rem 1.15rem 1.15rem; }
.smartexam-filter-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1rem; }
.smartexam-filter-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  padding-top: .25rem;
}

.smartexam-table-card { overflow: hidden; }
.smartexam-table-card .table-responsive { border-radius: 0; }
.smartexam-data-table { margin-bottom: 0; vertical-align: middle; }
.smartexam-data-table thead th {
  padding: .8rem .85rem;
  color: var(--smartexam-text-subtle);
  background: #f8fafc;
  border-bottom-width: 1px;
  white-space: nowrap;
  font-size: .88rem;
  font-weight: 700;
}
.smartexam-data-table tbody td { padding: .8rem .85rem; }
.smartexam-data-table tbody tr:hover { background: #fafcff; }
.smartexam-table-number { text-align: right; font-variant-numeric: tabular-nums; }
.smartexam-table-actions { white-space: nowrap; }
.smartexam-table-actions .btn { margin: .12rem; }

.smartexam-status-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .55rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.1;
}
.smartexam-badge-success { color: #08633b; background: var(--smartexam-success-soft); }
.smartexam-badge-warning { color: #7a5200; background: var(--smartexam-warning-soft); }
.smartexam-badge-danger { color: #912018; background: var(--smartexam-danger-soft); }
.smartexam-badge-info { color: #1849a9; background: var(--smartexam-info-soft); }
.smartexam-badge-neutral { color: #475467; background: var(--smartexam-neutral-soft); }

.smartexam-empty-state {
  padding: clamp(2rem, 7vw, 4.5rem) 1rem;
  text-align: center;
  border: 1px dashed #cfd8e6;
  border-radius: var(--smartexam-radius-lg);
  background: #fbfcfe;
}
.smartexam-empty-title { margin-bottom: .4rem; font-size: 1.15rem; font-weight: 700; }
.smartexam-empty-description { max-width: 620px; margin: 0 auto; color: var(--smartexam-text-muted); }
.smartexam-empty-action { margin-top: 1rem; }

.smartexam-alert {
  border: 1px solid transparent;
  border-radius: var(--smartexam-radius-md);
  padding: .9rem 1rem;
}
.alert-success { color: #08633b; background: var(--smartexam-success-soft); border-color: #b7e2ca; }
.alert-warning { color: #795400; background: var(--smartexam-warning-soft); border-color: #f0d58a; }
.alert-danger { color: #912018; background: var(--smartexam-danger-soft); border-color: #f0b7b2; }
.alert-info { color: #1849a9; background: var(--smartexam-info-soft); border-color: #b9d8ff; }

.btn { border-radius: var(--smartexam-radius-sm); font-weight: 600; }
.btn-primary { background: var(--smartexam-primary); border-color: var(--smartexam-primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--smartexam-primary-hover); border-color: var(--smartexam-primary-hover); }
.btn-danger { background: var(--smartexam-danger); border-color: var(--smartexam-danger); }
.btn-success { background: var(--smartexam-success); border-color: var(--smartexam-success); }
.btn-warning { color: #332300; background: #f5b942; border-color: #f5b942; }

.form-label { color: var(--smartexam-text-subtle); font-weight: 650; }
.form-control, .form-select {
  min-height: 42px;
  border-color: #cfd7e3;
  border-radius: var(--smartexam-radius-sm);
}
.form-control:hover, .form-select:hover { border-color: #98a7ba; }
.form-text { color: var(--smartexam-text-muted); }

.smartexam-choice-list .list-group-item {
  padding: .85rem 1rem;
  border-color: var(--smartexam-border);
  cursor: pointer;
}
.smartexam-choice-list .list-group-item:hover { background: #f8fbff; }
.smartexam-question-card .card-body { padding: clamp(1rem, 2.5vw, 1.4rem); line-height: 1.75; }

.smartexam-progress-panel {
  padding: .9rem 1rem;
  border: 1px solid var(--smartexam-border);
  border-radius: var(--smartexam-radius-md);
  background: var(--smartexam-surface);
}
.progress { height: .65rem; border-radius: 999px; background: #e8edf5; }
.progress-bar { border-radius: 999px; }

@media (max-width: 1199.98px) {
  .smartexam-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
  .smartexam-page-header { display: block; }
  .smartexam-page-actions { justify-content: flex-start; margin-top: .85rem; }
  .smartexam-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .smartexam-stat-card { padding: .85rem; }
  .smartexam-table-card { overflow: visible; }
}
@media (max-width: 419.98px) {
  .smartexam-stat-grid { grid-template-columns: 1fr; }
  .smartexam-page-actions > .btn { flex: 1 1 auto; }
}

/* =========================================================
   6-3-A User 首頁與選題流程
   ========================================================= */
.smartexam-eyebrow {
  display: inline-block;
  margin-bottom: .5rem;
  color: var(--smartexam-primary);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.smartexam-welcome-card,
.smartexam-user-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(1.4rem, 3vw, 2.5rem);
  border: 1px solid #cbdcf8;
  border-radius: var(--smartexam-radius-lg);
  background:
    radial-gradient(circle at top right, rgba(23, 92, 211, .12), transparent 42%),
    linear-gradient(135deg, #fff, #f4f8ff);
  box-shadow: var(--smartexam-shadow-sm);
}

.smartexam-welcome-card h2,
.smartexam-user-hero h2 {
  color: var(--smartexam-text);
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  font-weight: 750;
}

.smartexam-welcome-card p,
.smartexam-user-hero p {
  color: var(--smartexam-text-subtle);
  line-height: 1.65;
}

.smartexam-hero-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .75rem;
}

.smartexam-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.smartexam-section-heading h2 {
  margin: 0 0 .2rem;
  font-size: 1.25rem;
  font-weight: 750;
}

.smartexam-section-heading p {
  margin: 0;
  color: var(--smartexam-text-muted);
}

.smartexam-task-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.smartexam-task-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  min-height: 112px;
  padding: 1rem 1.1rem;
  border: 1px solid var(--smartexam-border);
  border-radius: var(--smartexam-radius-lg);
  background: #fff;
  color: var(--smartexam-text);
  text-decoration: none;
  box-shadow: var(--smartexam-shadow-sm);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.smartexam-task-card:hover {
  color: var(--smartexam-primary);
  border-color: #9dbcf0;
  box-shadow: var(--smartexam-shadow-md);
  transform: translateY(-2px);
}

.smartexam-task-card-primary {
  border-color: #9dbcf0;
  background: linear-gradient(135deg, #fff, var(--smartexam-primary-soft));
}

.smartexam-task-number {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: var(--smartexam-primary-soft);
  color: var(--smartexam-primary);
  font-weight: 800;
}

.smartexam-task-content {
  display: grid;
  gap: .25rem;
}

.smartexam-task-content strong {
  font-size: 1.05rem;
}

.smartexam-task-content small {
  color: var(--smartexam-text-muted);
  line-height: 1.45;
}

.smartexam-task-arrow {
  color: var(--smartexam-primary);
  font-size: 1.35rem;
}

.smartexam-info-strip {
  padding: .9rem 1rem;
  border: 1px solid #c9daf6;
  border-radius: var(--smartexam-radius-md);
  background: var(--smartexam-info-soft);
  color: #18427b;
}

.smartexam-selection-form {
  max-width: 1040px;
  margin-inline: auto;
}

.smartexam-selection-layout {
  display: grid;
  gap: 1rem;
}

.smartexam-selection-card {
  padding: clamp(1rem, 2vw, 1.5rem);
  border: 1px solid var(--smartexam-border);
  border-radius: var(--smartexam-radius-lg);
  background: #fff;
  box-shadow: var(--smartexam-shadow-sm);
}

.smartexam-step-header {
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  margin-bottom: 1.25rem;
}

.smartexam-step-number {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
  background: var(--smartexam-primary);
  color: #fff;
  font-weight: 800;
}

.smartexam-step-header h2 {
  margin: 0 0 .2rem;
  font-size: 1.1rem;
  font-weight: 750;
}

.smartexam-step-header p {
  margin: 0;
  color: var(--smartexam-text-muted);
}

.smartexam-selection-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.smartexam-field-group .form-label {
  font-weight: 700;
}

.smartexam-count-field {
  max-width: 320px;
}

.smartexam-selection-summary {
  position: sticky;
  bottom: .75rem;
  z-index: 1010;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  padding: 1rem 1.15rem;
  border: 1px solid #a7c1ed;
  border-radius: var(--smartexam-radius-lg);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 10px 28px rgba(16, 24, 40, .14);
  backdrop-filter: blur(10px);
}

.smartexam-selection-summary p {
  color: var(--smartexam-text-subtle);
}

.smartexam-selection-summary-exam {
  border-color: #e3bb68;
  background: rgba(255, 252, 242, .97);
}

.smartexam-exam-notice {
  margin-bottom: 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid #efd28e;
  border-radius: var(--smartexam-radius-md);
  background: var(--smartexam-warning-soft);
  color: #6d4b00;
}

.smartexam-exam-notice p {
  margin: .2rem 0 0;
}

.smartexam-secondary-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem .8rem;
  margin-top: 1rem;
  color: var(--smartexam-text-muted);
  font-size: .92rem;
}

.smartexam-secondary-links a {
  color: var(--smartexam-primary);
  text-decoration: none;
}

.smartexam-secondary-links a:hover {
  text-decoration: underline;
}

@media (max-width: 767.98px) {
  .smartexam-welcome-card,
  .smartexam-user-hero {
    align-items: stretch;
    flex-direction: column;
    gap: 1.25rem;
  }

  .smartexam-hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .smartexam-hero-actions .btn {
    width: 100%;
  }

  .smartexam-task-grid,
  .smartexam-selection-grid {
    grid-template-columns: 1fr;
  }

  .smartexam-selection-summary {
    align-items: stretch;
    flex-direction: column;
    bottom: .4rem;
  }

  .smartexam-selection-summary .btn {
    width: 100%;
  }

  .smartexam-count-field {
    max-width: none;
  }
}

@media (max-width: 575.98px) {
  .smartexam-task-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .smartexam-task-arrow {
    display: none;
  }

  .smartexam-selection-card {
    padding: 1rem;
  }

  .smartexam-step-header {
    gap: .7rem;
  }
}



/* =========================================================
   6-3-B 練習作答與結果頁
   ========================================================= */
.practice-page-header { align-items: center; }
.practice-question-kicker {
  margin-bottom: .25rem;
  color: var(--smartexam-primary);
  font-size: .82rem;
  font-weight: 750;
  letter-spacing: .08em;
}
.practice-question-count {
  display: flex;
  align-items: baseline;
  gap: .35rem;
  padding: .65rem .9rem;
  border: 1px solid var(--smartexam-border);
  border-radius: 999px;
  background: var(--smartexam-surface);
  color: var(--smartexam-text-muted);
  box-shadow: var(--smartexam-shadow-sm);
}
.practice-question-count strong { color: var(--smartexam-primary); font-size: 1.35rem; }

.smartexam-progress-panel {
  padding: .9rem 1rem;
  border: 1px solid var(--smartexam-border);
  border-radius: var(--smartexam-radius-md);
  background: var(--smartexam-surface);
}
.practice-progress-heading {
  display: flex;
  justify-content: space-between;
  margin-bottom: .5rem;
  color: var(--smartexam-text-subtle);
}
.practice-progress-track { height: .65rem; background: #e9eef5; }
.practice-progress-track .progress-bar { background: var(--smartexam-primary); }

.practice-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.practice-meta-strip > span {
  display: inline-flex;
  gap: .35rem;
  padding: .4rem .65rem;
  border-radius: 999px;
  background: var(--smartexam-neutral-soft);
  color: var(--smartexam-text-subtle);
  font-size: .86rem;
}
.practice-meta-strip strong { color: var(--smartexam-text); }

.practice-feedback {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid;
  border-radius: var(--smartexam-radius-md);
}
.practice-feedback.is-correct {
  color: #08633b;
  background: var(--smartexam-success-soft);
  border-color: #b7e2ca;
}
.practice-feedback.is-wrong {
  color: #912018;
  background: var(--smartexam-danger-soft);
  border-color: #f0b7b2;
}
.practice-feedback-title { margin-bottom: .15rem; font-size: 1.05rem; font-weight: 750; }

.practice-question-content {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  line-height: 1.85;
  white-space: pre-line;
}
.practice-question-image {
  max-width: min(100%, 760px);
  border: 1px solid var(--smartexam-border);
  border-radius: var(--smartexam-radius-md);
  background: #fff;
}

.practice-answer-fieldset { min-width: 0; }
.practice-answer-legend {
  margin-bottom: .75rem;
  font-size: 1rem;
  font-weight: 700;
}
.smartexam-choice-list {
  display: grid;
  gap: .7rem;
  margin-bottom: 1rem;
}
.practice-choice {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem;
  min-height: 58px;
  padding: .8rem .9rem;
  border: 1px solid var(--smartexam-border);
  border-radius: var(--smartexam-radius-md);
  background: var(--smartexam-surface);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.practice-choice:hover {
  border-color: #9db4d4;
  background: #fbfdff;
}
.practice-choice:focus-within {
  border-color: var(--smartexam-info);
  box-shadow: 0 0 0 .2rem rgba(23, 92, 211, .12);
}
.practice-choice.is-selected {
  border-color: var(--smartexam-primary);
  background: var(--smartexam-primary-soft);
}
.practice-choice.is-correct {
  border-color: #62b88b;
  background: var(--smartexam-success-soft);
}
.practice-choice.is-wrong {
  border-color: #df8c85;
  background: var(--smartexam-danger-soft);
}
.practice-choice-input { margin: 0; }
.practice-choice-key {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--smartexam-neutral-soft);
  font-weight: 750;
}
.practice-choice-text { min-width: 0; line-height: 1.55; }
.practice-choice-badge { justify-self: end; }

.practice-review-toggle {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .85rem 1rem;
  border: 1px solid var(--smartexam-border);
  border-radius: var(--smartexam-radius-md);
  background: #fbfcfe;
}
.practice-review-toggle input { margin-top: .25rem; }
.practice-review-toggle label { display: grid; gap: .1rem; cursor: pointer; }
.practice-review-toggle label span { color: var(--smartexam-text-muted); font-size: .85rem; }

.practice-explanation { overflow: hidden; }
.practice-explanation summary,
.practice-result-explanation summary {
  padding: 1rem 1.1rem;
  cursor: pointer;
  font-weight: 700;
  list-style-position: inside;
}
.practice-explanation-body,
.practice-result-explanation > div {
  padding: 0 1.1rem 1.1rem;
  line-height: 1.75;
}

.practice-result-hero {
  display: grid;
  grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr);
  gap: 1rem;
  padding: 1.25rem;
  border-radius: var(--smartexam-radius-lg);
  background: linear-gradient(135deg, #0b3a82, #175cd3);
  color: #fff;
  box-shadow: var(--smartexam-shadow-md);
}
.practice-result-score {
  display: grid;
  align-content: center;
  gap: .35rem;
}
.practice-result-score > span:first-child { opacity: .82; }
.practice-result-score > strong { font-size: clamp(2.4rem, 6vw, 4.4rem); line-height: 1; }
.practice-result-score .smartexam-status-badge { justify-self: start; }
.practice-result-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}
.practice-result-summary > div {
  display: grid;
  gap: .15rem;
  padding: .8rem .9rem;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--smartexam-radius-md);
  background: rgba(255,255,255,.1);
}
.practice-result-summary span { opacity: .82; font-size: .86rem; }
.practice-result-summary strong { color: #fff !important; font-size: 1.15rem; }

.practice-result-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .9rem 1.25rem;
  margin: 0;
}
.practice-result-meta div { min-width: 0; }
.practice-result-meta dt { color: var(--smartexam-text-muted); font-size: .82rem; }
.practice-result-meta dd { margin: .15rem 0 0; font-weight: 650; }

.practice-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.practice-result-question-link { color: var(--smartexam-primary); font-weight: 650; text-decoration: none; }
.practice-result-question-link:hover { text-decoration: underline; }

.practice-result-review-heading { margin: 2rem 0 1rem; }
.practice-result-review-heading h2 { margin-bottom: .25rem; font-size: 1.35rem; }
.practice-result-review-heading p { margin: 0; color: var(--smartexam-text-muted); }

.practice-result-question-card {
  scroll-margin-top: 90px;
  margin-bottom: 1rem;
  overflow: hidden;
  border: 1px solid var(--smartexam-border);
  border-left: 4px solid #98a2b3;
  border-radius: var(--smartexam-radius-lg);
  background: var(--smartexam-surface);
  box-shadow: var(--smartexam-shadow-sm);
}
.practice-result-question-card.is-correct { border-left-color: var(--smartexam-success); }
.practice-result-question-card.is-wrong { border-left-color: var(--smartexam-danger); }
.practice-result-question-card.is-unanswered { border-left-color: #98a2b3; }

.practice-result-question-header {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--smartexam-border);
  background: #fbfcfe;
}
.practice-result-question-header > div:first-child {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
}
.practice-result-sequence { margin-right: .2rem; font-weight: 750; }
.practice-result-question-meta { color: var(--smartexam-text-muted); font-size: .84rem; text-align: right; }
.practice-result-question-body { padding: 1rem; }

.practice-answer-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}
.practice-answer-comparison > div {
  display: grid;
  gap: .2rem;
  padding: .75rem .85rem;
  border-radius: var(--smartexam-radius-md);
  background: var(--smartexam-neutral-soft);
}
.practice-answer-comparison span { color: var(--smartexam-text-muted); font-size: .82rem; }
.practice-answer-comparison strong { font-size: 1.05rem; }

.practice-result-options {
  display: grid;
  gap: .55rem;
  margin-bottom: 1rem;
}
.practice-result-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .65rem;
  padding: .7rem .8rem;
  border: 1px solid var(--smartexam-border);
  border-radius: var(--smartexam-radius-md);
}
.practice-result-option.is-correct {
  border-color: #62b88b;
  background: var(--smartexam-success-soft);
}
.practice-result-option.is-wrong {
  border-color: #df8c85;
  background: var(--smartexam-danger-soft);
}
.practice-result-explanation {
  border-top: 1px solid var(--smartexam-border);
  background: #fbfcfe;
}

@media (max-width: 767.98px) {
  .practice-result-hero { grid-template-columns: 1fr; }
  .practice-result-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .practice-result-question-header { display: grid; }
  .practice-result-question-meta { text-align: left; }
}

@media (max-width: 575.98px) {
  .practice-question-count { width: 100%; justify-content: center; }
  .practice-meta-strip > span { border-radius: .6rem; }
  .practice-choice {
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: .55rem;
    padding: .8rem .7rem;
  }
  .practice-choice-badge { grid-column: 2 / -1; justify-self: start; }
  .practice-review-toggle { padding: .8rem; }
  .practice-action-bar {
    align-items: stretch;
    gap: .65rem;
  }
  .practice-action-danger {
    max-width: calc(100% - 96px);
  }
  .practice-action-danger .btn {
    text-align: center;
  }
  .practice-result-summary,
  .practice-result-meta,
  .practice-answer-comparison {
    grid-template-columns: 1fr;
  }
  .practice-result-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .practice-result-actions .btn { flex: 1 1 100%; }
  .practice-result-option {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .practice-result-option .smartexam-status-badge {
    grid-column: 2;
    justify-self: start;
  }
}
