/* ============================================================
   HUFLIT — Professional Design System
   Palette: Navy Blue #1a3a6e | Orange #e85d04 | White/Light
   ============================================================ */

:root {
  --navy:         #1a3a6e;
  --navy-dark:    #0f2447;
  --navy-light:   #2d5495;
  --navy-muted:   #4a6fa5;
  --orange:       #e85d04;
  --orange-light: #ff7722;
  --bg-page:      #f0f4fa;
  --bg-white:     #ffffff;
  --bg-soft:      #f8faff;
  --text-primary: #1e293b;
  --text-second:  #475569;
  --text-light:   #94a3b8;
  --border:       #e2e8f0;
  --border-soft:  #f1f5f9;
  --shadow-sm:    0 1px 4px rgba(0,0,0,0.08);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.12);
  --radius:       12px;
  --radius-lg:    20px;
  --radius-xl:    28px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
body {
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: 'Be Vietnam Pro', 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}
h1,h2,h3,h4,h5,h6 { font-family: 'Be Vietnam Pro', sans-serif; margin: 0; padding: 0; }
a { color: var(--navy); transition: color 0.2s; }
img { max-width: 100%; height: auto; }
ul, ol { margin-bottom: 0; }

/* ── Container helper ── */
.hp-container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ============================================================
   SITE HEADER
   ============================================================ */
