:root {
  --paper: #FBF8F1;
  --paper-deep: #F3EEE1;
  --panel: #FFFFFF;
  --ink: #182619;
  --muted: #5B6858;
  --muted-2: #8A9488;
  --line: #E4DDC8;
  --gold: #E8A93A;
  --gold-deep: #A87D1E;
  --gold-bright: #F2B703;
  --green: #2F6B3A;
  --green-deep: #16321E;
  --green-darkest: #0F2E1C;
  --blue: #1F5C99;
  --blue-deep: #164572;
  --gold-tint: #FBF1DA;
  --green-tint: #EAF2E9;
  --blue-tint: #E7EFF7;
  --red-tint: #FDF2F2;
  --red: #C53030;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Be Vietnam Pro', sans-serif;
  -webkit-font-smoothing: antialiased;
}
.font-display { font-family: 'Lora', serif; }
::selection { background: var(--gold); color: var(--ink); }

.paper-texture {
  background-image: radial-gradient(circle at 1px 1px, rgba(47,107,58,.06) 1px, transparent 0);
  background-size: 28px 28px;
}

.eyebrow {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold-deep);
  display: inline-flex; align-items: center; gap: 8px;
}
.eyebrow::before { content: ''; width: 20px; height: 1.5px; background: var(--gold); }

.btn-primary {
  background: var(--green); color: #fff; font-weight: 600;
  transition: all .2s ease; border: 1.5px solid var(--green);
}
.btn-primary:hover { background: var(--green-deep); border-color: var(--green-deep); transform: translateY(-1px); }

.btn-gold {
  background: var(--gold); color: #fff; font-weight: 600;
  transition: all .2s ease; border: 1.5px solid var(--gold);
}
.btn-gold:hover { background: var(--gold-deep); border-color: var(--gold-deep); }

.btn-ghost {
  background: transparent; color: var(--ink); font-weight: 600;
  border: 1.5px solid var(--line); transition: all .2s ease;
}
.btn-ghost:hover { border-color: var(--green); color: var(--green); }

/* Dark "sandwich" section (hero / closing CTA) — mirrors the slide-deck's
   dark-green + soft gold/green decorative circles title-slide treatment */
