/* Trang đăng nhập có ngôn ngữ thị giác riêng, không phụ thuộc app shell. */
:root {
  color-scheme: dark;
  --access-bg: #102725;
  --access-text: #f4f6ec;
  --access-muted: #a1b7af;
  --access-line: #36514a;
  --access-panel: #193430;
  --display-bg: #20473d;
  --display-text: #f0f5e9;
  --display-muted: #b8cfc0;
  --display-line: #4c7563;
  --display-mark: rgba(197, 233, 193, .075);
  --journey-bg: #f3f5eb;
  --journey-text: #18352c;
  /* Chữ phụ trong thẻ hành trình chỉ 10px trên nền giấy sáng — #6d8174 dừng ở
     3,8:1, dưới ngưỡng AA của chữ nhỏ. */
  --journey-muted: #5a6f62;
  --journey-line: #dce6d9;
  /* Hai màu nhấn lấy THẲNG từ logo: khiên = jade #6fdec0, chữ "Bot" = đồng #e0aa4e.
     Bản trước dùng xanh chanh (#c8ed98) + hồng cam (#f6a579) nên cả màn xung đột
     màu với đúng cái emblem đặt ở góc trên. */
  --accent: #6fdec0;
  --accent-text: #082a22;
  --signal: #e0aa4e;
  --warn-bg: #1b3229;
  --warn-text: #f2d9a4;
  --error-bg: #33201e;
  --error-text: #ffc7bb;
}

