/* =============================================================================
   site.css — giao diện chung cho phần người dùng (trang chủ, các trang con,
   đăng nhập). Cùng bộ màu + font với khu quản trị (dashboard/admin-ui.css):
   mực #0e1a33, xanh #1f4fd1, teal #0e8577, IBM Plex. Không dùng Tailwind.
   ============================================================================= */
:root {
    --ink: #0e1a33;
    --muted: #5b6b86;
    --faint: #8696b6;
    --line: #dfe5ef;
    --line-2: #cfd7e4;
    --paper: #f4f6fa;
    --card: #ffffff;
    --card-2: #f8fafd;
    --blue: #1f4fd1;
    --blue-ink: #1a43b3;
    --blue-soft: #e8eefc;
    --teal: #0e8577;
    --teal-soft: #e3f4f1;
    --amber: #a8620f;
    --amber-soft: #fdf3e3;
    --red: #b8322a;
    --red-soft: #fcebea;
    --radius: 12px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(14,26,51,.05), 0 10px 28px -16px rgba(14,26,51,.22);
    --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --cond: 'IBM Plex Sans Condensed', 'IBM Plex Sans', 'Arial Narrow', sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

    /* Tên biến cũ của redesign.css (trang chủ) -> trỏ về bộ màu mới */
    --ground: var(--paper);
    --surface: var(--card);
    --surface-2: var(--card-2);
    --border: var(--line);
    --border-strong: var(--line-2);
    --accent: var(--blue);
    --accent-ink: var(--blue-ink);
    --accent-soft: var(--blue-soft);
    --ok: var(--teal);
    --ok-soft: var(--teal-soft);
    --danger: var(--red);
}

/* ---------- Nền ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased;
    min-height: 100vh; display: flex; flex-direction: column; }
body > main, body > .pg { flex: 1 0 auto; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; }
img, svg { vertical-align: middle; }
img { max-width: 100%; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

/* Tiện ích tối thiểu thay cho Tailwind (markup + JS cũ của trang chủ còn dùng) */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.relative { position: relative; } .absolute { position: absolute; } .fixed { position: fixed; } .inset-0 { inset: 0; }
.flex { display: flex; } .inline-block { display: inline-block; }
.items-center { align-items: center; } .justify-center { justify-content: center; } .justify-between { justify-content: space-between; }
.overflow-x-auto { overflow-x: auto; } .overflow-y-auto { overflow-y: auto; } .max-h-60 { max-height: 15rem; }
.min-w-full { min-width: 100%; } .text-left { text-align: left; } .text-center { text-align: center; }
.z-10 { z-index: 10; } .mt-1 { margin-top: .25rem; } .mt-2 { margin-top: .5rem; } .mb-4 { margin-bottom: 1rem; }
.p-2 { padding: .5rem; } .p-4 { padding: 1rem; } .rounded { border-radius: 6px; } .shadow-lg { box-shadow: var(--shadow); }
.text-sm { font-size: 13.5px; } .cursor-pointer { cursor: pointer; }
.animate-spin { animation: site-spin .8s linear infinite; }
.opacity-25 { opacity: .25; } .opacity-75 { opacity: .75; }
.swal2-html-container svg.animate-spin { display: block; width: 32px; height: 32px; margin: 4px auto; color: var(--blue); }
@keyframes site-spin { to { transform: rotate(360deg); } }

/* ---------- Header ---------- */
.sh { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.9); backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.sh-in { max-width: 1120px; margin: 0 auto; padding: 0 16px; height: 60px; display: flex; align-items: center; gap: 18px; }
.sh-brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none !important; }
.sh-brand svg { width: 26px; height: 26px; flex: none; }
.sh-brand b { font: 700 20px/1 var(--cond); letter-spacing: -.01em; }
.sh-brand small { font: 500 11px/1 var(--mono); letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.sh-nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.sh-link { color: var(--muted); font-weight: 500; font-size: 14.5px; padding: 8px 11px; border-radius: 8px; white-space: nowrap; text-decoration: none !important; }
.sh-link:hover { color: var(--ink); background: var(--card-2); }
.sh-link[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--blue); border-radius: 8px 8px 0 0; }
.sh-cta { margin-left: 8px; display: inline-flex; align-items: center; gap: 7px; background: var(--ink); color: #fff !important; font-weight: 600;
    font-size: 14px; padding: 9px 15px; border-radius: 9px; text-decoration: none !important; }
.sh-cta:hover { background: #1c2a4a; }
.sh-user { position: relative; margin-left: 8px; }
.sh-avatar { display: block; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: var(--card-2); }
.sh-avatar img { width: 36px; height: 36px; border-radius: 50%; display: block; }
.sh-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; z-index: 50; }
.sh-menu-who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.sh-menu-who b { display: block; font-size: 14px; }
.sh-menu-who span { font-size: 12.5px; color: var(--muted); }
.sh-menu a, .sh-menu button { display: flex; width: 100%; align-items: center; gap: 9px; padding: 8px 10px; border: 0; border-radius: 7px; background: none;
    color: var(--ink); font-size: 14px; text-align: left; text-decoration: none !important; }
