/* KHAI THIEN — website theme (dark + gold, đồng bộ launcher) */
:root {
  --bg: #07080b;
  --bg-2: #0b0e14;
  --panel: rgba(16, 19, 25, 0.94);
  --panel-2: #12161d;
  --line: rgba(242, 206, 124, 0.16);
  --line-strong: rgba(242, 206, 124, 0.42);
  --gold: #f2ce7c;
  --gold-deep: #c9a24a;
  --teal: #9fd8c8;
  --text: #e8edf5;
  --muted: #94a1b5;
  --danger: #ff8484;
  --ok: #7ee0a4;
  --radius: 16px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  --max: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 520px at 50% -10%, rgba(242, 206, 124, 0.13), transparent 62%),
    radial-gradient(800px 400px at 90% 110%, rgba(159, 216, 200, 0.07), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: #ffe4a6; }

img { max-width: 100%; display: block; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 8, 11, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 68px;
}

.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-logo { width: 42px; height: 42px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong {
  font-size: 17px;
  letter-spacing: 0.14em;
  color: var(--gold);
  font-weight: 700;
}
.brand-text small {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--muted);
  text-transform: uppercase;
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav a {
  padding: 9px 16px;
  border-radius: 10px;
  color: #c8d2e0;
  font-size: 14.5px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: color .18s, background .18s, border-color .18s;
}
.site-nav a:hover { color: var(--gold); background: rgba(242, 206, 124, 0.07); }
.site-nav a.active { color: var(--gold); border-color: var(--line); background: rgba(242, 206, 124, 0.06); }

.nav-login {
  border-color: var(--line-strong) !important;
  color: var(--gold) !important;
}
.nav-login:hover { background: rgba(242, 206, 124, 0.14) !important; }

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 42px; height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--gold);
  font-size: 20px;
  cursor: pointer;
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-bg {
  position: absolute; inset: 0;
  background: url("/assets/img/bg.jpg") center 30% / cover no-repeat;
  filter: saturate(.9) brightness(.42);
  transform: scale(1.03);
}
.hero-bg::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(70% 80% at 50% 35%, rgba(7, 8, 11, 0.25), rgba(7, 8, 11, 0.92) 78%),
    linear-gradient(180deg, rgba(7, 8, 11, 0.55), var(--bg));
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 68px 20px 72px;
}
.hero-logo {
  width: 132px;
  height: 132px;
  object-fit: contain;
  filter: drop-shadow(0 12px 34px rgba(242, 206, 124, 0.35));
}
.hero-title {
  margin: 20px 0 6px;
  font-size: clamp(38px, 7vw, 68px);
  line-height: 1.05;
  letter-spacing: 0.12em;
  font-weight: 800;
  background: linear-gradient(180deg, #fff3d0 0%, var(--gold) 42%, #a8802f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 10px 40px rgba(242, 206, 124, 0.18);
}
.hero-sub {
  margin: 0 0 28px;
  color: var(--teal);
  font-size: clamp(13px, 2vw, 16px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

.hero-status {
  margin-top: 26px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(9, 11, 16, 0.72);
  font-size: 13px;
  color: var(--muted);
}
.dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #7b8798;
  box-shadow: 0 0 0 4px rgba(123, 135, 152, 0.15);
}
.dot.online { background: var(--ok); box-shadow: 0 0 0 4px rgba(126, 224, 164, 0.16); }
.dot.offline { background: var(--danger); box-shadow: 0 0 0 4px rgba(255, 132, 132, 0.16); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform .16s, box-shadow .16s, background .16s, color .16s, border-color .16s;
  font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn-lg { padding: 14px 30px; font-size: 16px; }
.btn-block { width: 100%; }

.btn-primary {
  background: linear-gradient(180deg, #ffe3a4, var(--gold) 45%, var(--gold-deep));
  color: #231a05;
  box-shadow: 0 12px 28px rgba(242, 206, 124, 0.24);
}
.btn-primary:hover { color: #231a05; box-shadow: 0 16px 36px rgba(242, 206, 124, 0.34); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--line-strong);
  color: var(--gold);
}
.btn-ghost:hover { background: rgba(242, 206, 124, 0.1); color: #ffe4a6; }

.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; transform: none; }

/* ---------- Sections / cards ---------- */
.section { padding: 56px 0; }
.section:first-of-type { padding-top: 44px; }

.section-title {
  margin: 0 0 6px;
  font-size: 13px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
}
.section-title::after {
  content: "";
  display: block;
  width: 56px; height: 2px;
  margin-top: 10px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.card {
  background: linear-gradient(180deg, rgba(19, 23, 30, 0.96), rgba(12, 15, 20, 0.96));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.card-head h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0.06em;
  color: #f6e4bb;
  font-weight: 600;
}
.card-body { padding: 22px; }

.card + .card { margin-top: 22px; }

/* Server info (HTML từ API) */
.server-info h2 { color: var(--gold); font-size: 24px; margin: 0 0 4px; letter-spacing: 0.08em; }
.server-info p { color: var(--teal); margin: 0 0 14px; }
.server-info ul { margin: 0; padding-left: 20px; }
.server-info li { margin: 4px 0; }

/* Tin tức */
.news-item { padding: 14px 0; border-bottom: 1px dashed rgba(242, 206, 124, 0.12); }
.news-item:last-child { border-bottom: 0; padding-bottom: 0; }
.news-item:first-child { padding-top: 0; }
.news-item h3 { margin: 0 0 4px; font-size: 15.5px; color: #f3dfb2; }
.news-item time { font-size: 12.5px; color: var(--muted); }
.news-item p { margin: 8px 0 0; color: #c3ccda; font-size: 14.5px; }

/* Chat */
.chat-list { list-style: none; margin: 0; padding: 0; max-height: 460px; overflow: auto; }
.chat-list li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.04); font-size: 14px; }
.chat-list li:last-child { border-bottom: 0; }
.chat-name { color: var(--gold); font-weight: 600; white-space: nowrap; }
.chat-msg { color: #c9d3e1; word-break: break-word; }
.chat-time { margin-left: auto; color: #6f7c90; font-size: 12px; white-space: nowrap; }

/* ---------- Forms ---------- */
.auth-wrap {
  display: flex;
  justify-content: center;
  padding: 54px 20px 76px;
}
.auth-card { width: 100%; max-width: 520px; }
.auth-card .card-body { padding: 30px 30px 32px; }

.auth-head { text-align: center; margin-bottom: 24px; }
.auth-head img { width: 76px; height: 76px; object-fit: contain; margin: 0 auto 12px; }
.auth-head h1 { margin: 0 0 6px; font-size: 24px; letter-spacing: 0.08em; color: var(--gold); }
.auth-head p { margin: 0; color: var(--muted); font-size: 14px; }

.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 7px; font-size: 14px; color: #d3dbe7; font-weight: 500; }
.field label .req { color: var(--gold); }
.field .hint { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.field .hint.ok { color: var(--ok); }
.field .hint.bad { color: var(--danger); }

.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0b0e14;
  color: var(--text);
  font-size: 15.5px;
  font-family: inherit;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.input::placeholder { color: #5f6b7d; }
.input:focus {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(242, 206, 124, 0.12);
  background: #0d1118;
}
.input.invalid { border-color: rgba(255, 132, 132, 0.6); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.form-actions { margin-top: 22px; }

.form-foot { margin-top: 18px; text-align: center; font-size: 14px; color: var(--muted); }
.form-foot a { font-weight: 600; }

/* Thông báo */
.alert {
  display: none;
  margin-bottom: 18px;
  padding: 12px 15px;
  border-radius: 11px;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid transparent;
}
.alert.show { display: block; }
.alert.ok { background: rgba(126, 224, 164, 0.1); border-color: rgba(126, 224, 164, 0.4); color: #b9f3ce; }
.alert.err { background: rgba(255, 132, 132, 0.1); border-color: rgba(255, 132, 132, 0.4); color: #ffc2c2; }
.alert.info { background: rgba(159, 216, 200, 0.08); border-color: rgba(159, 216, 200, 0.32); color: #cdf0e7; }

/* ---------- Account ---------- */
.account-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 22px; align-items: start; }

.profile-head { display: flex; align-items: center; gap: 16px; }
.avatar {
  width: 62px; height: 62px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 26px; font-weight: 700;
  color: #231a05;
  background: linear-gradient(180deg, #ffe3a4, var(--gold-deep));
  box-shadow: 0 10px 26px rgba(242, 206, 124, 0.22);
}
.profile-head .name { font-size: 20px; color: #f6e4bb; font-weight: 600; }
.profile-head .jid { font-size: 13px; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 22px; }
.stat {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(9, 11, 16, 0.6);
  text-align: center;
}
.stat .label { display: block; font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.stat .value { display: block; margin-top: 6px; font-size: 20px; font-weight: 700; color: var(--gold); }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.data th, table.data td { padding: 11px 12px; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
table.data th { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.num { color: var(--gold); font-variant-numeric: tabular-nums; }

/* ---------- Download ---------- */
.steps { counter-reset: step; margin: 0; padding: 0; list-style: none; }
.steps li { position: relative; padding: 0 0 18px 46px; counter-increment: step; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  background: rgba(242, 206, 124, 0.07);
}
.steps li:last-child { padding-bottom: 0; }
.steps strong { color: #f3dfb2; }

.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 14px; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: #d6dee9; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  background: rgba(5, 6, 9, 0.7);
  padding: 28px 0;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13.5px;
}
.footer-links { display: flex; gap: 18px; }

/* ---------- Toast ---------- */
.toast-stack {
  position: fixed;
  right: 18px; bottom: 18px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  padding: 12px 16px;
  border-radius: 11px;
  background: #11151d;
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 14px;
  box-shadow: var(--shadow);
  animation: toast-in .18s ease-out;
}
.toast.err { border-color: rgba(255, 132, 132, 0.5); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Utilities ---------- */
.muted { color: var(--muted); }
.empty { color: var(--muted); font-size: 14px; padding: 6px 0; }
.mt-0 { margin-top: 0; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout, .account-grid { grid-template-columns: 1fr; }
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 68px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 20px 18px;
    background: rgba(7, 8, 11, 0.97);
    border-bottom: 1px solid var(--line);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 14px; }
}

@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 10px; }
  .auth-card .card-body { padding: 24px 20px 26px; }
  .hero-inner { padding: 48px 20px 54px; }
  .chat-time { display: none; }
}
