/* Man dang nhap — be mat thuong hieu.
 *
 * Moi mau/font/bo goc o day den tu bien trong /chung/thuong_hieu.css, sinh ra tu
 * thiet_ke/token.json nhanh `thuong_hieu`. Khong hardcode ma mau — `npm test` tu choi.
 *
 * Trang nay KHONG nap /chung/token_thiet_ke.css: no la be mat thuong hieu, khong phai
 * chrome ung dung, va no khong doi theo che do sang/toi cua may. */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--th-chu-viet);
  background: var(--th-nen-sau);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--th-lien-ket); text-decoration: none; }
a:hover { color: var(--th-lien-ket-ro); }
input::placeholder { color: var(--th-cho-dien); }
input:focus { outline: none; }

/* --------------------------------------------------------------- nen */

.man {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: var(--th-nen-sau);
}

.nen-dai {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, var(--th-dai-a) 0%, var(--th-dai-b) 46%, var(--th-dai-c) 100%);
}

.nen-quang { position: absolute; inset: 0; opacity: 0.9; }

.nen-quang > div { position: absolute; border-radius: 50%; }

.quang-a {
  width: 900px; height: 900px; top: -32%; left: -12%;
  background: radial-gradient(circle at 40% 40%,
    rgba(var(--th-quang-a-rgb), 0.34), rgba(var(--th-quang-a-rgb), 0) 66%);
  animation: quang-a 22s ease-in-out infinite;
}

.quang-b {
  width: 760px; height: 760px; bottom: -28%; right: -8%;
  background: radial-gradient(circle at 50% 50%,
    rgba(var(--th-quang-b-rgb), 0.5), rgba(var(--th-quang-b-rgb), 0) 68%);
  animation: quang-b 28s ease-in-out infinite;
}

.nen-quet { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }

.nen-quet > div {
  position: absolute; top: -20%; left: 0; width: 260px; height: 140%;
  background: linear-gradient(90deg,
    rgba(var(--th-sang-rgb), 0) 0%, rgba(var(--th-sang-rgb), 0.07) 50%, rgba(var(--th-sang-rgb), 0) 100%);
  animation: quet 16s linear infinite;
}

@keyframes quang-a {
  0%   { transform: translate3d(-4%, -3%, 0) scale(1); }
  50%  { transform: translate3d(6%, 4%, 0) scale(1.14); }
  100% { transform: translate3d(-4%, -3%, 0) scale(1); }
}
@keyframes quang-b {
  0%   { transform: translate3d(3%, 5%, 0) scale(1.08); }
  50%  { transform: translate3d(-6%, -4%, 0) scale(1); }
  100% { transform: translate3d(3%, 5%, 0) scale(1.08); }
}
@keyframes quet {
  0%   { transform: translateX(-30%) rotate(18deg); opacity: 0; }
  40%  { opacity: 0.5; }
  100% { transform: translateX(130%) rotate(18deg); opacity: 0; }
}

/* Nguoi bat "giam chuyen dong" o he dieu hanh thuong bat vi chuyen dong gay chong mat
 * hoac dau nua dau. Ba hoat anh nay thuan trang tri nen tat han, khong lam cham lai. */
@media (prefers-reduced-motion: reduce) {
  .quang-a, .quang-b, .nen-quet > div, .nen-anh > div { animation: none; transition: none; }
  .nen-quet { display: none; }
}

/* Anh that cua cong ty, luan phien. Trong khi chua co anh nao thi cac lop nay rong va
 * nen chuyen sac o tren tu ganh — trang van dep, khong co o trong. */
.nen-anh { position: absolute; inset: 0; }
.nen-anh > div {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1.4s ease;
}
.nen-anh > div.hien { opacity: 1; }

.nen-phu {
  position: absolute; inset: 0; pointer-events: none;
  background: var(--th-phu-anh);
}