[data-theme="light"] {
  color-scheme: light;
  --access-bg: #faf9f4;
  --access-text: #17372f;
  --access-muted: #5b7269;
  --access-line: #d5dfd5;
  --access-panel: #f0f4ec;
  /* Nền mảng phải đủ sâu: thẻ hành trình gần như trắng (#fcfdf8), hai màu sát nhau
     thì thẻ tan vào nền. */
  --display-bg: #cfe3d5;
  --display-text: #16362e;
  --display-muted: #40614f;
  --display-line: #a9c5ae;
  --display-mark: rgba(43, 96, 68, .065);
  --journey-bg: #fcfdf8;
  --journey-text: #18352c;
  /* Chữ phụ trong thẻ hành trình chỉ 10px trên nền giấy sáng — #6d8174 dừng ở
     3,8:1, dưới ngưỡng AA của chữ nhỏ. */
  --journey-muted: #5a6f62;
  --journey-line: #dce6d9;
  --accent: #0a6e57;
  --accent-text: #f2fbf7;
  /* Đồng đậm cho nền sáng: bản #9a6410 chỉ đạt 3,7:1 trên nền mint ở cỡ 10px —
     chữ nhỏ phải qua 4,5. */
  --signal: #7d5108;
  --warn-bg: #f7eeda;
  --warn-text: #6b4a12;
  --error-bg: #fbe7e2;
  --error-text: #8f2b21;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Be Vietnam Pro", "Segoe UI", sans-serif; background: var(--access-bg); color: var(--access-text); -webkit-font-smoothing: antialiased; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
svg { display: block; }
.mono, .login-note .mono { font-family: "DM Mono", Consolas, monospace; font-size: .92em; }

.skip-link { position: fixed; z-index: 10; top: 10px; left: 10px; padding: 12px 16px; border-radius: 9px; background: var(--accent); color: var(--accent-text); font-weight: 700; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
:where(button, a):focus-visible { outline: 3px solid var(--signal); outline-offset: 4px; }

/* `align-items: start`: mỗi cột cao theo NỘI DUNG của nó. Mặc định của grid là
   stretch, nên cột phải (thẻ hành trình) kéo cột trái cao theo, rồi
   `justify-content: center` bên trong lại đóng gói nội dung ngắn vào giữa → khoảng
   trống mênh mông phía trên và nút đăng nhập bị đẩy tuột khỏi màn hình. */
.login-layout { display: grid; grid-template-columns: minmax(400px, 43%) minmax(0, 1fr); min-height: 100svh; align-items: start; }
.access, .showcase { min-width: 0; min-height: 100svh; }
.access { display: flex; flex-direction: column; padding: clamp(20px, 2.4vw, 34px); background: var(--access-bg); }
.access-header, .access-footer, .showcase-header, .showcase-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; }

/* Logotype thật (mark + tên + kicker trong một tệp 700×200, nền trong suốt).
   Chỉ một ảnh hiện lên, chọn theo chủ đề — hai tệp là hai bản chữ khác nhau vì
   bản tối cần chữ nhạt, bản sáng cần chữ đậm. */
.brand { display: flex; align-items: center; }
/* 78px đỉnh: tương đương cỡ chữ tít "Vào ca." ngay dưới, để logo là một khối của
   bố cục chứ không phải phù chứng nhỏ ở góc. */
.brand-lock { display: none; height: clamp(52px, min(6.6vw, 10vh), 78px); width: auto; }
[data-theme="dark"] .brand-lock.is-dark { display: block; }
[data-theme="light"] .brand-lock.is-light { display: block; }
/* Nút đổi nền: có nền lấp để ra hình một cái nút — viền trần 42px với icon 19px
   trông như một vòng tròn rỗng có dấu nhỏ giữa (đúng cái bị chỉ ra). */
.theme-toggle { display: grid; place-items: center; flex: none; width: 48px; height: 48px; padding: 0; border: 1px solid var(--access-line); border-radius: 50%; background: var(--access-panel); color: var(--access-text); cursor: pointer; transition: background .2s, transform .2s, border-color .2s; }
.theme-toggle:hover { background: color-mix(in srgb, var(--access-line) 34%, var(--access-panel)); border-color: var(--display-line); transform: rotate(20deg); }
.theme-toggle svg { width: 22px; height: 22px; }
.theme-moon, [data-theme="light"] .theme-sun { display: none; }
[data-theme="light"] .theme-moon { display: block; }

/* `safe center`: nội dung vừa thì đứng giữa, nội dung DÀI hơn cột thì xếp từ mép
   trên. `center` thuần đẩy phần thừa tràn lên trên đỉnh và không cuộn tới được. */
.access-main { flex: 1; display: flex; flex-direction: column; justify-content: safe center; gap: clamp(26px, 4.2vh, 46px); width: min(100%, 480px); margin: 10px auto; }
.eyebrow, .panel-heading, .access-footer, .showcase-header, .showcase-index, .journey-kicker, .journey-status, .journey-bottom, .showcase-footer { font-family: "DM Mono", Consolas, monospace; letter-spacing: .075em; }
.eyebrow { display: flex; align-items: center; gap: 13px; margin: 0 0 22px; color: var(--access-muted); font-size: 10px; font-weight: 500; }
.eyebrow-rule { width: 24px; height: 1px; background: var(--signal); }
.access-intro h1 { margin: 0; font-size: clamp(44px, 4.4vw, 68px); line-height: 1.05; font-weight: 800; letter-spacing: -.075em; }
.access-intro h1 span { color: var(--accent); }
.access-description { max-width: 390px; margin: 16px 0 0; color: var(--access-muted); font-size: 14px; line-height: 1.75; }

.login-panel { padding-top: 18px; border-top: 1px solid var(--access-line); }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; color: var(--access-muted); font-size: 10px; font-weight: 500; }
.secure-label { display: inline-flex; align-items: center; gap: 8px; }
.secure-dot, .journey-status i { display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
.login-panel h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.04em; }
.panel-description { margin: 8px 0 0; font-size: 13px; line-height: 1.65; color: var(--access-muted); }
.login-actions { margin-top: 18px; }
.google-button { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 60px; padding: 10px 18px; border-radius: 11px; background: var(--accent); color: var(--accent-text); text-decoration: none; font-size: 14px; font-weight: 700; transition: transform .18s, filter .18s, box-shadow .18s; }
.google-button:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 12px 30px rgba(0, 0, 0, .16); }
.google-button:active { transform: translateY(0); }
.google-icon { flex: none; padding: 3px; width: 27px; height: 27px; border-radius: 6px; background: #fff; }
.button-arrow { width: 18px; height: 18px; margin-left: auto; transition: transform .18s; }
.google-button:hover .button-arrow { transform: translateX(3px); }
.login-help { display: flex; align-items: center; gap: 9px; margin: 14px 0 0; color: var(--access-muted); font-size: 11px; line-height: 1.5; }
.login-help svg { width: 15px; height: 15px; flex: none; }
.login-note, .login-msg { font-size: 12px; line-height: 1.65; border-radius: 9px; }
/* Cảnh báo cấu hình: nền tối hơn một bậc + vạch đồng bên trái. Để nguyên nền nâu
   trên trang xanh thì nó đọc như một khối lạc màu chứ không phải lời dặn. */
.login-note { margin-top: 16px; padding: 13px 15px; border-left: 2px solid var(--signal); background: var(--warn-bg); color: var(--warn-text); }
.login-note b { color: inherit; }
.login-note:empty, .login-msg:empty { display: none; }
.login-msg { margin: 15px 0 0; padding: 12px 14px; }
.login-msg.err { background: var(--error-bg); color: var(--error-text); }
.login-msg.ok { background: var(--access-panel); color: var(--access-text); }
.access-footer { padding-top: 16px; border-top: 1px solid var(--access-line); color: var(--access-muted); font-size: 9px; }
.access-footer b { margin-left: 6px; font-weight: 400; opacity: .65; }

.showcase { position: relative; isolation: isolate; display: flex; flex-direction: column; overflow: hidden; padding: clamp(20px, 2.4vw, 34px); background: var(--display-bg); color: var(--display-text); }
.showcase::before { content: ""; position: absolute; z-index: -1; inset: 0; background-image: linear-gradient(to right, var(--display-mark) 1px, transparent 1px), linear-gradient(to bottom, var(--display-mark) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(90deg, transparent, #000 25%); pointer-events: none; }
.showcase::after { content: ""; position: absolute; z-index: -1; width: 560px; height: 560px; right: -230px; top: -260px; border: 1px solid var(--display-line); border-radius: 50%; box-shadow: 0 0 0 80px color-mix(in srgb, var(--display-line) 12%, transparent), 0 0 0 160px color-mix(in srgb, var(--display-line) 7%, transparent); opacity: .55; pointer-events: none; }
.showcase-header { min-height: 43px; color: var(--display-muted); font-size: 10px; font-weight: 500; }
.showcase-cross { display: inline-grid; color: var(--signal); }
.showcase-cross svg { width: 26px; height: 26px; }
.showcase-content { flex: 1; display: flex; flex-direction: column; justify-content: safe center; gap: clamp(22px, 3.4vh, 40px); width: min(100%, 720px); margin: 10px auto; }
.showcase-index { margin: 0 0 16px; color: var(--signal); font-size: 10px; font-weight: 500; }
.showcase-copy h2 { margin: 0; font-size: clamp(28px, 2.7vw, 44px); line-height: 1.22; letter-spacing: -.06em; font-weight: 800; }
.showcase-copy h2 em { color: var(--accent); font-style: normal; }
.showcase-copy > p:last-child { max-width: 610px; margin: 14px 0 0; color: var(--display-muted); font-size: 14px; line-height: 1.75; }

.journey { width: min(100%, 620px); background: var(--journey-bg); color: var(--journey-text); border: 1px solid color-mix(in srgb, var(--journey-line) 80%, transparent); border-radius: 16px; box-shadow: 0 22px 70px rgba(6, 29, 22, .16); overflow: hidden; transform: rotate(-1deg); }
.journey-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 16px 22px 14px; border-bottom: 1px solid var(--journey-line); }
.journey-top > div { display: grid; gap: 6px; }
.journey-kicker { color: var(--journey-muted); font-size: 9px; }
.journey-top strong { font-size: 21px; line-height: 1.2; letter-spacing: -.045em; }
.journey-status { display: inline-flex; align-items: center; gap: 9px; flex: none; padding: 8px 10px; border-radius: 50px; background: #e4efda; color: #31593e; font-size: 8px; font-weight: 500; }
.journey-status i { width: 6px; height: 6px; background: #3b9663; box-shadow: none; }
.journey-route { position: relative; display: grid; gap: 0; padding: 8px 22px 10px; }
.route-progress { position: absolute; top: 31px; bottom: 33px; left: 36px; width: 2px; border-radius: 2px; background: linear-gradient(to bottom, #2f7d55 0 66%, var(--journey-line) 66% 100%); }
.route-step { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 13px; min-height: 46px; }
/* Đĩa ĐẶC cho chặng đã xong: nền trộn 16% màu trạng thái nhìn gần như giấy trắng
   nên nét kiểm không đọc được, và đĩa trống ở chặng cuối thì trông như thiếu icon.
   Ba trạng thái phải phân biệt được mà không cần đọc chữ: đã xong = jade đặc +
   dấu kiểm trắng; đang chạy = viền đậm + chấm giữa + quầng sáng; chưa tới = viền
   đứt + chấm mờ. */
.route-node {
  display: grid; place-items: center; z-index: 1; width: 30px; height: 30px; border-radius: 50%;
  color: var(--nc, var(--journey-muted)); background: var(--journey-bg);
  border: 1.5px solid var(--nc, var(--journey-muted));
}
.route-node svg { width: 15px; height: 15px; }
.route-copy { display: grid; gap: 1px; min-width: 0; }
.route-copy strong { font-size: 12px; font-weight: 700; }
.route-copy small { color: var(--journey-muted); font-size: 10px; }
.route-time { color: var(--journey-muted); font-family: "DM Mono", Consolas, monospace; font-size: 10px; }
.is-done .route-node { --nc: #2f7d55; background: var(--nc); border-color: var(--nc); color: #fff; }
.is-current .route-node { --nc: #2f7d55; border-width: 2px;
  box-shadow: 0 0 0 4px rgba(47, 125, 85, .16), 0 0 14px rgba(47, 125, 85, .35); }
.is-current .route-node i { display: block; width: 9px; height: 9px; border-radius: 50%; background: var(--nc); }
.is-current .route-copy strong { color: #2f7d55; }
.is-upcoming .route-node { --nc: #a4bcae; border-style: dashed; }
.is-upcoming .route-node::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #b3c6b8; }
/* Chưa tới ≠ mờ không đọc được: #7b9282 chỉ đạt 3,0:1 trên nền giấy. */
.is-upcoming .route-copy strong { color: var(--journey-muted); }
.journey-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 22px; border-top: 1px solid var(--journey-line); color: var(--journey-muted); font-size: 9px; }
.journey-bottom > span:first-child { display: flex; align-items: center; gap: 7px; }
.sync-symbol { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #e4efda; color: #356a4c; }
.sync-symbol svg { width: 11px; height: 11px; }
.journey-bottom b { margin-left: 4px; color: #39815a; font-weight: 500; }
.showcase-footer { padding-top: 22px; border-top: 1px solid var(--display-line); color: var(--display-muted); font-size: 9px; font-weight: 500; }
.showcase-footer b { margin-right: 5px; color: var(--signal); font-weight: 500; }

@media (max-width: 1000px) {
  .login-layout { grid-template-columns: minmax(0, 1fr); }
  .access, .showcase { min-height: auto; }
  .access { min-height: 100svh; }
  .access-main { width: min(100%, 550px); }
  .showcase { min-height: 780px; }
}

@media (max-width: 620px) {
  .access, .showcase { padding: 26px 24px; }
  .access-main { gap: 42px; margin: 60px auto 72px; }
  .access-intro h1 { font-size: clamp(52px, 13vw, 76px); }
  .access-description { font-size: 13px; }
  .access-footer { flex-wrap: wrap; line-height: 1.8; }
  .showcase { min-height: 720px; }
  .showcase-content { margin: 55px auto; gap: 36px; }
  .showcase-copy h2 { font-size: clamp(29px, 7vw, 39px); }
  .showcase-copy h2 br { display: none; }
  .showcase-copy > p:last-child { font-size: 13px; }
  .showcase-footer { flex-wrap: wrap; justify-content: flex-start; row-gap: 10px; }
  .journey { transform: none; }
}

@media (max-width: 400px) {
  .access, .showcase { padding-inline: 18px; }
  .brand-lock { height: 50px; }
  .access-intro h1 { font-size: 51px; }
  .journey-top, .journey-bottom { padding-inline: 16px; }
  .journey-route { padding-inline: 16px; }
  .route-progress { left: 30px; }
  .journey-status { font-size: 7px; padding: 7px 8px; }
  .journey-top strong { font-size: 19px; }
  .journey-bottom { font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}
