/* ===== Aptis Free Design System ===== */
:root {
  --navy: #1E3A8A;      /* Chủ đạo - Xanh dương đậm */
  --navy-700: #172e6e;
  --emerald: #10B981;   /* Chủ đạo - Xanh ngọc */
  --emerald-600: #0ea371;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;  /* Phụ trợ - Xám nhạt */
  --gray-200: #E5E7EB;
  --gray-400: #9CA3AF;
  --gray-600: #4B5563;
  --gray-800: #1F2937;
  --orange: #F97316;    /* CTA - Cam sáng */
  --orange-600: #ea6a0c;
  --white: #ffffff;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(30, 58, 138, 0.08);
  --shadow-lg: 0 12px 40px rgba(30, 58, 138, 0.14);
  --container: 1180px;
  --font: 'Segoe UI', Roboto, system-ui, -apple-system, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.6;
}
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--emerald-600); }
img { max-width: 100%; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.site-main { min-height: 60vh; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 15px; cursor: pointer;
  border: 2px solid transparent; transition: all .15s ease; white-space: nowrap;
}
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-cta { background: var(--orange); color: #fff; }
.btn-cta:hover { background: var(--orange-600); color: #fff; transform: translateY(-1px); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-700); color: #fff; }
.btn-emerald { background: var(--emerald); color: #fff; }
.btn-emerald:hover { background: var(--emerald-600); color: #fff; }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--gray-200); }
.btn-ghost:hover { border-color: var(--navy); background: var(--gray-100); }

/* ===== Header ===== */
.site-header { background: #fff; box-shadow: var(--shadow); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; }
.brand-aptis { color: var(--navy); }
.brand-free { color: var(--emerald); }
.brand-text { letter-spacing: -.3px; }

.main-nav { display: flex; align-items: center; flex: 1; gap: 12px; }
.nav-list { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; flex: 1; }
.nav-item { position: relative; }
.nav-link {
  display: flex; align-items: center; gap: 4px; padding: 10px 12px;
  color: var(--gray-800); font-weight: 600; font-size: 14.5px; border-radius: var(--radius-sm);
}
.nav-link:hover { background: var(--gray-100); color: var(--navy); }
.nav-link.active { color: var(--navy); background: var(--gray-100); }
.caret { font-size: 10px; color: var(--gray-400); }
.nav-cta .nav-link { background: var(--orange); color: #fff; }
.nav-cta .nav-link:hover { background: var(--orange-600); color: #fff; }

.submenu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 220px;
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 8px; list-style: none; margin: 0;
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: all .15s ease; z-index: 120;
}
.has-children:hover .submenu { opacity: 1; visibility: visible; transform: translateY(0); }
.submenu-link { display: block; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 14px; color: var(--gray-800); }
.submenu-link:hover, .submenu-link.active { background: var(--gray-100); color: var(--navy); }

.nav-auth { display: flex; align-items: center; gap: 10px; }
.user-chip { font-size: 13px; color: var(--gray-600); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2.5px; background: var(--navy); border-radius: 2px; }

.click-banner {
  background: linear-gradient(90deg, var(--navy), var(--emerald));
  color: #fff; text-align: center; padding: 8px 16px; font-size: 14px;
}
.click-banner a { color: #fff; text-decoration: underline; font-weight: 700; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, #23499f 55%, var(--emerald) 160%);
  color: #fff; padding: 72px 0 84px;
}
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 42px; line-height: 1.15; margin: 0 0 16px; letter-spacing: -1px; }
.hero .highlight { color: #FBBF77; }
.hero p.lead { font-size: 18px; color: #dbe4ff; margin: 0 0 28px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 28px; margin-top: 36px; }
.hero-stat b { display: block; font-size: 26px; }
.hero-stat span { color: #cdd9ff; font-size: 13px; }
.hero-art { display: flex; justify-content: center; }
.hero-card {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25);
  border-radius: 20px; padding: 26px; width: 100%; backdrop-filter: blur(4px);
}
.hero-card h3 { margin: 0 0 14px; font-size: 16px; }
.skill-pill { display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.12); padding: 12px 16px; border-radius: 10px; margin-bottom: 10px; }
.skill-pill b { font-weight: 700; }
.skill-pill em { font-style: normal; color: #cdeee0; font-size: 13px; }

/* ===== Sections ===== */
.section { padding: 64px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 42px; }
.section-head h2 { font-size: 30px; color: var(--navy); margin: 0 0 10px; }
.section-head p { color: var(--gray-600); font-size: 16px; margin: 0; }
.eyebrow { color: var(--emerald-600); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; font-size: 13px; }

/* ===== Cards grid ===== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 22px; }
.card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card .icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 16px; background: var(--gray-100); }
.card h3 { margin: 0 0 8px; color: var(--navy); font-size: 19px; }
.card p { margin: 0 0 16px; color: var(--gray-600); font-size: 14.5px; }
.card-link { font-weight: 700; color: var(--emerald-600); }

.icon-navy { background: rgba(30,58,138,.1) !important; color: var(--navy); }
.icon-emerald { background: rgba(16,185,129,.12) !important; color: var(--emerald-600); }
.icon-orange { background: rgba(249,115,22,.12) !important; color: var(--orange-600); }

/* ===== Steps ===== */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 22px; }
.step { background: #fff; border-radius: var(--radius); padding: 24px; border: 1px solid var(--gray-200); }
.step .num { width: 36px; height: 36px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 14px; }
.step h4 { margin: 0 0 6px; color: var(--navy); }
.step p { margin: 0; color: var(--gray-600); font-size: 14px; }

/* ===== CTA band ===== */
.cta-band { background: var(--navy); color: #fff; border-radius: 18px; padding: 44px; text-align: center; margin: 20px 0; }
.cta-band h2 { margin: 0 0 10px; font-size: 28px; }
.cta-band p { color: #cdd9ff; margin: 0 0 22px; }

/* ===== Page header (skill pages) ===== */
.page-head { background: #fff; border-bottom: 1px solid var(--gray-200); padding: 40px 0; }
.page-head .eyebrow { display: block; margin-bottom: 6px; }
.page-head h1 { margin: 0 0 8px; color: var(--navy); font-size: 32px; }
.page-head p { margin: 0; color: var(--gray-600); }
.breadcrumb { font-size: 13px; color: var(--gray-400); margin-bottom: 14px; }
.breadcrumb a { color: var(--gray-600); }

/* ===== Auth ===== */
.auth-wrap { max-width: 440px; margin: 48px auto; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow); padding: 34px; }
.auth-wrap h1 { margin: 0 0 6px; color: var(--navy); font-size: 24px; text-align: center; }
.auth-wrap .sub { text-align: center; color: var(--gray-600); margin: 0 0 22px; font-size: 14px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.form-control { width: 100%; padding: 12px 14px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); font-size: 15px; font-family: inherit; }
.form-control:focus { outline: none; border-color: var(--navy); }
.btn-block { width: 100%; }
.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 18px; }
.alert-error { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }
.alert-info { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }
.alert-success { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }
.auth-alt { text-align: center; margin-top: 18px; font-size: 14px; color: var(--gray-600); }
.limit-note { background: linear-gradient(90deg, rgba(249,115,22,.12), rgba(16,185,129,.12)); border: 1px solid var(--gray-200); }

/* ===== Info / center panels ===== */
.panel { max-width: 560px; margin: 60px auto; background:#fff; border:1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px; text-align: center; }
.panel .big-emoji { font-size: 48px; }
.panel h1 { color: var(--navy); margin: 12px 0 8px; }
.panel p { color: var(--gray-600); }

/* ===== List (sections placeholder) ===== */
.placeholder-box { background: #fff; border: 1.5px dashed var(--gray-200); border-radius: var(--radius); padding: 40px; text-align: center; color: var(--gray-600); }
.placeholder-box .big-emoji { font-size: 40px; }

/* ===== Footer ===== */
.site-footer { background: #0f1f45; color: #c7d2e8; margin-top: 60px; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 2fr; gap: 40px; padding: 48px 20px 30px; }
.footer-brand { display: flex; gap: 12px; }
.footer-brand .brand-text { font-size: 18px; font-weight: 800; }
.footer-brand .brand-aptis { color: #fff; }
.footer-brand .brand-free { color: var(--emerald); }
.footer-slogan { color: #93a4c8; font-size: 13px; margin: 4px 0 0; }
.footer-cols { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.footer-col h4 { color: #fff; font-size: 14px; margin: 0 0 12px; }
.footer-col a { display: block; color: #a9b7d6; font-size: 14px; padding: 4px 0; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 18px 20px; font-size: 13px; color: #8697bd; }

/* ===== Responsive ===== */
@media (max-width: 920px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .footer-inner { grid-template-columns: 1fr; }
  .nav-toggle { display: flex; margin-left: auto; }
  .main-nav {
    position: fixed; top: 68px; right: 0; bottom: 0; width: 300px; max-width: 85%;
    background: #fff; flex-direction: column; align-items: stretch; padding: 16px;
    box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .2s ease;
    overflow-y: auto;
  }
  .main-nav.open { transform: translateX(0); }
  .nav-list { flex-direction: column; align-items: stretch; gap: 2px; }
  .submenu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; padding: 4px 0 4px 14px; }
  .nav-auth { margin-top: 16px; flex-direction: column; align-items: stretch; }
  .hero h1 { font-size: 32px; }
}

/* ===== Count badge (reading overview) ===== */
.count-badge { font-size: 12px; font-weight: 700; color: var(--emerald-600); background: rgba(16,185,129,.12); padding: 4px 10px; border-radius: 999px; }
.count-badge.soon { color: var(--gray-600); background: var(--gray-100); }

/* ===== Exam mode ===== */
.exam-body { background: #fff; display: flex; flex-direction: column; min-height: 100vh; }
.exam-top {
  display: flex; align-items: center; gap: 20px; padding: 14px 28px;
  position: sticky; top: 0; background: #fff; z-index: 50;
}
.exam-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; color: var(--gray-800); flex: 1; }
.exam-timer { font-size: 15px; color: var(--gray-800); font-weight: 600; text-align: center; flex: 1; }
.exam-timer strong { color: var(--navy); font-variant-numeric: tabular-nums; }
.exam-timer.warning strong { color: #DC2626; }
.exam-timer.times-up strong { color: #DC2626; }
.exam-label { font-weight: 800; color: var(--navy); flex: 1; text-align: right; }
.exam-progressbar { height: 3px; background: linear-gradient(90deg, #EF4444, #F97316); }

.exam-main { flex: 1; padding: 40px 28px 120px; }
.exam-content { max-width: 1100px; margin: 0 auto; }
.exam-qtitle { font-size: 38px; color: var(--gray-800); margin: 0 0 18px; font-weight: 800; }
.exam-qtitle .qnum { border-bottom: 3px solid var(--navy); padding: 0 10px; color: var(--navy); }
.exam-instruction { font-size: 16px; color: var(--gray-800); margin: 0 0 28px; }
.vn-note { color: var(--gray-400); font-size: 14px; }

/* Gap rows */
.q1-form { display: flex; flex-direction: column; gap: 14px; }
.gap-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px;
  background: var(--gray-50); border: 1.5px solid var(--gray-100); border-radius: 12px;
  padding: 20px 24px; font-size: 17px; transition: all .15s ease;
}
.gap-text { color: var(--gray-800); }
.gap-select {
  padding: 8px 12px; border: 1.5px solid var(--gray-200); border-radius: 8px;
  font-size: 15px; font-family: inherit; background: #fff; min-width: 120px; cursor: pointer;
}
.gap-select:focus { outline: none; border-color: var(--navy); }
.gap-mark { font-weight: 700; margin-left: auto; font-size: 14px; }
.gap-row.is-correct { background: #ECFDF5; border-color: #A7F3D0; }
.gap-row.is-correct .gap-mark { color: var(--emerald-600); }
.gap-row.is-correct .gap-select { border-color: var(--emerald); }
.gap-row.is-wrong { background: #FEF2F2; border-color: #FECACA; }
.gap-row.is-wrong .gap-mark { color: #DC2626; }
.gap-row.is-wrong .gap-select { border-color: #EF4444; }

.q1-result { margin-top: 26px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.q1-score { font-size: 18px; color: var(--gray-800); background: var(--gray-100); padding: 12px 20px; border-radius: 10px; }
.q1-score.all-correct { background: #ECFDF5; color: var(--emerald-600); }
.q1-score strong { color: var(--navy); }
.q1-score.all-correct strong { color: var(--emerald-600); }

/* Bottom bar */
.exam-bottom {
  position: fixed; bottom: 0; left: 0; right: 0; background: var(--gray-100);
  border-top: 1px solid var(--gray-200); padding: 14px 28px; z-index: 50;
}
.exam-bottom-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.exam-nav-btn { min-width: 110px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 720px) {
  .exam-top { flex-wrap: wrap; padding: 12px 16px; gap: 8px; }
  .exam-brand, .exam-timer, .exam-label { flex: none; }
  .exam-brand { flex: 1; }
  .exam-timer { order: 3; width: 100%; text-align: left; }
  .exam-main { padding: 24px 16px 110px; }
  .exam-qtitle { font-size: 28px; }
  .gap-row { padding: 16px; font-size: 16px; }
  .exam-nav-btn { min-width: 90px; }
}

/* ===== Modal review (chấm điểm) ===== */
body.modal-open { overflow: hidden; }
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 23, 42, .55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  background: #fff; border-radius: 14px; width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 25px 60px rgba(0,0,0,.3);
  animation: modalIn .18s ease;
}
@keyframes modalIn { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 24px; border-bottom: 1px solid var(--gray-200);
}
.modal-title { margin: 0; font-size: 21px; color: var(--gray-800); font-weight: 700; }
.modal-close {
  background: none; border: none; font-size: 30px; line-height: 1; color: var(--gray-400);
  cursor: pointer; padding: 0 4px;
}
.modal-close:hover { color: var(--gray-800); }
.modal-body { padding: 24px; }
.modal-score { text-align: center; font-size: 27px; font-weight: 800; color: var(--emerald-600); margin-bottom: 6px; }
.modal-class { text-align: center; font-size: 24px; font-weight: 800; color: #2563EB; margin-bottom: 22px; }

.review-table { width: 100%; border-collapse: collapse; }
.review-table th, .review-table td {
  border: 1px solid var(--gray-200); padding: 14px 16px; text-align: center; font-size: 16px;
}
.review-table th { font-weight: 700; color: var(--gray-800); }
.review-table td.ans-correct { color: var(--emerald-600); font-weight: 600; }
.review-table td.ans-wrong { color: #DC2626; font-weight: 600; }
.review-table td.ans-empty { color: #DC2626; }

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

/* Nút Mẹo (bóng đèn phát sáng) */
.exam-center-btns { display: flex; align-items: center; gap: 10px; }
.btn-tip {
  background: #FEF3C7; color: #92400E; border-color: #FDE68A;
}
.btn-tip:hover { background: #FDE68A; color: #92400E; transform: translateY(-1px); }
.tip-bulb { display: inline-block; filter: drop-shadow(0 0 0 rgba(251,191,36,0)); animation: bulbGlow 1.8s ease-in-out infinite; }
@keyframes bulbGlow {
  0%, 100% { filter: drop-shadow(0 0 1px rgba(251,191,36,.4)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 8px rgba(251,191,36,.95)); transform: scale(1.12); }
}

/* Modal mẹo */
.modal-card-tip { max-width: 520px; }
.tip-hint { color: var(--gray-600); font-size: 15px; margin: 0 0 14px; }
.tip-sentence {
  margin: 0; padding: 20px 22px; font-size: 19px; line-height: 1.7; color: var(--gray-800);
  background: linear-gradient(135deg, #FFFBEB, #FEF3C7); border-left: 5px solid #F59E0B;
  border-radius: 12px; font-weight: 500;
}
.tip-badge {
  display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 700;
  color: var(--emerald-600); background: rgba(16,185,129,.12); padding: 5px 12px; border-radius: 999px;
}
.tip-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }
.tip-login-note { margin: 4px 0 0; font-size: 14px; color: var(--gray-600); }
.tip-login-note a { font-weight: 700; }
.tip-textarea {
  width: 100%; padding: 14px 16px; border: 1.5px solid var(--gray-200); border-radius: 12px;
  font-family: inherit; font-size: 17px; line-height: 1.6; resize: vertical; color: var(--gray-800);
}
.tip-textarea:focus { outline: none; border-color: #F59E0B; }
.tip-edit-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.tip-msg { margin-right: auto; font-size: 13px; color: var(--gray-600); }

/* ===== Part 2+3: sắp xếp câu (kéo thả) ===== */
.q2-subtitle { font-size: 26px; font-weight: 800; color: var(--gray-800); margin: 0 0 18px; }
.q2-subtitle .qnum { border-bottom: 3px solid var(--navy); padding: 0 8px; color: var(--navy); }
.q2-topic { font-size: 20px; color: var(--navy); margin: 0 0 18px; font-weight: 700; }

.q2-area { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.q2-panel {
  background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 14px;
  padding: 20px; min-height: 320px;
}
.q2-pool.drag-over { background: #EFF6FF; border-color: var(--navy); }

.q2-slot-row { display: flex; align-items: stretch; gap: 12px; margin-bottom: 12px; }
.q2-slot-num {
  flex: 0 0 28px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--gray-400); font-size: 15px;
}
.q2-slot {
  flex: 1; min-height: 54px; border: 1.5px dashed var(--gray-400); border-radius: 10px;
  background: #fff; display: flex; align-items: center; transition: all .12s ease;
}
.q2-slot.drag-over { border-color: var(--navy); border-style: solid; background: #EFF6FF; }
.q2-slot.filled { border-style: solid; border-color: var(--gray-200); padding: 0; }
.q2-slot.is-correct { border-color: var(--emerald); background: #ECFDF5; }
.q2-slot.is-wrong { border-color: #EF4444; background: #FEF2F2; }
.q2-slot .q2-card { margin: 0; width: 100%; }

.q2-card {
  background: #fff; border: 1.5px solid var(--gray-200); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 12px; font-size: 15.5px; line-height: 1.55; color: var(--gray-800);
  cursor: grab; user-select: none; transition: box-shadow .12s ease, border-color .12s ease;
}
.q2-card:last-child { margin-bottom: 0; }
.q2-card:hover { box-shadow: var(--shadow); border-color: var(--navy); }
.q2-card:active { cursor: grabbing; }
.q2-card.dragging { opacity: .5; }
.q2-card.selected { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(249,115,22,.2); }

.review-table.q2-review td { text-align: left; }

@media (max-width: 720px) {
  .q2-area { grid-template-columns: 1fr; gap: 16px; }
  .q2-panel { min-height: auto; }
  .q2-card { font-size: 15px; }
}

/* ===== Part 4: ghép câu hỏi với người ===== */
.q4-people { margin-bottom: 30px; }
.q4-person { margin-bottom: 18px; }
.q4-person-name { margin: 0 0 6px; color: var(--navy); font-size: 16px; font-weight: 700; }
.q4-person-text { margin: 0; color: var(--gray-800); font-size: 15.5px; line-height: 1.65; }

/* Câu hỏi căn phải đồng bộ */
.q4-questions { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.q4-qrow {
  display: flex; align-items: center; gap: 10px; max-width: 100%;
  background: var(--gray-50); border: 1px solid var(--gray-100); border-radius: 10px;
  padding: 10px 14px;
}
.q4-qlabel { color: var(--gray-800); font-size: 15.5px; text-align: right; }
.q4-dash { color: var(--gray-400); }
.q4-select {
  padding: 8px 12px; border: 1.5px solid var(--gray-200); border-radius: 8px;
  font-size: 15px; font-family: inherit; background: #fff; min-width: 72px; cursor: pointer;
}
.q4-select:focus { outline: none; border-color: var(--navy); }
.q4-qrow.is-correct { background: #ECFDF5; border-color: #A7F3D0; }
.q4-qrow.is-correct .q4-select { border-color: var(--emerald); }
.q4-qrow.is-wrong { background: #FEF2F2; border-color: #FECACA; }
.q4-qrow.is-wrong .q4-select { border-color: #EF4444; }

/* Modal so sánh đáp án (3 cột) */
.modal-card-wide { max-width: 760px; }
.modal-compare-title { text-align: center; font-size: 27px; font-weight: 800; color: var(--gray-800); margin-bottom: 20px; }
.review-table.q4-review td { text-align: center; }
.review-table.q4-review td.q4-qcell { text-align: center; color: var(--gray-800); }

@media (max-width: 720px) {
  .q4-questions { align-items: stretch; }
  .q4-qrow { flex-wrap: wrap; }
  .q4-qlabel { text-align: left; }
  .review-table.q4-review th, .review-table.q4-review td { padding: 8px; font-size: 13px; }
}

/* ===== Part 5: chọn tiêu đề cho đoạn ===== */
.q5-title { font-size: 30px; font-weight: 800; color: var(--gray-800); margin: 0 0 22px; }
.q5-paras { display: flex; flex-direction: column; gap: 26px; }
.q5-para-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.q5-num { font-weight: 700; color: var(--gray-800); font-size: 16px; min-width: 24px; }
.q5-select {
  flex: 1; max-width: 580px; padding: 10px 14px; border: 1.5px solid var(--gray-300, #D1D5DB);
  border-radius: 8px; font-size: 15px; font-family: inherit; background: #fff; cursor: pointer;
}
.q5-select:focus { outline: none; border-color: var(--navy); }
.q5-para-text { margin: 0; color: var(--gray-800); font-size: 15.5px; line-height: 1.7; }
.q5-para.is-correct .q5-select { border-color: var(--emerald); background: #ECFDF5; }
.q5-para.is-wrong .q5-select { border-color: #EF4444; background: #FEF2F2; }

/* Điểm trong modal so sánh (chữ tối, nhỏ hơn tiêu đề) */
.compare-score { text-align: center; font-size: 18px; font-weight: 700; color: var(--gray-800); margin: -6px 0 20px; }
.compare-score.all-correct { color: var(--emerald-600); }
.review-table.q5-review td { text-align: center; }
.review-table.q5-review td.q5-numcell { font-weight: 700; color: var(--gray-800); }

@media (max-width: 720px) {
  .q5-title { font-size: 24px; }
  .q5-select { max-width: 100%; }
  .review-table.q5-review th, .review-table.q5-review td { padding: 8px; font-size: 13px; }
}

@media (max-width: 560px) {
  .modal-title { font-size: 18px; }
  .modal-score { font-size: 23px; }
  .modal-class { font-size: 20px; }
  .review-table th, .review-table td { padding: 10px; font-size: 14px; }
}