/* Hoa tiet hinh vuong bo tron xoay nghieng ben phai — nhac lai bo goc cua logo. */
.hoa-tiet {
  position: absolute; right: -12vw; top: 50%;
  width: 46vw; min-width: 420px; aspect-ratio: 1;
  transform: translateY(-50%) rotate(-14deg);
  pointer-events: none;
}
.hoa-tiet > div { position: absolute; }
.hoa-tiet .v1 { inset: 0;   border: 1px solid rgba(var(--th-trang-tri-rgb), 0.16); border-radius: 24%; }
.hoa-tiet .v2 { inset: 11%; border: 1px solid rgba(var(--th-trang-tri-rgb), 0.13); border-radius: 26%; }
.hoa-tiet .v3 { inset: 22%; border: 1px solid rgba(var(--th-trang-tri-rgb), 0.1);  border-radius: 28%; }
.hoa-tiet .v4 {
  inset: 33%; border-radius: 30%;
  background: linear-gradient(135deg, rgba(var(--th-trang-tri-rgb), 0.1), rgba(var(--th-trang-tri-rgb), 0));
}
.hoa-tiet .doc {
  left: 50%; top: 8%; width: 1px; height: 84%;
  background: linear-gradient(180deg,
    rgba(var(--th-trang-tri-rgb), 0), rgba(var(--th-trang-tri-rgb), 0.16), rgba(var(--th-trang-tri-rgb), 0));
}
.hoa-tiet .ngang {
  top: 50%; left: 8%; width: 84%; height: 1px;
  background: linear-gradient(90deg,
    rgba(var(--th-trang-tri-rgb), 0), rgba(var(--th-trang-tri-rgb), 0.16), rgba(var(--th-trang-tri-rgb), 0));
}

/* --------------------------------------------------------------- bo cuc */

.khung {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 5vw;
  padding: 30px 5vw;
  pointer-events: none; /* nen khong bat chuot; rieng the dang nhap bat lai */
}

/* --------------------------------------------------------------- cot trai */

.gioi-thieu {
  max-width: 620px;
  display: flex; flex-direction: column; gap: 30px;
  color: var(--th-trang);
}

.thuong-hieu { display: flex; align-items: center; gap: 16px; }

.thuong-hieu .dau {
  flex: 0 0 56px; width: 56px; height: 56px;
  border-radius: var(--th-tron-logo);
  background: var(--th-trang); overflow: hidden;
  display: grid; place-items: center;
  box-shadow: var(--th-bong-logo);
}
/* logo-thv-dau.png chi co bieu tuong TH — cum chu "TRAN HOANG VIET NAM" da nam ngay ben
 * canh, in lai lan nua trong o 56px thi khong doc duoc ma con roi. `contain` giu ty le
 * that cua bieu tuong (rong hon cao), khong keo gian. */
.thuong-hieu .dau img {
  width: 40px; height: 40px;
  object-fit: contain;
}

.thuong-hieu .ten {
  display: flex; flex-direction: column;
  line-height: 1.2; white-space: nowrap;
}
.thuong-hieu .ten b {
  font-size: 17px; font-weight: var(--th-trong-rat-dam); letter-spacing: 0.15em;
}
.thuong-hieu .ten span {
  font-size: 10px; letter-spacing: 0.42em; color: rgba(var(--th-sang-rgb), 0.7);
}

.thuong-hieu .vach {
  flex: 0 0 auto; width: 1px; height: 38px;
  background: rgba(var(--th-sang-rgb), 0.2); margin-left: 4px;
}

.thuong-hieu .nhan {
  display: block; max-width: 200px;
  font-size: 10px; line-height: 1.6; letter-spacing: 0.14em;
  text-transform: uppercase; color: rgba(var(--th-sang-rgb), 0.6);
  text-wrap: balance;
}

.loi { display: flex; flex-direction: column; gap: 18px; }
.loi .gach { width: 56px; height: 3px; background: var(--th-nhan-manh); }
.loi h1 {
  margin: 0;
  font-size: clamp(34px, 4.6vw, 66px); line-height: 1.03;
  font-weight: var(--th-trong-dam); letter-spacing: -0.035em;
  text-wrap: pretty;
}
.loi p {
  margin: 0; max-width: 470px;
  font-size: clamp(14px, 1.15vw, 16.5px); line-height: 1.75;
  color: rgba(var(--th-sang-rgb), 0.72);
  text-wrap: pretty;
}