.section-dark {
  background: radial-gradient(140% 120% at 15% -10%, #1D4A2C 0%, var(--green-darkest) 55%, #0B2315 100%);
  color: #F4F1E6;
  position: relative;
  overflow: hidden;
}
.section-dark .eyebrow { color: var(--gold-bright); }
.section-dark .eyebrow::before { background: var(--gold-bright); }
.deco-circle {
  position: absolute; border-radius: 50%; pointer-events: none;
}
.deco-circle-gold {
  background: radial-gradient(circle at 35% 30%, var(--gold-bright), var(--gold-deep) 70%);
  filter: blur(0px);
  opacity: 0.9;
}
.deco-circle-green {
  background: radial-gradient(circle at 35% 30%, #3C7A48, transparent 70%);
  opacity: 0.5;
}
.deco-circle-ring {
  border: 1.5px solid rgba(232,169,58,0.35);
  background: transparent;
}

/* Icon badge — colored circle behind an icon, used for feature/benefit cards */
.icon-badge {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
  box-shadow: 0 8px 16px -6px rgba(24,38,25,.25);
}
.icon-badge-green { background: linear-gradient(145deg, #3D8B4C, var(--green-deep)); }
.icon-badge-gold { background: linear-gradient(145deg, var(--gold-bright), var(--gold-deep)); }
.icon-badge-blue { background: linear-gradient(145deg, #3B82C4, var(--blue-deep)); }
.icon-badge-rose { background: linear-gradient(145deg, #E0748A, #B8425A); }

/* Step flow — numbered circles connected by a horizontal line, matching
   the deck's "Quy trình 5 bước" diagram */
.step-flow { position: relative; }
.step-flow::before {
  content: ''; position: absolute; top: 22px; left: 8%; right: 8%; height: 2px;
  background: repeating-linear-gradient(90deg, var(--line) 0 8px, transparent 8px 16px);
  z-index: 0;
}
@media (max-width: 767px) { .step-flow::before { display: none; } }
.step-num {
  width: 44px; height: 44px; border-radius: 50%; position: relative; z-index: 1;
  background: linear-gradient(145deg, var(--gold-bright), var(--gold-deep)); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Lora', serif; font-weight: 700; font-size: 17px;
  box-shadow: 0 8px 16px -6px rgba(168,125,30,.5);
  margin: 0 auto;
}

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -8px rgba(24,38,25,0.08);
}

/* Interactive Wheel */
.wheel-wrap { position: relative; width: 100%; max-width: 600px; aspect-ratio: 1/1; margin: 0 auto; }
.wheel-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 34%; aspect-ratio: 1/1; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--paper-deep));
  border: 2px solid var(--gold);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 6%;
  box-shadow: 0 20px 40px -20px rgba(24,38,25,.25);
}
.wheel-center .num {
  font-family: 'Lora', serif; font-weight: 700; font-size: clamp(1.6rem, 4vw, 2.5rem); line-height: 1;
  background: linear-gradient(90deg, var(--gold-deep), var(--green), var(--blue));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.wheel-center .tag { font-size: clamp(.6rem, 1.4vw, .75rem); color: var(--muted); margin-top: 6px; font-weight: 600; }

.wheel-item {
  position: absolute; top: 50%; left: 50%; width: 140px; margin-left: -70px;
  transform: rotate(calc(360deg / 7 * var(--i))) translateY(-220px) rotate(calc(-360deg / 7 * var(--i)));
  text-align: center; transition: all 0.3s ease; cursor: pointer;
}
.wheel-item:hover { transform: rotate(calc(360deg / 7 * var(--i))) translateY(-226px) rotate(calc(-360deg / 7 * var(--i))) scale(1.08); }
.wheel-item .dot {
  width: 42px; height: 42px; border-radius: 50%; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Lora', serif; font-weight: 700; font-size: 15px; color: #fff;
  box-shadow: 0 8px 16px -6px rgba(24,38,25,.35);
}
.wheel-item h4 { font-size: 13px; font-weight: 700; margin: 0 0 2px; }
.wheel-item p { font-size: 11px; color: var(--muted); line-height: 1.3; margin: 0; }

@media (max-width: 768px) {
  .wheel-wrap { max-width: 380px; }
  .wheel-item { width: 110px; margin-left: -55px; transform: rotate(calc(360deg / 7 * var(--i))) translateY(-145px) rotate(calc(-360deg / 7 * var(--i))); }
  .wheel-item .dot { width: 34px; height: 34px; font-size: 12px; }
  .wheel-item h4 { font-size: 11px; }
  .wheel-item p { display: none; }
}

.tri-card { position: relative; }
.tri-card .badge-num {
  position: absolute; top: -12px; left: 16px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* Overlay for locked content */
.lock-overlay {
  position: absolute; inset: 0; border-radius: 16px;
  background: linear-gradient(180deg, rgba(251,248,241,0.2) 0%, rgba(251,248,241,0.96) 65%);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 24px;
  backdrop-filter: blur(2px);
}

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

.flow-arrow { color: var(--muted-2); font-weight: 700; }

.num-chip {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--paper-deep); border: 1.5px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--green-deep);
  flex-shrink: 0;
}

/* Portal Nav Pill */
.nav-pill {
  padding: 8px 16px; border-radius: 9999px; font-size: 13.5px; font-weight: 600;
  color: var(--muted); transition: all 0.2s ease; cursor: pointer; display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.nav-pill:hover { color: var(--ink); background: rgba(0,0,0,0.03); }
.nav-pill.active { background: var(--green); color: #fff; box-shadow: 0 4px 12px rgba(47,107,58,0.2); }

/* Nav Dropdown Menu */
.nav-dropdown-wrapper {
  position: relative;
  display: inline-block;
}
.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 260px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 14px 30px -4px rgba(24, 38, 25, 0.18), 0 4px 12px -2px rgba(24, 38, 25, 0.08);
  padding: 8px 0;
  margin-top: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 100;
}
.nav-dropdown-wrapper:hover .nav-dropdown-menu,
.nav-dropdown-wrapper:focus-within .nav-dropdown-menu,
.nav-dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-dropdown-item:hover {
  background: var(--paper-deep);
  color: var(--green);
}
.nav-dropdown-item .item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--green-tint);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  border: 1px solid rgba(47,107,58,0.15);
}

/* "Thêm" dropdown panel — position:fixed, toạ độ do JS tính (toggleNavMoreMenu)
   ngay trước khi hiện, để KHÔNG bị header cha (overflow-hidden) cắt mất, khác
   với .nav-dropdown-menu (position:absolute, chỉ dùng cho dropdown lồng trong
   luồng bình thường của trang, không nằm trong khối header có overflow-hidden). */
.nav-more-menu {
  position: fixed;
  min-width: 260px;
  max-width: 300px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 14px 30px -4px rgba(24, 38, 25, 0.18), 0 4px 12px -2px rgba(24, 38, 25, 0.08);
  padding: 8px 0;
  z-index: 200;
}

/* Modal Backdrop */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(24, 38, 25, 0.6);
  backdrop-filter: blur(4px); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}

/* Status Badges */
.status-badge {
  display: inline-flex; align-items: center; gap: 4px; px: 10px; py: 3px;
  border-radius: 9999px; font-size: 11.5px; font-weight: 700;
}
.status-active { background: var(--green-tint); color: var(--green-deep); border: 1px solid rgba(47,107,58,0.2); }
.status-pending { background: var(--gold-tint); color: var(--gold-deep); border: 1px solid rgba(201,154,46,0.3); }
.status-blocked { background: var(--red-tint); color: var(--red); border: 1px solid rgba(197,48,48,0.2); }

.role-badge {
  background: var(--blue-tint); color: var(--blue-deep); border: 1px solid rgba(31,92,153,0.2);
  padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700;
}

/* Progress Bar */
.progress-bg { background: var(--paper-deep); border-radius: 9999px; overflow: hidden; height: 10px; }
.progress-fill { background: linear-gradient(90deg, var(--green), var(--gold)); height: 100%; transition: width 0.5s ease; }

/* Tab view visibility */
.portal-view { display: none; }
.portal-view.active { display: block; }

/* Public & Portal Nav Desktop Responsive Fix */
#public-nav { display: none !important; }
#portal-nav { display: none !important; }
@media (min-width: 1024px) {
  #public-nav.is-public-active { display: flex !important; }
  #portal-nav.is-logged-in { display: flex !important; }
}

/* Portal nav pills can outgrow the header's fixed-height overflow-hidden row
   (e.g. extra admin-only items like "Quản trị nội dung") — scroll internally
   instead of letting items get clipped/unreachable. Scrollbar hidden but the
   row still pans via mouse wheel/trackpad/touch. */
#portal-nav { overflow-x: auto; min-width: 0; scrollbar-width: none; -ms-overflow-style: none; }
#portal-nav::-webkit-scrollbar { display: none; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }

/* Slide Presentation Thumbnails & Lightbox */
.slide-thumb-btn {
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--paper-deep);
  color: var(--muted);
  border: 1px solid var(--line);
  transition: all 0.2s ease;
  cursor: pointer;
}
.slide-thumb-btn:hover {
  background: var(--green-tint);
  color: var(--green-deep);
}
.slide-thumb-btn.active {
  background: var(--green-deep);
  color: #fff;
  border-color: var(--green-deep);
  box-shadow: 0 4px 10px rgba(22, 50, 30, 0.25);
}
.scrollbar-thin::-webkit-scrollbar { height: 6px; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 9999px; }