.sh-menu a:hover, .sh-menu button:hover { background: var(--card-2); }
.sh-menu svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.sh-toggle { display: none; margin-left: auto; width: 40px; height: 40px; border: 0; border-radius: 9px; background: none; color: var(--ink);
    align-items: center; justify-content: center; }
.sh-toggle svg { width: 22px; height: 22px; }
.sh-mobile { border-top: 1px solid var(--line); background: var(--card); padding: 6px 16px 12px; }
.sh-mobile a, .sh-mobile button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 4px; border: 0; border-bottom: 1px solid var(--line);
    background: none; color: var(--ink); font-size: 15px; text-align: left; text-decoration: none !important; }
.sh-mobile a[aria-current="page"] { color: var(--blue); font-weight: 600; }
.sh-mobile .sh-cta { justify-content: center; margin: 12px 0 0; border: 0; background: var(--ink); color: #fff !important; font-weight: 600; border-radius: 9px; }
@media (max-width: 860px) {
    .sh-nav { display: none; }
    .sh-toggle { display: inline-flex; }
}

/* ---------- Footer ---------- */
.site-footer { margin-top: 48px; background: var(--card); border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; padding: 18px 16px; }
.site-footer .ft { max-width: 1088px; margin: 0 auto; /* = .sh-in 1120px trừ lề 16px hai bên -> thẳng hàng với header */ display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 28px; }
.site-footer .ft-brand { display: flex; flex-direction: column; gap: 4px; }
.site-footer .ft-brand a { color: var(--ink); font-weight: 600; }
.site-footer .ft-live { display: inline-flex; align-items: center; gap: 6px; }
.site-footer .ft-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.site-footer .ft-live b, .site-footer dd b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.site-footer .ft-stats { margin: 0; display: grid; gap: 6px; }
.site-footer .ft-row { display: grid; grid-template-columns: 82px repeat(4, minmax(96px, auto)); align-items: baseline; gap: 4px 18px; }
.site-footer dt { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.site-footer dd { margin: 0; }
@media (max-width: 640px) {
    .site-footer .ft { flex-direction: column; align-items: flex-start; }
    .site-footer .ft-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .site-footer dt { grid-column: 1 / -1; }
}

/* ---------- Trang con ---------- */
.pg { width: 100%; max-width: 1120px; margin: 0 auto; padding: 32px 16px 0; }
.pg.narrow { max-width: 760px; }
.pg-head { margin-bottom: 22px; }
.pg-title { font: 700 clamp(26px, 4vw, 34px)/1.1 var(--cond); letter-spacing: -.01em; }
.pg-sub { color: var(--muted); font-size: 15px; margin-top: 8px; max-width: 70ch; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.card + .card, .grid2 + .card, .card + .grid2 { margin-top: 16px; }
.card h2 { font: 600 19px/1.25 var(--cond); }
.card .hint { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid2 > .card { margin-top: 0; } /* khoảng cách trong lưới do gap lo */
@media (max-width: 860px) { .grid2 { grid-template-columns: minmax(0, 1fr); } } /* 1fr giãn theo bảng rộng -> tràn ngang */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 500 14px var(--sans); padding: 9px 15px; border-radius: var(--radius-sm);
    border: 1px solid var(--line-2); background: var(--card); color: var(--ink); text-decoration: none !important; white-space: nowrap; }
.btn:hover { border-color: #b3bfd2; background: var(--card-2); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--blue-ink); border-color: var(--blue-ink); }
.btn.ink { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.btn.ink:hover { background: #1c2a4a; }
.btn.block { width: 100%; }
.btn.lg { padding: 12px 18px; font-size: 15px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; flex: none; }
.spin { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: site-spin .7s linear infinite; }

.field + .field { margin-top: 14px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.field .help { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.input { width: 100%; font: 15px var(--sans); color: var(--ink); background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.input.mono { font-family: var(--mono); font-size: 14px; }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; min-width: 0; }

.note { padding: 11px 14px; border-radius: var(--radius-sm); font-size: 14px; line-height: 1.5; background: var(--blue-soft); color: #1b3d99; }
.note.ok { background: var(--teal-soft); color: #0b6b60; }
.note.warn { background: var(--amber-soft); color: var(--amber); }
.note.bad { background: var(--red-soft); color: var(--red); }
.note a { color: inherit; font-weight: 600; text-decoration: underline; }
.check-line { font-size: 14px; margin-top: 10px; min-height: 21px; overflow-wrap: anywhere; }
.check-line .ok { color: var(--teal); } .check-line .bad { color: var(--red); } .check-line .wait { color: var(--muted); }

.tag { display: inline-block; font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 999px; background: #eef2f6; color: var(--muted); white-space: nowrap; }
.tag.ok { background: var(--teal-soft); color: var(--teal); }
.tag.warn { background: var(--amber-soft); color: var(--amber); }

.tbl-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
    padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--card-2); }
.tbl .r { text-align: right; }
.tbl-empty { padding: 30px 10px; text-align: center; color: var(--muted); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; font-size: 13.5px; color: var(--muted); }

/* Bảng bản ghi DNS + các bước hướng dẫn */
.dns { width: 100%; border-collapse: collapse; font-size: 14px; }
.dns th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 6px 14px 6px 0; }
.dns td { padding: 9px 14px 9px 0; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 13.5px; white-space: nowrap; }
.steps { list-style: none; counter-reset: s; display: grid; gap: 12px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; font-size: 14.5px; }
.steps li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--blue-soft); color: var(--blue);
    font: 600 13px/26px var(--mono); text-align: center; }

/* Danh sách thông tin (liên hệ, ngân hàng) */
.facts { margin: 0; display: grid; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.facts > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--line); }
.facts > div:first-child { border-top: 0; }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.facts .hl { background: var(--blue-soft); }
.facts .hl dd { color: #1b3d99; font-family: var(--mono); }

/* ---------- Đăng nhập / đăng ký (login/*) ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.auth-side { position: relative; background: var(--ink); color: #c9d3e6; padding: 40px clamp(28px, 5vw, 64px); display: flex; flex-direction: column; }
/* Mép phải răng cưa như tem thư — cùng "dấu bưu điện" với dải trạng thái trong Quản trị */
.auth-side::after { content: ''; position: absolute; top: 0; right: -6px; bottom: 0; width: 12px;
    background: radial-gradient(circle at 100% 50%, var(--paper) 4px, transparent 4.6px) 0 6px / 12px 14px repeat-y; }
.auth-side .sh-brand { color: #fff; }
.auth-side .sh-brand small { color: #7d8db0; }
.auth-pitch { margin: auto 0; max-width: 420px; }
.auth-pitch h1 { font: 700 clamp(28px, 3.4vw, 40px)/1.1 var(--cond); color: #fff; letter-spacing: -.01em; }
.auth-pitch p { margin-top: 14px; font-size: 15.5px; color: #a9b6cf; }
.auth-points { list-style: none; margin-top: 26px; display: grid; gap: 12px; font-size: 14.5px; }
.auth-points li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; }
.auth-points li::before { content: ''; width: 9px; height: 9px; margin: 6px 0 0 6px; border-radius: 50%; background: #5fd3c3; box-shadow: 0 0 0 4px rgba(95,211,195,.16); }
.auth-side .auth-foot { font-size: 13px; color: #7d8db0; }
.auth-side .auth-foot a { color: #c9d3e6; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .pg-title { font-size: 30px; }
.auth-card form { margin-top: 22px; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 13.5px; }
.auth-alt { margin-top: 18px; text-align: center; font-size: 14px; color: var(--muted); }
.auth-captcha { margin-top: 16px; display: flex; justify-content: center; min-height: 78px; }
.auth-mobile-brand { display: none; margin-bottom: 26px; }
@media (max-width: 860px) {
    .auth { grid-template-columns: 1fr; }
    .auth-side { display: none; }
    .auth-mobile-brand { display: inline-flex; }
    .auth-main { align-items: flex-start; padding-top: 32px; }
}

/* ---------- Avatar + cấp VIP (dùng ở header, bảng vinh danh) ---------- */
.avatar-vip-0 { box-shadow: 0 0 0 2px #e2e8f0; }
.avatar-vip-1 { box-shadow: 0 0 0 2px #93c5fd; }
.avatar-vip-2 { box-shadow: 0 0 0 2px #86efac; }
.avatar-vip-3 { box-shadow: 0 0 0 2px #fcd34d, 0 0 10px 2px rgba(252,211,77,.55); }
.avatar-vip-4 { box-shadow: 0 0 0 2px #f87171, 0 0 12px 3px rgba(248,113,113,.5); animation: vip-glow 4s linear infinite; }
.avatar-vip-5 { box-shadow: 0 0 0 2px #c084fc, 0 0 14px 4px rgba(192,132,252,.55); animation: vip-glow 6s linear infinite; }
@keyframes vip-glow { 0%, 100% { filter: hue-rotate(0deg); } 50% { filter: hue-rotate(160deg); } }
.vip-0 { color: #6b7280; } .vip-1 { color: #2f7ad8; } .vip-2 { color: #15924a; } .vip-3 { color: #1549a1; } .vip-4 { color: #b78605; }
.vip-5 { color: #8b3fd9; }
.vip-5-svg { filter: drop-shadow(0 0 5px rgba(192,132,252,.8)); }
svg.w-6 { width: 1.5em; height: 1.5em; } svg.inline-block { display: inline-block; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