.site-header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 64px;
}
.header-logo img   { height: 46px; width: auto; display: block; }
.header-socials    { display: flex; gap: 6px; align-items: center; }
.header-socials a  {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg-page); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; border: 1px solid var(--border); transition: 0.2s;
}
.header-socials a:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.header-contacts   { display: flex; align-items: center; gap: 20px; }
.header-contact-item { display: flex; flex-direction: column; text-align: right; }
.header-contact-item .hc-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-light); line-height: 1; }
.header-contact-item .hc-value { font-weight: 700; color: var(--navy); font-size: 14px; line-height: 1.3; text-decoration: none; }
.header-contact-item .hc-value:hover { color: var(--orange); }
.header-sep { width: 1px; height: 32px; background: var(--border); }

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-section {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 60%, var(--navy-light) 100%);
  padding: 64px 24px 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../images/HUFLIT.jpg') center/cover no-repeat;
  opacity: 0.08;
  pointer-events: none;
}
.hero-section::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg-page);
  clip-path: ellipse(55% 100% at 50% 100%);
}
.hero-content { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.9);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 16px;
  border-radius: 50px;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.hero-title {
  font-size: 2.8rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 14px;
  letter-spacing: -0.5px;
}
.hero-title .accent { color: #ffb347; }
.hero-subtitle {
  color: rgba(255,255,255,0.75);
  font-size: 1.05rem;
  margin-bottom: 32px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}
.hero-stats { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; }
.hero-stat { text-align: center; }
.hero-stat strong { display: block; font-size: 1.8rem; font-weight: 800; color: #fff; line-height: 1; }
.hero-stat span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: rgba(255,255,255,0.65); display: block; margin-top: 3px; }
.hero-divider { width: 1px; height: 40px; background: rgba(255,255,255,0.2); align-self: center; }

/* ── Hero CTA button ── */
.btn-apply-hero {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 32px;
  padding: 14px 36px;
  background: #fff;
  color: var(--navy);
  font-size: 15px;
  font-weight: 700;
  border-radius: 50px;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  transition: all 0.25s;
  letter-spacing: 0.2px;
}
.btn-apply-hero:hover {
  background: var(--orange);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(232,93,4,0.4);
}

/* ── Policy section CTA ── */
.policy-cta {
  margin-top: 40px;
  text-align: center;
}
.policy-cta-note {
  font-size: 13px;
  color: var(--text-second);
  margin-bottom: 16px;
}
.btn-apply-policy {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 40px;
  background: linear-gradient(135deg, var(--orange) 0%, #f97316 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border-radius: 50px;
  text-decoration: none;
  box-shadow: 0 6px 24px rgba(232,93,4,0.35);
  transition: all 0.25s;
  letter-spacing: 0.2px;
}
.btn-apply-policy:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(232,93,4,0.5);
  color: #fff;
}
.btn-apply-arrow {
  transition: transform 0.2s;
}
.btn-apply-policy:hover .btn-apply-arrow {
  transform: translateX(4px);
}

/* ============================================================
   CALCULATOR CARD
   ============================================================ */
.calculator-section {
  margin-top: -52px;
  padding: 0 24px 48px;
  position: relative;
  z-index: 10;
}
.calc-card {
  background: linear-gradient(135deg, #ff8c00 0%, #ff5c00 55%, #e84000 100%);
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 40px rgba(234,88,12,0.35), var(--shadow-lg);
  padding: 36px 48px 40px;
  max-width: 760px;
  margin: 0 auto;
  border: none;
}
.calc-header { text-align: center; margin-bottom: 20px; }
.calc-header h2 { font-size: 1.6rem; color: #fff; font-weight: 800; letter-spacing: -0.3px; margin-bottom: 6px; text-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.calc-subtitle { font-size: 13px; color: rgba(255,255,255,0.8); margin: 0; }

/* Steps — một pill đơn, không phải 3 pill riêng */
.calc-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 28px;
  background: rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 50px;
  padding: 5px 8px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}
.calc-step {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-second);
}
.calc-step .step-num {
  width: 22px; height: 22px;
  background: var(--navy);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.calc-arrow { color: rgba(255,255,255,0.4); font-size: 13px; padding: 0 2px; }
.calc-step { color: rgba(255,255,255,0.75); }
.calc-step--active { color: #fff !important; font-weight: 700 !important; }
.calc-step--active .step-num { background: #fff !important; color: var(--orange) !important; box-shadow: 0 0 0 3px rgba(255,255,255,0.3); }

/* Select group — khung nổi bật */
.select-group {
  background: #fff;
  border: none;
  border-radius: 14px;
  padding: 24px 24px 18px;
  position: relative;
  box-shadow: 0 2px 16px rgba(0,0,0,0.12);
}
.select-group::before {
  content: '👇 Bắt đầu tại đây';
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 14px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

/* Label ngành học */
.select-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 12px;
}
.select-label i { color: var(--orange); font-size: 16px; }

/* Pulse animation cho dropdown khi chưa chọn */
@keyframes pulseSelect {
  0%, 100% { box-shadow: 0 0 0 0 rgba(234,88,12,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(234,88,12,0); }
}
.select-wrapper--idle .select2-container--default .select2-selection--single {
  border-color: var(--orange) !important;
  animation: pulseSelect 2s ease-in-out infinite;
}

/* Select2 override — dropdown cao hơn, chữ lớn hơn */
.select2-container { width: 100% !important; }
.select2-container--default .select2-selection--single {
  height: 58px !important;
  border: 2px solid var(--border) !important;
  border-radius: var(--radius) !important;
  display: flex !important;
  align-items: center !important;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--navy) !important;
  box-shadow: 0 0 0 3px rgba(26,58,110,0.1) !important;
  outline: none !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 58px !important;
  padding-left: 20px !important;
  font-size: 1.1rem !important;
  color: var(--text-primary) !important;
  font-family: 'Be Vietnam Pro', sans-serif;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 58px !important;
  right: 14px !important;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: var(--navy) !important;
}

/* Dấu tích xanh thay thế × khi đã chọn ngành */
.select2-container--default .select2-selection--single .select2-selection__clear {
  font-size: 0 !important;        /* ẩn ký tự × */
  width: 22px;
  height: 22px;
  background: #16a34a;
  border-radius: 50%;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 10px;
  transition: background 0.18s;
  line-height: 1;
  /* căn giữa theo chiều dọc với dòng text */
  position: absolute !important;
  top: 50% !important;
  right: 36px !important;
  transform: translateY(-50%) !important;
  float: none !important;
}
.select2-container--default .select2-selection--single .select2-selection__clear::before {
  content: '✓';
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}
/* Hover → đỏ + dấu × để báo "bấm để xoá" */
.select2-container--default .select2-selection--single .select2-selection__clear:hover {
  background: #dc2626 !important;
}
.select2-container--default .select2-selection--single .select2-selection__clear:hover::before {
  content: '×';
  font-size: 16px;
}

.calc-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-light);
}
.calc-note i { color: var(--orange); font-size: 11px; }
.calc-note { color: var(--text-light); }

/* ============================================================
   RESULT SECTION
   ============================================================ */
#result { padding: 0 24px 48px; }
.result-wrap { max-width: 960px; margin: 0 auto; }

/* Heading */
.result-head {
  text-align: center;
  margin-bottom: 28px;
}
.result-head .tag {
  display: inline-block;
  background: #e8f0fe;
  color: var(--navy);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 4px 14px;
  border-radius: 50px;
  margin-bottom: 10px;
}
.result-head h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.3px;
}

/* KPI cards */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 10px;
}
.kpi-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  text-align: center;
  transition: box-shadow 0.2s;
}
.kpi-card:hover { box-shadow: var(--shadow-md); }
.kpi-icon { font-size: 1.6rem; margin-bottom: 8px; }
.kpi-value {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.kpi-label {
  font-size: 11px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 5px;
}
.kpi-card.kpi-total { border-color: var(--orange); }
.kpi-card.kpi-total .kpi-value { color: var(--orange); }

.fee-note {
  font-size: 12px;
  color: var(--text-light);
  font-style: italic;
  text-align: center;
  margin-bottom: 36px;
}

/* Scholarship section */
.result-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.result-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.scholarship-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
.sc-card {
  background: var(--bg-white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  user-select: none;
}
.sc-card:hover {
  border-color: var(--navy-muted);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.sc-card.is-selected {
  border-color: var(--navy);
  background: #f0f4ff;
}
.sc-card.is-selected::after {
  content: '✓';
  position: absolute;
  top: 10px;
  right: 12px;
  width: 22px; height: 22px;
  background: var(--navy);
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.sc-card.sc-special { border-color: #ffd5b0; background: #fff8f0; }
.sc-card.sc-special:hover { border-color: var(--orange); }
.sc-card.sc-special.is-selected { border-color: var(--orange); background: #fff0e5; }
.sc-card.sc-special.is-selected::after { background: var(--orange); }
.sc-name { font-weight: 700; font-size: 14px; color: var(--navy); margin-bottom: 4px; line-height: 1.3; }
.sc-card.sc-special .sc-name { color: var(--orange); }
.sc-desc { font-size: 12px; color: var(--text-second); line-height: 1.5; }
.sc-pct  { display: inline-block; background: var(--navy); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 50px; margin-bottom: 6px; }
.sc-card.sc-special .sc-pct { background: var(--orange); }
/* Hidden radio */
.sc-radio { display: none !important; }

/* Applied fee result */
.applied-result {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  text-align: center;
  color: #fff;
  margin: 20px 0 32px;
  display: none;
}
.applied-result.show { display: block; animation: fadeSlide 0.3s ease; }
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ar-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; opacity: 0.7; margin-bottom: 8px; }
.ar-amount { font-size: 3rem; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.ar-scholarship { font-size: 13px; opacity: 0.85; margin-top: 8px; }
.ar-note { font-size: 11px; opacity: 0.6; margin-top: 4px; }

/* Semester detail table */
.semester-table-wrap {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 28px;
}
.semester-table {
  width: 100%;
  border-collapse: collapse;
}
.semester-table thead tr {
  background: linear-gradient(to right, var(--navy-dark), var(--navy-light));
}
.semester-table thead th {
  color: #fff;
  padding: 13px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  border: none;
}
.semester-table tbody td {
  padding: 12px 16px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-primary);
}
.semester-table tbody tr:last-child td { border-bottom: none; }

/* Năm chẵn — nền trắng; năm lẻ — nền xanh nhạt */
.semester-table tbody tr.yr-odd  td { background: #f8faff; }
.semester-table tbody tr.yr-even td { background: #fff; }
.semester-table tbody tr:hover   td { background: #e8f0fe !important; transition: background 0.15s; }

/* Đường kẻ phân cách đầu mỗi nhóm năm — đậm hơn */
.semester-table tbody tr.yr-first td {
  border-top: 2px solid #94a3b8;
}
.semester-table tbody tr:first-child td { border-top: none; }

/* Cột năm */
.semester-table .year-cell {
  background: var(--navy) !important;
  color: #fff !important;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-right: none;
  white-space: nowrap;
  padding: 12px 10px;
}

/* Cột học phí — số lớn, đậm, màu navy */
.semester-table .fee-cell {
  font-weight: 700;
  font-size: 15px;
  color: var(--navy);
}

/* Tín chỉ — badge nhỏ */
.semester-table .credit-badge {
  display: inline-block;
  background: #e8f0fe;
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 50px;
}

/* Print button */
.print-row { text-align: center; padding-bottom: 8px; }
.btn-print {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--navy);
  padding: 11px 32px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Be Vietnam Pro', sans-serif;
  transition: all 0.2s;
}
.btn-print:hover { background: var(--navy); color: #fff; }
.print-hint { font-size: 12px; color: var(--text-light); margin-top: 6px; }

/* ============================================================
   SCHOLARSHIP POLICY SECTION
   ============================================================ */
.policy-section {
  background: linear-gradient(180deg, #f0f5ff 0%, #fff 60%);
  padding: 72px 24px 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.policy-section::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(234,88,12,0.07) 0%, transparent 70%);
  pointer-events: none;
}
.policy-section::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(26,58,110,0.06) 0%, transparent 70%);
  pointer-events: none;
}

/* Section head */
.policy-section-head { margin-bottom: 44px; text-align: center; position: relative; z-index: 1; }

.psh-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--orange), #ff5c00);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 16px;
  border-radius: 20px;
  margin-bottom: 16px;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 12px rgba(234,88,12,0.3);
}

.policy-section-head h2 {
  font-size: 2rem;
  color: var(--navy);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 14px;
  letter-spacing: -0.5px;
}
.psh-accent {
  background: linear-gradient(135deg, var(--orange) 0%, #ff5c00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.policy-section-head > p {
  color: var(--text-second);
  font-size: 15px;
  max-width: 520px;
  margin: 0 auto 24px;
  line-height: 1.7;
}
.policy-section-head > p strong { color: var(--navy); }

/* Stats bar */
.policy-stats {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  background: var(--navy);
  border-radius: 18px;
  padding: 0;
  max-width: 640px;
  margin: 0 auto 16px;
  box-shadow: 0 8px 32px rgba(26,58,110,0.18);
  overflow: hidden;
}
.ps-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 20px 24px;
  flex: 1;
  transition: background 0.2s;
}
.ps-item:hover { background: rgba(255,255,255,0.06); }
.ps-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--orange);
  line-height: 1;
}
.ps-num i { font-size: 1.2rem; }
.ps-num small { font-size: 0.65rem; font-weight: 600; margin-left: 2px; color: rgba(255,255,255,0.55); vertical-align: middle; }
.ps-label { font-size: 11px; color: rgba(255,255,255,0.65); white-space: nowrap; font-weight: 500; }
.ps-divider { width: 1px; background: rgba(255,255,255,0.12); flex-shrink: 0; align-self: stretch; margin: 12px 0; }

.policy-note-sm {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  color: var(--text-light);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.65;
  background: #f8faff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  text-align: left;
}
.policy-note-sm i { color: var(--orange); margin-top: 2px; flex-shrink: 0; }
.policy-note-sm strong { color: var(--navy); }

/* Card description */
.pc-desc { font-size: 11px; color: var(--text-light); margin-top: 6px; line-height: 1.5; }
.policy-grid {
  display: grid;
  gap: 20px;
  max-width: 1000px;
  margin: 0 auto 20px;
}
.policy-grid--row3 { grid-template-columns: repeat(3, 1fr); }
.policy-grid--row4 { grid-template-columns: repeat(4, 1fr); margin-bottom: 0; }
.policy-card {
  text-align: center;
  padding: 24px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  transition: 0.25s;
  cursor: default;
}
.policy-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  background: var(--bg-white);
  border-color: var(--navy-muted);
}
.policy-card img { width: 56px; height: 56px; object-fit: contain; margin-bottom: 12px; border-radius: 50%; }
.policy-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin: 0 auto 12px;
}
.policy-card h3 { font-size: 13px; color: var(--navy); font-weight: 700; line-height: 1.4; text-transform: none; }
.policy-card h3 span { display: block; font-weight: 400; color: var(--text-second); font-size: 12px; margin-top: 2px; }