/* --------------------------------------------------------------- the dang nhap */

.the {
  width: 424px; max-width: 100%;
  padding: 28px 32px 24px;
  border-radius: var(--th-tron-the);
  background: var(--th-the-nen);
  box-shadow: var(--th-bong-the);
  display: flex; flex-direction: column; gap: 13px;
  pointer-events: auto;
}

.the .dinh {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.the .dinh h2 {
  margin: 0; font-size: 22px; font-weight: var(--th-trong-dam);
  color: var(--th-muc-dam); letter-spacing: -0.015em;
}
.the .dinh p {
  margin: 0; font-size: 12.5px; color: var(--th-muc-mo); text-wrap: pretty;
}
/* CHI cot tieu de. Truoc day selector la `.dinh > div`, va no vo luon `.ngon-ngu` —
 * hai nut VI / 中文 bi xep chong len nhau thay vi nam canh nhau. */
.the .dinh .chu-de { display: flex; flex-direction: column; gap: 5px; }

.ngon-ngu {
  display: flex; padding: 3px; gap: 2px;
  border-radius: var(--th-tron-tron); background: var(--th-ray-nen);
  flex: 0 0 auto;
}
.ngon-ngu button {
  border: none; cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: var(--th-trong-dam);
  padding: 6px 12px; border-radius: var(--th-tron-tron);
  background: transparent; color: var(--th-ray-chu);
  transition: background .16s, color .16s;
}
.ngon-ngu button[aria-pressed='true'] {
  background: var(--th-trang); color: var(--th-muc-dam);
  box-shadow: var(--th-bong-vien-ray);
}

/* Nut chinh — Microsoft Entra ID. Day la duong dang nhap duy nhat cua nhan vien. */
.nut-chinh {
  height: 46px; margin-top: 3px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border: none; border-radius: var(--th-tron-o);
  background: linear-gradient(135deg, var(--th-nut-a), var(--th-nut-b));
  color: var(--th-tren-nut); font-family: inherit; font-size: 15px; font-weight: var(--th-trong-dam);
  cursor: pointer;
  box-shadow: var(--th-bong-nut);
  transition: transform .14s, box-shadow .14s;
}
.nut-chinh:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--th-bong-nut-noi);
}
.nut-chinh:active:not(:disabled) { transform: translateY(0); }
.nut-chinh:disabled { opacity: 0.55; cursor: default; }

/* Bon o vuong cua logo Microsoft. */
.o-ms {
  display: grid;
  grid-template-columns: 9px 9px; grid-template-rows: 9px 9px; gap: 2px;
}
.o-ms i { display: block; }
.o-ms i:nth-child(1) { background: var(--ms-do); }
.o-ms i:nth-child(2) { background: var(--ms-xanh-la); }
.o-ms i:nth-child(3) { background: var(--ms-xanh-lam); }
.o-ms i:nth-child(4) { background: var(--ms-vang); }

.hoac[hidden] { display: none; }
.hoac {
  display: flex; align-items: center; gap: 12px;
  color: var(--th-muc-rat-mo); font-size: 10.5px; letter-spacing: 0.12em;
}
.hoac span { flex: 1; height: 1px; background: var(--th-duong-ke); }

.nut-phu {
  height: 44px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid var(--th-o-vien); border-radius: var(--th-tron-o);
  background: var(--th-trang); color: var(--th-chu-nut-phu);
  font-family: inherit; font-size: 14px; font-weight: var(--th-trong-vua);
  cursor: pointer;
  transition: border-color .16s, background .16s;
}
.nut-phu:hover:not(:disabled) { border-color: var(--th-o-vien-dam); background: var(--th-nen-hover); }
.nut-phu:disabled { opacity: 0.55; cursor: default; }

/* Nut Microsoft: vien nhat hon mot chut de bon o vuong mau la diem nhan, khong phai vien. */
.nut-ms { font-weight: var(--th-trong-vua); }

