/* ===== Hungdiffusion.com — shared tokens & chrome (dark mặc định) ===== */
:root {
  --bg: radial-gradient(130% 110% at 82% -12%, #211F45 0%, #131228 46%, #0C0B1D 100%);
  --surface: rgba(255, 255, 255, .09);
  --surface2: #2B2966;
  --ink: #FFFFFF;
  --muted: #E4E3F7;
  --faint: #C0BFE4;
  --border: rgba(255, 255, 255, .1);
  --border2: rgba(255, 255, 255, .22);
  --accent: #5858E6;
  --accent2: #5858E6;
  --accent-strong: #9B9BF2;
  --accent-soft: rgba(88, 88, 230, .14);
  --accent-line: rgba(88, 88, 230, .42);
  --on-accent: #FFFFFF;
  --card: #FFFFFF;
  --card-ink: #2B2A55;
  --card-muted: #55547E;
  --chrome: rgba(17, 16, 36, .92);
  --footer-card: #12111F;
  --blob-o: 1;
  --chip: #232250;
  --frame: linear-gradient(175deg, rgba(255, 255, 255, .05) 0%, rgba(255, 255, 255, .05) 100%);
}

:root[data-theme="light"] {
  --bg: linear-gradient(170deg, #ECEEFF 0%, #F6F7FF 38%, #FFFFFF 62%, #EFECFF 100%);
  --surface: rgba(88, 88, 230, .07);
  --surface2: #EBECFA;
  --ink: #1C1B3A;
  --muted: #3C3B6B;
  --faint: #6D6C9C;
  --border: rgba(28, 27, 58, .14);
  --border2: rgba(28, 27, 58, .24);
  --accent-strong: #4646D0;
  --accent-soft: rgba(88, 88, 230, .1);
  --accent-line: rgba(88, 88, 230, .38);
  --chrome: rgba(255, 255, 255, .93);
  --footer-card: #FFFFFF;
  --blob-o: .22;
  --chip: #E4E5F7;
  --frame: linear-gradient(175deg, rgba(88, 88, 230, .07) 0%, rgba(88, 88, 230, .07) 100%);
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
}

a { color: var(--accent-strong); text-decoration: none; }
a:hover { color: #BCBCF8; }
:root[data-theme="light"] a:hover { color: #4646D0; }

.mono { font-family: 'IBM Plex Mono', monospace; }
.ic { width: 18px; height: 18px; flex: none; }

@keyframes tlUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes tlIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== Header ===== */
.hd-nav {
  animation: tlIn .5s ease 0s both;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 12px 48px;
  border-bottom: 1px solid var(--border);
  background: var(--chrome);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.hd-nav .brand { display: flex; align-items: center; color: var(--ink); }
.hd-nav .brand img { height: 36px; width: auto; display: block; }
:root[data-theme="light"] .hd-nav .brand img { filter: invert(1) hue-rotate(180deg) saturate(1.15); }

.hd-nav .nav-right { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.hd-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 14.5px;
  font-weight: 500;
}
.hd-nav .nav-links a { color: var(--muted); }
.hd-nav .nav-links a:hover { color: var(--accent-strong); }
.hd-nav .nav-links a.active { color: var(--accent-strong); font-weight: 600; }

.theme-toggle {
  position: relative;
  width: 54px;
  height: 28px;
  border-radius: 999px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  cursor: pointer;
  user-select: none;
  flex: none;
  padding: 0;
  transition: border-color .2s ease;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle .knob {
  position: absolute;
  top: 3px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: left .3s cubic-bezier(.22, 1, .36, 1);
}
:root[data-theme="light"] .theme-toggle .knob { left: 29px; }
.theme-toggle .knob svg { width: 11px; height: 11px; }
.theme-toggle .knob .sun-ic { display: none; }
:root[data-theme="light"] .theme-toggle .knob .sun-ic { display: block; }
:root[data-theme="light"] .theme-toggle .knob .moon-ic { display: none; }

.nav-menu-btn {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 30px;
  height: 30px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex: none;
}
.nav-menu-btn span {
  display: block;
  width: 24px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform .2s ease, opacity .2s ease;
}
.hd-nav.open .nav-menu-btn span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.hd-nav.open .nav-menu-btn span:nth-child(2) { opacity: 0; }
.hd-nav.open .nav-menu-btn span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

@media (max-width: 860px) {
  .hd-nav { padding: 10px 20px; min-height: 60px; }
  .hd-nav .nav-right { gap: 12px; }
  .nav-menu-btn { display: inline-flex; }
  .hd-nav .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--chrome);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 16px 32px rgba(0, 0, 0, .18);
    padding: 8px 0;
  }
  .hd-nav.open .nav-links { display: flex; }
  .hd-nav .nav-links a { padding: 14px 24px; font-size: 15.5px; }
  .hd-nav .nav-links a.active { background: var(--accent-soft); }
}

/* ===== Form đăng ký khoá học (popup) ===== */
.reg-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  background: rgba(10, 9, 25, .66);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 44px 20px;
}
.reg-overlay.open { display: flex; }
.reg-modal {
  position: relative;
  margin: auto;
  background: #FFFFFF;
  color: #1C1B3A;
  border-radius: 22px;
  padding: 42px 48px 38px;
  max-width: 680px;
  width: 100%;
  box-shadow: 0 32px 90px rgba(9, 8, 33, .45);
  animation: tlUp .42s cubic-bezier(.22, 1, .36, 1) both;
}

/* nút đóng */
.regf-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: #F1F2F6;
  color: #6E6D8E;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.regf-close:hover { background: #FC4F4F; color: #fff; }

/* header: phụ (eyebrow) nhỏ trên - chính (title) lớn dưới */
.regf-head { margin-right: 44px; }
.regf-eyebrow {
  margin: 0 0 5px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #5858E6;
}
.reg-modal h2 {
  margin: 0;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.14;
  color: #16152E;
}
.regf-underline {
  display: block;
  width: 56px;
  height: 4px;
  border-radius: 2px;
  background: #FC4F4F;
  margin-top: 16px;
}
.regf-intro { margin: 18px 0 0; font-size: 14.5px; line-height: 1.6; color: #4A496E; }
.regf-intro .hl { color: #4646D0; font-weight: 700; }
.regf-intro a.hl:hover { color: #5858E6; }
.regf-sub {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 13px 0 0;
  padding: 10px 14px;
  background: #F4F5FA;
  border: 1px solid #E9EAF2;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.55;
  color: #6E6D8E;
}
.regf-sub svg { flex: none; color: #5858E6; margin-top: 2px; }
.regf-sub a { color: #4646D0; font-weight: 700; }
.regf-sub a:hover { color: #5858E6; }

/* form */
.reg-form { display: flex; flex-direction: column; gap: 12px; margin-top: 22px; }
.regf-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.regf-field { position: relative; display: flex; }
.regf-ic {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  color: #A6A5BE;
  pointer-events: none;
  transition: color .15s ease;
}
.regf-field.area .regf-ic { top: 16px; transform: none; }
.regf-field:focus-within .regf-ic { color: #5858E6; }

.reg-form select,
.reg-form input,
.reg-form textarea {
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  font-size: 15px;
  color: #1C1B3A;
  background: #F6F7FB;
  border: 1.5px solid #E6E7F0;
  border-radius: 12px;
  padding: 14px 16px 14px 44px;
  width: 100%;
  outline: none;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.reg-form select:focus,
.reg-form input:focus,
.reg-form textarea:focus {
  border-color: #5858E6;
  background: #fff;
  box-shadow: 0 0 0 3.5px rgba(88, 88, 230, .13);
}
.reg-form input::placeholder,
.reg-form textarea::placeholder { color: #9E9DB7; }
.reg-form textarea { min-height: 118px; resize: vertical; line-height: 1.6; }

/* select tuỳ biến caret */
.regf-field.sel select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 42px; }
.regf-caret {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #A6A5BE;
  pointer-events: none;
}

/* info-box ghi chú */
.regf-info {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  background: rgba(88, 88, 230, .07);
  border: 1px solid rgba(88, 88, 230, .16);
  border-left: 3px solid #5858E6;
  border-radius: 12px;
  padding: 13px 15px;
  margin: 2px 0;
}
.regf-info svg { flex: none; color: #5858E6; margin-top: 1px; }
.regf-info p { margin: 0; font-size: 13px; line-height: 1.65; color: #4E4D72; }
.regf-info .hl { color: #4646D0; font-weight: 700; }
.regf-info a.hl { text-decoration: none; }
.regf-info a.hl:hover { color: #5858E6; }

/* nút gửi */
.reg-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  margin-top: 4px;
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: .02em;
  color: #fff;
  background: #5858E6;
  border: none;
  border-radius: 12px;
  padding: 15px 26px;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(88, 88, 230, .34);
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.reg-submit:hover { background: #4646D0; transform: translateY(-1px); box-shadow: 0 14px 30px rgba(88, 88, 230, .42); }
.reg-submit:disabled { opacity: .6; cursor: default; transform: none; box-shadow: none; }
.reg-submit svg { flex: none; }

.reg-status { margin: 2px 0 0; font-size: 14px; font-weight: 600; text-align: center; }
.reg-status.success { color: #17934C; }
.reg-status.error { color: #D64545; }
.reg-status.error a { color: #5858E6; }

@media (max-width: 560px) {
  .reg-overlay { padding: 16px 10px; }
  .reg-modal { padding: 30px 22px 26px; border-radius: 18px; }
  .regf-head { margin-right: 34px; }
  .reg-modal h2 { font-size: 28px; }
  .regf-eyebrow { font-size: 10px; }
  .regf-2col { grid-template-columns: 1fr; }
}

/* ===== Cặp nút Đăng ký / Liên hệ + nút nổi (upscale, workshop) ===== */
.cta-pair { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 28px;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  border: 1.5px solid transparent;
  background: var(--accent);
  color: #fff;
  transition: filter .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}
.cta-btn:hover { filter: brightness(1.08); color: #fff; }
.cta-btn svg { flex: none; }
.cta-btn.ghost { background: transparent; border-color: var(--border2); color: var(--ink); }
.cta-btn.ghost:hover { background: var(--surface); border-color: var(--accent); color: var(--ink); filter: none; }

.fab-reg {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 150;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  padding: 13px 22px;
  border-radius: 999px;
  cursor: pointer;
  border: none;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 30px rgba(88, 88, 230, .45);
  animation: tlIn .4s ease .6s both;
  transition: filter .18s ease, transform .18s ease;
}
.fab-reg:hover { filter: brightness(1.08); transform: translateY(-2px); }
.fab-reg svg { flex: none; }
@media (max-width: 560px) {
  .fab-reg { right: 14px; bottom: 14px; padding: 12px 18px; font-size: 14px; }
}