/* 2 card ưu tiên */
.policy-card--highlight {
  border-width: 2px !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  position: relative;
}
.policy-card--highlight::after {
  content: '⭐ Ưu tiên';
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--orange);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.policy-card--highlight:hover { transform: translateY(-5px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }

/* ============================================================
   GALLERY
   ============================================================ */
.gallery-section { overflow: hidden; }
.gallery-grid { display: grid; grid-template-columns: repeat(5, 1fr); }
.gallery-item { position: relative; overflow: hidden; aspect-ratio: 1; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.gallery-item:hover img { transform: scale(1.1); }
.gallery-item .g-overlay {
  position: absolute; inset: 0;
  background: rgba(26,58,110,0.55);
  opacity: 0;
  transition: opacity 0.3s;
  display: flex; align-items: center; justify-content: center;
}
.gallery-item:hover .g-overlay { opacity: 1; }
.gallery-item .g-overlay span { color: #fff; font-size: 28px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,0.7);
  padding: 36px 24px;
  text-align: center;
}
.footer-social { display: flex; justify-content: center; gap: 10px; margin-bottom: 14px; }
.footer-social a {
  width: 44px; height: 44px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.7); font-size: 16px;
  transition: 0.2s;
}
.footer-social a:hover { background: var(--orange); border-color: var(--orange); color: #fff; }
.footer-copy { font-size: 13px; }

/* ============================================================
   FLOATING WIDGETS
   ============================================================ */
.animated-zalo { animation: bounce 1.5s infinite; z-index: 9999 !important; margin-bottom: 40px !important; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

#chat-toggle-btn {
  position: fixed; bottom: 160px; right: 18px; z-index: 9999;
  cursor: pointer;
  background: linear-gradient(135deg, #e85d04, #f97316);
  border-radius: 50px;
  padding: 10px 16px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(232,93,4,0.45);
  transition: transform 0.2s, box-shadow 0.2s;
}
#chat-toggle-btn:hover { transform: scale(1.06); box-shadow: 0 6px 20px rgba(232,93,4,0.55); }
#chat-toggle-btn .chat-label {
  display: block;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.35;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

#chat-widget-container {
  position: fixed; bottom: 168px; right: 20px; z-index: 9998;
  width: 360px; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg); display: none;
}
#chat-close-btn {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,0.35); color: #fff;
  border: none; border-radius: 50%; width: 28px; height: 28px;
  cursor: pointer; font-size: 16px; z-index: 1; line-height: 28px; text-align: center;
}
a.scroll-top { background: var(--navy) !important; }
a.scroll-top:hover { background: var(--orange) !important; }

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .site-header, .hero-section, .calculator-section,
  .policy-section, .gallery-section, .site-footer,
  .print-row, .scholarship-cards, .result-section-title,
  #chat-toggle-btn, #chat-widget-container,
  .zalo-chat-widget, .animated-zalo, a.scroll-top,
  .calc-steps { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  #result { padding: 0 !important; }
  .kpi-card { box-shadow: none !important; border: 1px solid #ddd !important; }
  .applied-result { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .policy-grid--row3,
  .policy-grid--row4 { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .btn-apply-hero   { padding: 13px 28px; font-size: 14px; margin-top: 24px; }
  .btn-apply-policy { padding: 13px 28px; font-size: 14px; }

  /* Header */
  .header-socials { display: none; }
  .header-contacts { gap: 12px; }
  .header-sep { display: none; }
  .header-contact-item .hc-value { font-size: 13px; }

  /* Hero */
  .hero-section { padding: 44px 16px 80px; }
  .hero-title { font-size: 1.9rem; }
  .hero-subtitle { font-size: 0.95rem; }
  .hero-stats { gap: 20px; }
  .hero-divider { display: none; }
  .hero-stat strong { font-size: 1.4rem; }

  /* Calculator */
  .calculator-section { padding: 0 16px 32px; }
  .calc-card { padding: 24px 20px; border-radius: var(--radius-lg); }
  .calc-steps { display: none; }   /* ẩn steps trên mobile */
  .select-group { padding: 20px 16px 14px; }

  /* Result */
  #result { padding: 0 16px 32px; }
  .kpi-row { grid-template-columns: 1fr; gap: 10px; }
  .kpi-value { font-size: 1.6rem; }
  .kpi-card { padding: 16px 14px; }
  .scholarship-cards { grid-template-columns: 1fr; }
  .semester-table { font-size: 13px; min-width: 360px; }
  .semester-table thead th,
  .semester-table tbody td { padding: 9px 8px; }
  .semester-table .fee-cell { font-size: 13px; }
  .ar-row.ar-total .ar-val-col { font-size: 1.7rem; }

  /* Policy & gallery */
  .policy-section { padding: 44px 16px; }
  .policy-grid--row3,
  .policy-grid--row4 { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .policy-stats { border-radius: 14px; }
  .ps-item { padding: 16px 12px; }
  .ps-num { font-size: 1.2rem; }
  .policy-section-head h2 { font-size: 1.6rem; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.6rem; }
  .hero-stats { gap: 16px; }
  .calc-card { padding: 20px 16px; }
  .result-head h2 { font-size: 1.5rem; }
  .policy-grid--row3,
  .policy-grid--row4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .select2-container--default .select2-selection--single { height: 52px !important; }
  .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 52px !important; font-size: 1rem !important; }
  .select2-container--default .select2-selection--single .select2-selection__arrow { height: 52px !important; }
}

/* ── Điện thoại rất nhỏ ≤ 390px ── */
@media (max-width: 390px) {
  .btn-apply-hero   { padding: 12px 22px; font-size: 13px; width: 100%; justify-content: center; }
  .btn-apply-policy { padding: 12px 22px; font-size: 13px; width: 100%; justify-content: center; }
  .hp-container { padding: 0 12px; }
  #result { padding: 0 12px 28px; }
  .hero-title { font-size: 1.45rem; }
  .hero-stats { gap: 12px; }
  .hero-stat strong { font-size: 1.25rem; }
  .calc-card { padding: 16px 12px; }
  .calc-header h2 { font-size: 1.2rem; }
  .select-group { padding: 16px 12px 12px; }
  .select-group::before { font-size: 11px; padding: 2px 12px; }
  .policy-grid--row3,
  .policy-grid--row4 { grid-template-columns: 1fr; }
  .policy-stats { flex-wrap: wrap; border-radius: 12px; }
  .ps-divider { display: none; }
  .ps-item { width: 50%; border-bottom: 1px solid rgba(255,255,255,0.08); padding: 14px 8px; }
  .policy-section-head h2 { font-size: 1.45rem; }
  .policy-note-sm { font-size: 11px; }
  .kpi-value { font-size: 1.4rem; }
  .ar-row.ar-total .ar-val-col { font-size: 1.1rem; }
  .semester-table { font-size: 12px; }
  .semester-table thead th,
  .semester-table tbody td { padding: 7px 6px; }
}

/* ============================================================
   SCHOLARSHIP — ĐỒNG BỘ ICON + NGUYỆN VỌNG 1 NỔI BẬT
   ============================================================ */

/* ── Icon circles ── */
.sc-icon {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.sc-icon--gold   { background: #fff3cd; color: #c8860a; }
.sc-icon--blue   { background: #dbeafe; color: #1d4ed8; }
.sc-icon--green  { background: #dcfce7; color: #16a34a; }
.sc-icon--purple { background: #ede9fe; color: #7c3aed; }
.sc-icon--teal   { background: #ccfbf1; color: #0f766e; }
.sc-icon--orange { background: #ffedd5; color: #c2410c; }

/* ── Featured card: Nguyện Vọng 1 ── */
.sc-featured-wrap {
  margin-bottom: 28px;
}
.sc-featured {
  position: relative;
  background: linear-gradient(135deg, #c2410c 0%, #ea580c 45%, #f97316 100%);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 6px 28px rgba(234,88,12,0.45);
  border: 2px solid transparent;
}
.sc-featured:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 36px rgba(234,88,12,0.55);
}
.sc-featured.is-selected {
  border-color: #fed7aa;
  box-shadow: 0 0 0 3px rgba(251,146,60,0.4), 0 10px 36px rgba(234,88,12,0.55);
}

/* Shimmer overlay */
.sc-featured::before {
  content: '';
  position: absolute;
  top: -60%; left: -60%;
  width: 60%; height: 200%;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.10), transparent);
  transform: skewX(-20deg);
  animation: featuredShimmer 3s infinite;
  pointer-events: none;
}
@keyframes featuredShimmer {
  0%   { left: -60%; }
  100% { left: 120%; }
}

.sc-featured-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px 28px;
  position: relative;
  z-index: 1;
}
/* Wrapper để badge ✓ overlay lên icon */
.sc-featured-icon-wrap {
  position: relative;
  flex-shrink: 0;
}
.sc-featured-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  border: 2px solid rgba(255,255,255,0.3);
}
.sc-featured-body { flex: 1; min-width: 0; }
.sc-featured-label {
  display: inline-block;
  background: rgba(255,255,255,0.22);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 50px;
  margin-bottom: 6px;
  border: 1px solid rgba(255,255,255,0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.sc-featured-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 4px;
}
.sc-featured-desc {
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  line-height: 1.4;
}
.sc-featured-amount {
  text-align: right;
  flex-shrink: 0;
}
.sc-featured-save {
  font-size: 11px;
  color: rgba(255,255,255,0.75);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.sc-featured-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.sc-featured-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.65);
  margin-top: 2px;
}
/* Badge ✓ overlay góc dưới-phải của icon ngôi sao */
.sc-featured-check {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 22px; height: 22px;
  background: #fff;
  color: #16a34a;
  border: 2.5px solid rgba(255,255,255,0.9);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  z-index: 3;
}
.sc-featured.is-selected .sc-featured-check { display: flex; }

/* ── Lưu ý kết quả tham khảo ── */
.ar-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12px;
  color: var(--text-light);
  font-style: italic;
  margin: 6px 0 20px;
  line-height: 1.5;
}
.ar-disclaimer i {
  color: var(--navy-muted);
  margin-top: 2px;
  flex-shrink: 0;
}

/* ── Card bị khóa (mặc định, không bỏ được) ── */
.sc-card.is-locked {
  cursor: default;
}
.sc-card.is-locked::before {
  content: 'Mặc định';
  position: absolute;
  top: 8px;
  left: 10px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: var(--navy);
  color: #fff;
  padding: 2px 7px;
  border-radius: 50px;
}
.sc-card.is-locked:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--navy);
}

/* ── Section dividers ── */
.sc-section { margin-bottom: 20px; }
.sc-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-light);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sc-section-label::before,
.sc-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.sc-section-label::before { max-width: 32px; }

/* ── Updated card layout (icon + text) ── */
.sc-card {
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.sc-card:hover {
  border-color: var(--navy-muted);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.sc-card.is-selected {
  border-color: var(--navy);
  background: #f0f4ff;
  box-shadow: 0 0 0 2px rgba(26,58,110,0.15);
}
.sc-card.sc-special { border-color: #fed7aa; background: #fffbf5; }
.sc-card.sc-special:hover { border-color: var(--orange); }
.sc-card.sc-special.is-selected { border-color: var(--orange); background: #fff4ec; box-shadow: 0 0 0 2px rgba(232,93,4,0.15); }

/* Remove old ::after checkmark hack, use explicit element */
.sc-card .sc-check {
  display: none;
  position: absolute; top: 10px; right: 10px;
  width: 20px; height: 20px;
  background: var(--navy); color: #fff;
  border-radius: 50%; font-size: 10px;
  align-items: center; justify-content: center; font-weight: 900;
}
.sc-card { position: relative; }
.sc-card.is-selected .sc-check { display: flex; }
.sc-card.sc-special.is-selected .sc-check { background: var(--orange); }

.sc-card-body { flex: 1; min-width: 0; }
.sc-name {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--navy);
  margin-bottom: 3px;
  line-height: 1.3;
}
.sc-card.sc-special .sc-name { color: var(--orange); }
.sc-desc {
  font-size: 12px;
  color: var(--text-second);
  line-height: 1.45;
}
.sc-pct {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 50px;
  margin-bottom: 4px;
}
.sc-pct--blue   { background: #dbeafe; color: #1d4ed8; }
.sc-pct--green  { background: #dcfce7; color: #15803d; }
.sc-pct--purple { background: #ede9fe; color: #6d28d9; }
.sc-pct--teal   { background: #ccfbf1; color: #0f766e; }
.sc-pct--orange { background: #ffedd5; color: #c2410c; }

/* ── Applied result — bảng liệt kê ── */
.applied-result {
  background: var(--bg-white);
  border: 2px solid var(--navy);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 16px 0 28px;
  display: none;
  box-shadow: var(--shadow-md);
}
.applied-result.show { display: block; animation: fadeSlide 0.3s ease; }

.ar-header {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  color: #fff;
  padding: 12px 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ar-table { padding: 0 4px 4px; }
.ar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  font-size: 14px;
  gap: 12px;
}
.ar-row + .ar-row { border-top: 1px solid var(--border-soft); }
.ar-row .ar-label-col { flex: 1; color: var(--text-second); }
.ar-row .ar-val-col   { font-weight: 600; white-space: nowrap; flex-shrink: 0; }

/* Base fee row */
.ar-row.ar-base .ar-label-col { color: var(--text-primary); font-weight: 600; }
.ar-row.ar-base .ar-val-col   { color: var(--text-primary); }

/* Discount row — active */
.ar-row.ar-discount .ar-label-col { color: var(--navy); }
.ar-row.ar-discount .ar-val-col   { color: #16a34a; font-weight: 700; }
.ar-row.ar-discount .ar-check-icon { color: #16a34a; margin-right: 6px; font-size: 13px; }

/* Discount row — inactive (superseded by higher %) */
.ar-row.ar-inactive { opacity: 0.55; }
.ar-row.ar-inactive .ar-val-col { color: var(--text-light); font-weight: 400; }
.ar-inactive-badge {
  font-size: 10px;
  background: #f1f5f9;
  color: var(--text-light);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  font-weight: 500;
  white-space: nowrap;
}

/* Divider */
.ar-divider { height: 2px; background: var(--border); margin: 4px 0; }

/* Total savings row */
.ar-row.ar-savings .ar-label-col { color: #16a34a; font-size: 13px; }
.ar-row.ar-savings .ar-val-col   { color: #16a34a; font-size: 14px; font-weight: 700; }

/* Final fee row — cam nổi bật */
.ar-row.ar-total {
  background: linear-gradient(135deg, #c2410c 0%, #ea580c 50%, #f97316 100%);
  border-radius: 0 0 calc(var(--radius-lg) - 2px) calc(var(--radius-lg) - 2px);
  padding: 18px 20px;
  margin-top: 4px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
}
.ar-row.ar-total .ar-label-col {
  color: rgba(255,255,255,0.9);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ar-row.ar-total .ar-val-col {
  color: #fff;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -1px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

/* Savings summary row */
.ar-row.ar-savings .ar-label-col { color: #16a34a; font-size: 13px; font-weight: 600; }
.ar-row.ar-savings .ar-val-col   { color: #16a34a; font-size: 14px; font-weight: 700; }

/* Sub-base row (còn lại sau NV1) */
.ar-row.ar-subbase {
  padding: 5px 16px 5px 24px;
  background: var(--bg-soft);
  font-size: 12px;
}

/* Empty state */
.ar-empty {
  padding: 16px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
}

@media (max-width: 768px) {
  .ar-row { padding: 9px 12px; font-size: 13px; }
  .ar-row.ar-total { padding: 14px 16px; }
  .ar-row.ar-total .ar-val-col { font-size: 1.3rem; }
  .ar-row .ar-val-col { font-size: 13px; }
}

/* ── Mobile scholarship ── */
@media (max-width: 768px) {
  .sc-featured-inner { padding: 16px 18px; gap: 12px; }
  .sc-featured-icon  { width: 44px; height: 44px; font-size: 20px; }
  .sc-featured-name  { font-size: 1rem; }
  .sc-featured-value { font-size: 1.3rem; }
  .sc-featured-amount { flex-shrink: 0; }
  .sc-icon { width: 34px; height: 34px; font-size: 14px; }
  .scholarship-cards { grid-template-columns: 1fr; }
}

/* Ẩn amount chỉ trên điện thoại rất nhỏ */
@media (max-width: 390px) {
  .sc-featured-inner { padding: 14px 14px; gap: 10px; }
  .sc-featured-amount { display: none; }
  .sc-featured-name  { font-size: 0.95rem; }
}
