/* TÀI KHOẢN — màn đăng nhập/đăng ký và hộp Tài khoản. Mọi selector bắt đầu bằng .tk- */
.tk-man {
  position: fixed; inset: 0; z-index: 850; overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; align-items: flex-start; justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  background: radial-gradient(1200px 700px at 15% 10%, color-mix(in srgb, var(--phu) 35%, transparent) 0%, transparent 60%),
              radial-gradient(900px 600px at 90% 90%, color-mix(in srgb, var(--chinh) 25%, transparent) 0%, transparent 60%),
              var(--mat-2);
}
.tk-man .tk-the { width: min(440px, 100%); margin: auto 0; padding: 22px clamp(16px, 4vw, 28px) 18px; }
.tk-man input, .tk-hop input { user-select: text; -webkit-user-select: text; }
.tk-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.tk-logo b { display: block; font-size: 1.35rem; font-weight: 900; color: var(--chu); }
.tk-logo small { color: var(--chu-nhat); font-weight: 600; }
.tk-huy-hieu { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 30px;
  background: linear-gradient(135deg, var(--chinh), var(--phu)); box-shadow: var(--bong); }
.tk-tab { display: grid; grid-template-columns: 1fr 1fr; background: var(--mat-2); border-radius: 999px; padding: 4px; margin-bottom: 14px; }
.tk-tab button { border: 0; background: transparent; border-radius: 999px; padding: .6em; font-weight: 800; font-size: 1rem; color: var(--chu-nhat); cursor: pointer; transition: background .15s, color .15s; }
.tk-tab button.bat { background: var(--mat); color: var(--chinh); box-shadow: var(--bong); }
.tk-form { display: flex; flex-direction: column; gap: 10px; }
.tk-tieu-de { margin: 0; font-size: 1.3rem; }
.tk-mo-ta { margin: 0; color: var(--chu-nhat); font-size: .92rem; line-height: 1.45; }
.tk-truong { display: flex; flex-direction: column; gap: 4px; }
.tk-nhan { font-weight: 700; font-size: .9rem; }
.tk-goi-y { color: var(--chu-nhat); font-size: .78rem; line-height: 1.35; }
.tk-loi { color: var(--do); font-size: .8rem; font-weight: 700; min-height: 0; }
.tk-loi:empty { display: none; }
.tk-truong.co-loi .th-o-nhap { border-color: var(--do); background: color-mix(in srgb, var(--do) 6%, var(--mat)); }
.tk-o-mk { position: relative; }
.tk-o-mk .th-o-nhap { padding-right: 2.8em; }
.tk-mat { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; font-size: 1.15rem; cursor: pointer; padding: 4px 6px; line-height: 1; }
.tk-gioi-tinh button { flex: 1; min-width: 70px; }
.tk-do-manh { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 2px; }
.tk-do-manh i { height: 5px; border-radius: 3px; background: var(--vien, #ece8ff); transition: background .2s; }
.tk-do-manh[data-muc="1"] i:nth-child(-n+1) { background: var(--do); }
.tk-do-manh[data-muc="2"] i:nth-child(-n+2) { background: var(--cam); }
.tk-do-manh[data-muc="3"] i:nth-child(-n+3) { background: var(--vang); }
.tk-do-manh[data-muc="4"] i { background: var(--la); }
.tk-dong-y-hang { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; cursor: pointer; line-height: 1.4; }
.tk-dong-y-o { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--chinh); flex: none; }
.tk-lien-ket { border: 0; background: none; padding: 0; color: var(--chinh); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; align-self: center; }
.tk-form > .tk-lien-ket { margin-top: 2px; font-size: .92rem; }
.tk-nut-gui { width: 100%; margin-top: 6px; font-size: 1.05rem; }
.tk-nut-gui.dang-gui { position: relative; color: transparent; }
.tk-nut-gui.dang-gui::after { content: ''; position: absolute; width: 1.1em; height: 1.1em; border: 3px solid #fff; border-right-color: transparent; border-radius: 50%; animation: tk-xoay .7s linear infinite; }
@keyframes tk-xoay { to { transform: rotate(360deg); } }
.tk-bao { border-radius: 12px; padding: .65em .85em; font-size: .9rem; font-weight: 600; line-height: 1.4; }
.tk-bao.loi { background: #fff0f0; color: #c92a2a; }
.tk-bao.tot { background: #e6fcf5; color: #087f5b; }
.tk-bao.canh-bao { background: #fff9db; color: #8a6100; }
.tk-hop { width: min(440px, 92vw); }
.tk-hop .tk-form .nut-hang { margin-top: 8px; }
.tk-hop .tk-bao { margin-top: 10px; }
.tk-dieu-khoan p { margin: 0 0 8px; font-size: .9rem; line-height: 1.5; }
.tk-ho-so .tk-dong { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--vien, #f0edff); font-size: .95rem; }
.tk-ho-so .tk-dong span { color: var(--chu-nhat); }
.tk-ho-so .tk-dong b { text-align: right; word-break: break-all; }
.tk-ho-so .tk-goi-y { margin: 10px 0 0; }
.tk-nut-hang { justify-content: flex-start !important; }
.th-nut.tk-nut { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
@media (max-width: 420px) {
  .tk-man { padding-left: 10px; padding-right: 10px; }
  .tk-logo b { font-size: 1.2rem; }
}
.tk-logo > div:nth-child(2) { flex: 1; min-width: 0; }
.tk-ngon-ngu { border: 2px solid var(--vien, #e5dbff); background: var(--mat); display: inline-flex; align-items: center; gap: .35em; color: var(--chinh); border-radius: 999px; padding: .35em .8em; font: inherit; font-weight: 800; font-size: .85rem; cursor: pointer; flex: none; }
.tk-ngon-ngu:hover { border-color: var(--chinh); }

/* ---- Logo ảnh + bố cục theo thiết bị (HOP-DONG mục 13: tb-pc / tb-dt-ngang / tb-dt-doc / tb-mtb trên <html>) ---- */
.tk-logo-anh { height: 56px; width: auto; max-width: 62%; object-fit: contain; flex: none; filter: drop-shadow(0 3px 6px rgba(35,25,77,.18)); }
.tk-logo-chu { flex: 1; min-width: 0; }
.tk-logo-chu small { display: block; }
.tk-man .tk-the { transition: width .2s; }

/* PC và máy tính bảng: đăng ký 2 cột trong thẻ rộng, đăng nhập giữ khung gọn */
.tb-pc .tk-man .tk-the.tk-rong, .tb-mtb .tk-man .tk-the.tk-rong { width: min(780px, 100%); }
.tb-pc .tk-form-dk, .tb-mtb .tk-form-dk, .tb-dt-ngang .tk-form-dk { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; align-items: start; }
.tk-form-dk > .tk-bao, .tk-form-dk > .tk-dong-y, .tk-form-dk > .tk-nut-gui { grid-column: 1 / -1; }
.tb-pc .tk-man { align-items: center; }

/* Điện thoại xoay ngang: màn thấp (~360–430px) -> đầu thẻ 1 hàng, 2 cột, chữ gợi ý ẩn bớt, ít đệm */
.tb-dt-ngang .tk-man { padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); align-items: flex-start; }
.tb-dt-ngang .tk-man .tk-the { width: min(860px, 100%); padding: 10px 16px 12px; border-radius: 18px; margin: auto 0; }
.tb-dt-ngang .tk-man .tk-the:not(.tk-rong) { width: min(640px, 100%); }
.tb-dt-ngang .tk-dau { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.tb-dt-ngang .tk-dau .tk-logo { margin: 0; flex: 1; min-width: 0; gap: 8px; }
.tb-dt-ngang .tk-dau .tk-tab { margin: 0; flex: 0 0 min(300px, 45%); order: 2; }
.tb-dt-ngang .tk-dau .tk-tab button { padding: .45em; }
.tb-dt-ngang .tk-logo-anh { height: 38px; }
.tb-dt-ngang .tk-huy-hieu { width: 38px; height: 38px; font-size: 22px; border-radius: 12px; }
.tb-dt-ngang .tk-logo b { font-size: 1.05rem; }
.tb-dt-ngang .tk-logo small { font-size: .75rem; }
.tb-dt-ngang .tk-form { gap: 6px; }
.tb-dt-ngang .tk-form-dk { gap: 6px 16px; }
.tb-dt-ngang .tk-form-dn { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.tb-dt-ngang .tk-form-dn > .tk-bao, .tb-dt-ngang .tk-form-dn > .tk-nut-gui, .tb-dt-ngang .tk-form-dn > .tk-lien-ket { grid-column: 1 / -1; }
.tb-dt-ngang .tk-nhan { font-size: .8rem; }
.tb-dt-ngang .tk-man .th-o-nhap { padding: .5em .8em; min-height: 42px; }
.tb-dt-ngang .tk-form > .tk-truong > .tk-goi-y:not(.tk-manh-chu) { display: none; }
.tb-dt-ngang .tk-nut-gui { margin-top: 2px; }
.tb-dt-ngang .tk-dong-y-hang { font-size: .85rem; align-items: center; }
.tb-dt-ngang .tk-mo-ta { font-size: .85rem; }
.tb-dt-ngang .tk-tieu-de { font-size: 1.1rem; }
.tb-dt-ngang .tk-hop { max-height: 92dvh; }
/* Điện thoại ngang: 3 cột để cả form đăng ký nằm gọn trong 1 màn (7 ô = 3 hàng, ô đồng ý nằm cạnh ô nhập lại mật khẩu) */
.tb-dt-ngang .tk-form-dk { grid-template-columns: repeat(3, 1fr); }
.tb-dt-ngang .tk-form-dk > .tk-dong-y { grid-column: span 2; align-self: center; }
.tb-dt-ngang .tk-gioi-tinh button { min-width: 0; padding: .4em .3em; }

/* ---- Tài khoản khách ---- */
.tk-hoac { display: flex; align-items: center; gap: 10px; color: var(--chu-nhat); font-size: .82rem; font-weight: 700; margin: 2px 0; }
.tk-hoac::before, .tk-hoac::after { content: ''; flex: 1; height: 1px; background: var(--vien, #e5dbff); }
.tk-nut-khach { width: 100%; font-size: 1rem; }
.tk-khach-goi-y { text-align: center; }
.tk-dong-cong { border: 0; background: var(--mat-2); color: var(--chu-nhat); width: 34px; height: 34px; border-radius: 50%; font-size: 1rem; font-weight: 900; cursor: pointer; flex: none; }
.tk-dong-cong:hover { color: var(--chinh); }
.th-nut.tk-nut-la-khach { border-color: var(--chinh); color: var(--chinh); }
.tb-dt-ngang .tk-form-dn > .tk-hoac, .tb-dt-ngang .tk-form-dn > .tk-khach-goi-y { display: none; }
.tb-dt-ngang .tk-form-dn > .tk-nut-khach { grid-column: 2; margin-top: 2px; }
.tb-dt-ngang .tk-form-dn:has(> .tk-nut-khach) > .tk-nut-gui { grid-column: 1; }
.tb-dt-ngang .tk-form-dn > .tk-lien-ket { order: 3; }   /* nút gửi + nút khách nằm cùng hàng, "quên mật khẩu" xuống dưới */

/* ---- Icon SVG của lõi (HOP-DONG mục 15: không dùng emoji) ---- */
.tk-man .th-nut, .tk-hop .th-nut { display: inline-flex; align-items: center; justify-content: center; gap: .45em; }
.tk-huy-hieu { color: #fff; }
.tk-huy-hieu .th-svg { width: 28px; height: 28px; }
.tb-dt-ngang .tk-huy-hieu .th-svg { width: 20px; height: 20px; }
.tk-mat { color: var(--chu-nhat); display: grid; place-items: center; }
.tk-mat.tk-mat-mo { color: var(--chinh); }
.tk-mat:not(.tk-mat-mo)::after { content: ''; position: absolute; width: 1.25em; height: 2px; background: currentColor; transform: rotate(-45deg); border-radius: 2px; }
.tk-lien-ket { display: inline-flex; align-items: center; gap: .35em; }
.tk-dong-cong { display: grid; place-items: center; }
.th-nut.tk-nut { display: inline-flex; align-items: center; gap: .4em; }
.th-nut.tk-nut > span { overflow: hidden; text-overflow: ellipsis; }
.tb-dt-ngang .tk-form-dn > .tk-lien-ket { justify-self: center; }
