@import "https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700&display=swap";
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
:root {
  --primary: #7c5cbf;
  --primary-light: #9b7dd4;
  --primary-dark: #5a3e9e;
  --primary-bg: #f3efff;
  --exam-color: #e8821a;
  --exam-light: #f59d41;
  --exam-bg: #fff4e6;
  --atyt-study: #0d9488;
  --atyt-study-light: #14b8a6;
  --atyt-study-bg: #f0fdfa;
  --atyt-exam: #059669;
  --atyt-exam-light: #34d399;
  --atyt-exam-bg: #ecfdf5;
  --correct: #22c55e;
  --correct-bg: #dcfce7;
  --correct-border: #86efac;
  --wrong: #ef4444;
  --wrong-bg: #fee2e2;
  --wrong-border: #fca5a5;
  --text-main: #1a1a2e;
  --text-sub: #6b7280;
  --text-light: #9ca3af;
  --bg: #f8f7fc;
  --card-bg: #ffffff;
  --border: #e5e7eb;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.1);
}
body {
  font-family: Be Vietnam Pro, sans-serif;
  background: var(--bg);
  min-height: 100vh;
}
.app-wrapper {
  min-height: 100vh;
  width: 100%;
}
.phone-frame {
  width: 100%;
  height: 100vh;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
.home-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 20px 32px;
  background: linear-gradient(160deg, #f3efff, #fff4fb 60%, #f0f9ff);
}
.home-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 28px;
}
.home-logo {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #7c5cbf, #c084fc);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px #7c5cbf4d;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.home-logo:active {
  transform: scale(0.95);
  box-shadow: 0 4px 12px #7c5cbf40;
}
.logo-icon {
  font-size: 40px;
  line-height: 1;
}
.home-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.home-subtitle {
  font-size: 14px;
  color: var(--text-sub);
  margin-bottom: 10px;
}
.home-badge {
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 99px;
}
.home-buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 360px;
}
.subject-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.subject-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.subject-label-csd {
  color: var(--primary);
}
.subject-label-atyt {
  color: var(--atyt-study);
}
.subject-btn-row {
  display: flex;
  gap: 10px;
}
.btn-half {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: transform 0.12s, box-shadow 0.12s;
}
.btn-half:active {
  transform: scale(0.97);
}
.btn-study,
.btn-exam {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.btn-study {
  background: linear-gradient(135deg, #7c5cbf, #9b7dd4);
  color: #fff;
  box-shadow: 0 5px 16px #7c5cbf59;
}
.btn-exam {
  background: linear-gradient(135deg, #e8821a, #f59d41);
  color: #fff;
  box-shadow: 0 5px 16px #e8821a59;
}
.btn-atyt-study {
  background: linear-gradient(135deg, #0d9488, #14b8a6);
  color: #fff;
  box-shadow: 0 5px 16px #0d948859;
}
.btn-atyt-exam {
  background: linear-gradient(135deg, #059669, #34d399);
  color: #fff;
  box-shadow: 0 5px 16px #05966959;
}
.btn-icon-wrap {
  width: 40px;
  height: 40px;
  background: #ffffff38;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.btn-icon-sm {
  width: 36px;
  height: 36px;
}
.btn-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.btn-label {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.btn-desc {
  font-size: 10px;
  opacity: 0.82;
}
.btn-arrow {
  font-size: 24px;
  opacity: 0.7;
  font-weight: 300;
}
.home-footer {
  margin-top: 48px;
  font-size: 13px;
  color: var(--text-light);
  text-align: center;
}
.screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
    padding-top: max(6vh, env(safe-area-inset-top));

}
.screen-scroll-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px 6px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.top-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  font-family: inherit;
  min-width: 80px;
}
.top-btn:active {
  background: var(--primary-bg);
}
.top-btn-right {
  justify-content: flex-end;
}
.exam-reset-btn {
  color: var(--exam-color);
}
.exam-reset-btn:active {
  background: var(--exam-bg);
}
.top-center {
  flex: 1;
  text-align: center;
}
.top-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}
.progress-bar-wrap {
  padding: 6px 14px 4px;
  background: #fff;
}
.progress-bar-track {
  height: 5px;
  background: #e5e7eb;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 4px;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 99px;
  transition: width 0.3s ease;
}
.exam-fill {
  background: linear-gradient(90deg, var(--exam-color), var(--exam-light));
}
.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-sub);
  font-weight: 500;
}
.question-card {
  background: #fff;
  margin: 6px 12px 2px;
  border-radius: var(--radius);

  padding: 18px 13px;

  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}
.exam-card {
  border-left-color: var(--exam-color);
}
.question-number {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}
.exam-num {
  color: var(--exam-color);
}
.question-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.55;
}
.options-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px 12px;
  flex: 1;
}
.option-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  font-family: inherit;
  position: relative;
}
.option-btn:active {
  transform: scale(0.99);
}
.options-stretch .option-btn {
  flex: 1;
}
.option-letter {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f3f4f6;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.option-text {
  font-size: 13.5px;
  color: var(--text-main);
  line-height: 1.4;
  flex: 1;
}
.option-check {
  color: var(--correct);
  flex-shrink: 0;
}
.option-selected {
  border-color: var(--primary);
  background: var(--primary-bg);
}
.option-selected .option-letter {
  background: var(--primary);
  color: #fff;
}
.option-exam-selected {
  border-color: var(--exam-color);
  background: var(--exam-bg);
}
.option-exam-selected .option-letter {
  background: var(--exam-color);
  color: #fff;
}
.option-correct {
  border-color: var(--correct-border);
  background: var(--correct-bg);
}
.option-correct .option-letter {
  background: var(--correct);
  color: #fff;
}
.option-correct .option-text {
  color: #15803d;
  font-weight: 600;
}
.option-wrong {
  border-color: var(--wrong-border);
  background: var(--wrong-bg);
}
.option-wrong .option-letter {
  background: var(--wrong);
  color: #fff;
}
.option-wrong .option-text {
  color: #b91c1c;
}
.bottom-action {
  padding: 8px 14px 14px;
  background: #f8f7fcf2;
  border-top: 1px solid var(--border);
    margin-bottom: 40%;

}
.btn-next {
  width: 100%;
  padding: 22px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 14px #7c5cbf4d;
  transition: transform 0.1s;
}
.btn-next:active:not(:disabled) {
  transform: scale(0.98);
}
.btn-next-disabled {
  background: linear-gradient(135deg, #c4b5d8, #d4c5e8) !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  opacity: 0.75;
}
.btn-submit {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--exam-color), var(--exam-light));
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 14px #e8821a4d;
  transition: transform 0.1s;
}
.btn-submit:active {
  transform: scale(0.98);
}
.hint-text {
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
  padding: 16px 12px 28px;
  margin-top: auto;
}
.exam-nav-row {
  display: flex;
  gap: 8px;
  padding: 2px 12px 6px;
}
.exam-nav-btn {
  flex: 1;
  padding: 9px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.exam-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.exam-nav-btn:not(:disabled):active {
  background: var(--exam-bg);
  border-color: var(--exam-color);
}
.confirm-dialog-overlay {
  position: fixed;
  inset: 0;
  background: #00000073;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.confirm-dialog {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px;
  width: 100%;
  max-width: 320px;
  box-shadow: 0 20px 60px #00000040;
}
.confirm-dialog h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
}
.confirm-dialog p {
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.55;
  margin-bottom: 22px;
}
.confirm-buttons {
  display: flex;
  gap: 10px;
}
.btn-cancel {
  flex: 1;
  padding: 12px;
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  font-family: inherit;
}
.btn-confirm-reset {
  flex: 1;
  padding: 12px;
  background: var(--wrong);
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
}
.btn-confirm-submit {
  flex: 1;
  padding: 12px;
  background: var(--exam-color);
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
}
.result-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px 8px;
  gap: 14px;
}
.result-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px #7c5cbf4d;
}
.circle-pass {
  background: linear-gradient(135deg, #22c55e, #4ade80);
  box-shadow: 0 8px 24px #22c55e4d;
}
.circle-fail {
  background: linear-gradient(135deg, #ef4444, #f87171);
  box-shadow: 0 8px 24px #ef44444d;
}
.result-circle-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.result-score {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.result-score-label {
  font-size: 13px;
  color: #ffffffd9;
  font-weight: 500;
  margin-top: 2px;
}
.result-verdict {
  font-size: 18px;
  font-weight: 700;
  padding: 6px 20px;
  border-radius: 99px;
}
.verdict-pass {
  background: var(--correct-bg);
  color: #15803d;
}
.verdict-fail {
  background: var(--wrong-bg);
  color: #b91c1c;
}
.result-stats {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 16px;
  padding: 14px 24px;
  gap: 20px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 280px;
  justify-content: center;
}
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.stat-num {
  font-size: 24px;
  font-weight: 800;
}
.stat-name {
  font-size: 12px;
  color: var(--text-sub);
  font-weight: 500;
}
.stat-correct .stat-num {
  color: var(--correct);
}
.stat-wrong .stat-num {
  color: var(--wrong);
}
.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}
.result-grid-title {
  font-size: 13px;
  color: var(--text-sub);
  text-align: center;
  padding: 8px 16px 4px;
  font-weight: 500;
}
.result-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  padding: 8px 14px 20px;
}
.result-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  border: none;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.1s;
}
.result-cell:active {
  transform: scale(0.92);
}
.cell-correct {
  background: var(--correct-bg);
  color: #15803d;
  border: 1.5px solid var(--correct-border);
}
.cell-wrong {
  background: var(--wrong-bg);
  color: #b91c1c;
  border: 1.5px solid var(--wrong-border);
}
.result-detail-info {
  padding: 12px 14px;
}
.result-tag {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}
.correct-tag {
  background: var(--correct-bg);
  color: #15803d;
  border: 1px solid var(--correct-border);
}
.wrong-tag {
  background: var(--wrong-bg);
  color: #b91c1c;
  border: 1px solid var(--wrong-border);
}
.part-select-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  box-shadow: var(--shadow);
  transition: transform 0.12s, box-shadow 0.12s;
  width: 100%;
}
.part-select-btn:active {
  transform: scale(0.98);
  box-shadow: none;
}
.part-select-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.part-select-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}
.part-select-range {
  font-size: 12px;
  color: var(--text-sub);
  font-weight: 500;
}
.part-progress-bar-track {
  height: 4px;
  background: #e5e7eb;
  border-radius: 99px;
  overflow: hidden;
  margin: 4px 0;
}
.part-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 99px;
  transition: width 0.3s ease;
}
.part-select-status {
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
}
.part-status-done {
  color: #15803d;
  display: flex;
  align-items: center;
}
.part-status-progress {
  color: var(--primary);
}
.part-status-new {
  color: var(--text-light);
}
.part-select-arrow {
  color: var(--text-light);
  flex-shrink: 0;
}
.part-select-btn-atyt:hover {
  border-color: var(--atyt-study);
}
.part-progress-bar-fill-atyt {
  background: linear-gradient(
    90deg,
    var(--atyt-study),
    var(--atyt-study-light)
  ) !important;
}
.part-status-progress-atyt {
  color: var(--atyt-study);
}
.atyt-study-fill {
  background: linear-gradient(
    90deg,
    var(--atyt-study),
    var(--atyt-study-light)
  ) !important;
}
.option-atyt-selected {
  border-color: var(--atyt-study);
  background: var(--atyt-study-bg);
}
.option-atyt-selected .option-letter {
  background: var(--atyt-study);
  color: #fff;
}
.option-atyt-exam-selected {
  border-color: var(--atyt-exam);
  background: var(--atyt-exam-bg);
}
.option-atyt-exam-selected .option-letter {
  background: var(--atyt-exam);
  color: #fff;
}
.home-footer a {
  text-decoration: none;
  color: var(--text-light);
}