.the .chan {
  margin: 0; text-align: center; font-size: 11px; color: var(--th-muc-rat-mo);
}

/* --------------------------------------------------------------- o nhap */

.o { display: flex; flex-direction: column; gap: 6px; }
.o > span {
  font-size: 12.5px; font-weight: var(--th-trong-vua); color: var(--th-muc-vua);
}
.o input {
  height: 44px; padding: 0 15px;
  border-radius: var(--th-tron-o); border: 1px solid var(--th-o-vien);
  background: var(--th-o-nen);
  font-size: 14.5px; font-family: inherit; color: var(--th-muc-dam);
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.o input:focus {
  border-color: var(--th-tieu-diem); background: var(--th-trang);
  box-shadow: 0 0 0 3px rgba(var(--th-tieu-diem-rgb), 0.14);
}

.o-mat-khau { position: relative; display: flex; }
.o-mat-khau input { flex: 1; padding-right: 58px; }
.o-mat-khau button {
  position: absolute; right: 5px; top: 5px; height: 34px; padding: 0 11px;
  border: none; background: transparent; color: var(--th-muc-mo);
  font-family: inherit; font-size: 12px; font-weight: var(--th-trong-vua);
  cursor: pointer; border-radius: 8px;
}
.o-mat-khau button:hover { background: var(--th-ray-nen); color: var(--th-nut-a); }

/* --------------------------------------------------------------- form dang nhap */

.dang-nhap { display: flex; flex-direction: column; gap: 13px; margin: 0; }
.dang-nhap[hidden] { display: none; }

/* --------------------------------------------------------------- bao loi */

.bao {
  margin: 0; padding: 10px 13px;
  border-radius: var(--th-tron-o);
  border: 1px solid var(--th-o-vien); background: var(--th-o-nen);
  font-size: 12.5px; line-height: 1.55; color: var(--th-muc-dam);
}
.bao[hidden] { display: none; }

/* --------------------------------------------------------------- ban tieng Trung */

/* Be Vietnam Pro KHONG co glyph chu Han — trinh duyet tu roi sang font du phong. Khai ro
 * font CJK thay vi pho mac cho "last resort" cua he dieu hanh: khong khai thi tren mot so
 * may Linux ra o vuong rong. Danh sach phu Windows / macOS / Android / Linux. */
:root:lang(zh) {
  --th-chu-viet: 'Be Vietnam Pro', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB',
    'Noto Sans CJK SC', 'Source Han Sans SC', 'WenQuanYi Micro Hei', system-ui, sans-serif;
}

/* Chu Han cao het o chu, khong co phan tren/duoi de tho nhu chu Latin: line-height 1.03
 * dat cho tieu de tieng Viet lam hai dong chu Han dinh vao nhau. */
:lang(zh) .loi h1 { line-height: 1.24; letter-spacing: 0; }
:lang(zh) .loi p { line-height: 1.9; }

/* --------------------------------------------------------------- man hep */

@media (max-width: 1024px) {
  /* `minmax(0, 1fr)` chu KHONG phai `1fr`: `1fr` co san toi thieu la kich thuoc noi dung,
   * nen o hep hon noi dung thi cot tran ra ngoai man hinh thay vi co lai.
   *
   * Va KHONG dung `justify-items: center` de can giua: no doi be rong cua o tu "gian day"
   * sang "vua noi dung", tuc la the 424px giu nguyen 424px tren man 430px va bi cat. Can
   * giua bang `margin-inline: auto` cua chinh o do. */
  .khung {
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    gap: 34px;
    padding: 40px 24px;
  }
  .gioi-thieu, .the { width: 100%; margin-inline: auto; }
  .gioi-thieu { max-width: 560px; }
  .the { max-width: 424px; }
  .hoa-tiet { display: none; }
}

@media (max-width: 640px) {
  .khung { padding: 32px 18px; gap: 26px; }
  .loi { gap: 14px; }
  .loi h1 { font-size: 32px; }
  .gioi-thieu { gap: 22px; }
  .the { padding: 24px 20px 20px; }
  .thuong-hieu .vach, .thuong-hieu .nhan { display: none; }
}
