/* ===== Trang nhân viên: giao diện "PUBLIC WiFi ZONE" (theo hệ thống cũ) trên nền video ===== */
:root {
  --brand: #fd7508;         /* cam nút Join / chữ WiFi */
  --brand-dark: #d15e00;    /* cam đậm nút GUEST */
  --ink: #000000; --text: #1f1f1f; --muted: #808080; --line: #808080; --soft: #f4f4f4;
  --ok: #1a7f4b; --ok-bg: #e6f5ec; --err: #c62828; --err-bg: #fdecec; --warn: #9a5b00; --warn-bg: #fff4e0;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: #11151c; color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 16px; line-height: 1.5;
}
a { color: var(--brand); text-decoration: none; }
h1, h2 { margin: 0 0 .5em; line-height: 1.25; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--brand-dark); outline-offset: 2px; }

/* --- nền: video / ảnh / gradient cam --- */
.splash { position: relative; min-height: 100vh; min-height: 100dvh; overflow: hidden;
  background: linear-gradient(150deg, #ffb06b 0%, var(--brand) 45%, #8a3a00 100%); }
.splash.has-media { background: #11151c; }
.splash-bg, .splash-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.splash-shade { position: absolute; inset: 0; background: rgba(0, 0, 0, .28); }
.splash-inner {
  position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: max(20px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}

/* --- thẻ trắng --- */
.splash-card {
  width: 100%; max-width: 520px; background: #fff; border-radius: 6px;
  padding: 36px 40px 22px; box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
  animation: rise .4s ease-out both;
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@media (max-width: 480px) { .splash-card { padding: 28px 22px 18px; } }

/* --- tiêu đề PUBLIC / WiFi ZONE --- */
.pwz { text-align: center; margin: 0 0 30px; line-height: .95; user-select: none; }
.pwz .l1 { display: block; font-size: clamp(46px, 13vw, 72px); font-weight: 300; color: var(--ink); letter-spacing: .01em; }
.pwz .l2 { display: block; font-size: clamp(48px, 13.5vw, 76px); font-weight: 900; color: var(--ink); letter-spacing: -.01em; }
.pwz .l2 b { color: var(--brand); font-weight: 900; }
.pwz-sub { text-align: center; color: var(--muted); font-size: 15px; margin: -16px 0 24px; white-space: pre-line; }

/* --- ô nhập gạch chân có icon tròn --- */
.uline { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding: 8px 0; margin-bottom: 22px; }
.uline:focus-within { border-bottom-color: var(--brand); box-shadow: 0 1px 0 var(--brand); }
.uline.invalid { border-bottom-color: var(--err); box-shadow: 0 1px 0 var(--err); }
.uline .ico { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 2px solid #9a9a9a; background: #bdbdbd;
  display: grid; place-items: center; color: #fff; overflow: hidden; }
.uline .ico svg { width: 26px; height: 26px; }
.uline input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 22px; color: var(--ink); padding: 4px 0; }
.uline input::placeholder { color: #6f6f6f; }
.reveal { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px; display: flex; border-radius: 4px; }
.reveal svg { width: 22px; height: 22px; }
.reveal.on { color: var(--brand); }

.row-links { display: flex; justify-content: center; margin: -6px 0 14px; }
.link-orange, button.link-orange { all: unset; color: var(--brand); font-size: 18px; cursor: pointer; }
.link-orange:hover, .link-orange:focus-visible { text-decoration: underline; }
.row-links + .btn { margin-top: 6px; }
.row-links { gap: 10px; align-items: center; flex-wrap: wrap; }
.row-links .sep { color: #b5b5b5; }

/* --- popup lỗi "OPPS!" (kiểu hệ thống cũ) --- */
.oops-dialog { position: fixed; width: min(400px, calc(100vw - 32px)); padding: 26px 30px 30px; border: 0; border-radius: 22px;
  background: #fff; color: #111; text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.oops-dialog::backdrop { background: rgba(0, 0, 0, .72); }
.oops-title { font-family: Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Black", sans-serif; font-size: 68px; line-height: 1;
  letter-spacing: 3px; transform: rotate(-3deg); margin: 4px 0 10px; }
.oops-dialog p { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.4; }
.oops-x { position: absolute; top: 12px; right: 14px; width: 36px; height: 36px; border: 0; background: none; cursor: pointer;
  font-size: 22px; font-weight: 700; color: #8a8a8a; border-radius: 50%; }
.oops-x:hover { background: #f2f2f2; color: #333; }

/* --- hộp thoại tự đăng ký --- */
.reg-dialog { width: min(480px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
.reg-dialog form { display: flex; flex-direction: column; min-height: 0; max-height: inherit; }
.reg-body { padding: 4px 20px 6px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.reg-body .alert { margin: 0; }
.reg-field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; color: #444; }
.reg-field small { font-weight: 400; color: var(--muted); }
.reg-field input { height: 42px; padding: 0 12px; border: 1px solid #c9c9c9; border-radius: 4px; font: inherit; font-size: 16px;
  font-weight: 400; color: var(--ink); background: #fff; }
.reg-field input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(253, 117, 8, .18); }
.reg-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .reg-two { grid-template-columns: 1fr; } }
.reg-note { margin: 0; font-size: 13px; color: var(--muted); }
button.link { all: unset; color: var(--brand); font-weight: 600; cursor: pointer; }
button.link:hover, button.link:focus-visible { text-decoration: underline; }

/* --- nút vuông kiểu cũ --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  height: 45px; padding: 0 16px; border: 0; border-radius: 0; font: inherit; font-size: 16px;
  background: var(--brand); color: #fff; text-decoration: none !important; white-space: nowrap;
}
.btn:hover { filter: brightness(1.06); }
.btn.block { width: 100%; }
.btn.guest { background: var(--brand-dark); margin-top: 10px; }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid #c9c9c9; }
.btn:disabled { opacity: .65; cursor: default; }
.btn-lg { height: 48px; font-size: 17px; }
.guest-note { text-align: center; font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.spinner { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- minh hoạ + chân thẻ --- */
.illus { display: block; width: 100%; max-width: 300px; height: auto; margin: 22px auto 0; }
.illus-img { max-width: 100%; }
.card-foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 14px; }
.splash-foot { margin-top: 16px; text-align: center; font-size: 13px; color: rgba(255, 255, 255, .9); text-shadow: 0 1px 2px rgba(0, 0, 0, .5); max-width: 520px; }
.preview-flag { margin-bottom: 12px; padding: 6px 12px; border-radius: 99px; font-size: 12px; font-weight: 600; background: rgba(255, 255, 255, .92); color: #6b4b00; }

.alert { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; margin-bottom: 18px; font-size: 14px; border-left: 4px solid; }
.alert svg { flex: none; margin-top: 2px; }
.alert.error { background: var(--err-bg); color: var(--err); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }

/* --- hộp thoại --- */
.terms-dialog { width: min(560px, calc(100vw - 32px)); max-height: min(80vh, 640px); padding: 0; border: 0; border-radius: 6px; background: #fff; color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .4); }
.terms-dialog[open] { display: flex; flex-direction: column; }
.terms-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.terms-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 10px; }
.terms-head h2 { font-size: 18px; margin: 0; }
.icon-btn { border: 0; background: transparent; color: var(--muted); font-size: 16px; cursor: pointer; width: 32px; height: 32px; border-radius: 4px; }
.icon-btn:hover { background: var(--soft); }
.terms-body { padding: 4px 20px 16px; overflow-y: auto; white-space: pre-line; font-size: 15px; line-height: 1.65; }
.terms-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid #e6e6e6; }
.terms-foot .btn { height: 40px; }

/* --- đăng nhập thành công / trạng thái --- */
.success { text-align: center; margin-bottom: 18px; }
.success h1 { font-size: 24px; margin: 14px 0 4px; color: var(--ink); }
.success p { margin: 0; }
.ring-wrap { position: relative; width: 104px; height: 104px; margin: 0 auto; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; }
.ring-track { stroke: #eee; }
.ring-bar { stroke: var(--brand); stroke-linecap: round; transition: stroke-dashoffset 1s linear, stroke .3s; }
.ring-bar.warn { stroke: var(--err); }
.ring-center { position: absolute; inset: 0; display: grid; place-items: center; color: var(--brand); }
.ring-center .count { font-size: 38px; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.check { width: 40px; height: 40px; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .5s .25s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.usage-note { background: var(--soft); padding: 14px 16px; margin-bottom: 16px; font-size: 14px; border-left: 4px solid var(--brand); }
.usage-note .big { display: block; font-size: 26px; font-weight: 700; margin: 2px 0; color: var(--ink); }
.usage-note ul { margin: 8px 0 0; padding-left: 18px; color: #555; }
.redirect-line { text-align: center; color: var(--muted); font-size: 14px; margin: 12px 0 0; }
.redirect-line b { color: var(--brand); font-size: 16px; }
.timer-box { text-align: center; background: var(--soft); padding: 14px; margin-bottom: 16px; }
.timer { font-size: 34px; font-weight: 700; letter-spacing: 1px; font-variant-numeric: tabular-nums; margin: 2px 0; color: var(--ink); }
.timer-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.timer-note { font-size: 13px; color: var(--muted); }
.timer-box.warn { background: var(--warn-bg); }
.timer-box.warn .timer, .timer-box.warn .timer-note { color: var(--err); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; margin: 0 0 20px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; word-break: break-all; }
.badge-guest { display: inline-block; padding: 2px 10px; font-size: 12px; font-weight: 700; color: #fff; background: var(--brand-dark); letter-spacing: .05em; }

/* --- gọn trong 1 màn hình ---
   Màn hình ngang (PC, laptop, tablet ngang): ảnh minh hoạ bên trái, tiêu đề + form bên phải. */
@media (min-width: 900px) and (orientation: landscape) {
  .splash-card.with-illus {
    max-width: 980px; display: grid; grid-template-columns: minmax(0, 1fr) 430px;
    column-gap: 44px; align-items: center; align-content: center; padding: 28px 40px 18px;
  }
  .splash-card.with-illus > * { grid-column: 2; }
  .splash-card.with-illus > .illus { grid-column: 1; grid-row: 1 / span 8; align-self: center; margin: 0; width: 100%; max-width: none; }
  .splash-card.with-illus .card-foot { grid-column: 1 / -1; }
  .with-illus .pwz { margin-bottom: 22px; }
  .with-illus .pwz .l1 { font-size: 58px; }
  .with-illus .pwz .l2 { font-size: 62px; }
}
/* Màn hình thấp (laptop 768px, trình duyệt có thanh công cụ): thu khoảng cách */
@media (min-width: 900px) and (max-height: 760px) {
  .splash-inner { padding-top: 12px; padding-bottom: 10px; }
  .splash-card.with-illus { padding-top: 20px; padding-bottom: 12px; }
  .with-illus .pwz { margin-bottom: 14px; }
  .with-illus .pwz .l1 { font-size: 48px; }
  .with-illus .pwz .l2 { font-size: 52px; }
  .with-illus .pwz-sub { margin: -6px 0 14px; }
  .with-illus .uline { margin-bottom: 14px; padding: 5px 0; }
  .with-illus .uline .ico { width: 36px; height: 36px; }
  .with-illus .uline input { font-size: 19px; }
  .with-illus .row-links { margin: -2px 0 8px; }
  .with-illus .btn { height: 42px; }
  .with-illus .guest-note { margin-top: 6px; }
  .splash-foot { margin-top: 10px; }
}
/* Điện thoại / màn hình dọc: ảnh nhỏ lại để form vừa màn hình */
@media (orientation: portrait), (max-width: 899px) {
  .illus-img { max-height: 17vh; width: auto; max-width: 100%; }
  .illus { margin-top: 12px; }
}
@media (max-width: 480px) {
  .splash-inner { padding-top: max(10px, env(safe-area-inset-top)); }
  .splash-card { padding-top: 22px; }
  .pwz { margin-bottom: 18px; }
  .pwz-sub { margin: -8px 0 16px; font-size: 14px; }
  .uline { margin-bottom: 16px; }
  .card-foot { margin-top: 8px; }
  .splash-foot { margin-top: 10px; }
}
/* Điện thoại màn hình thấp (popup đăng nhập WiFi của iPhone, máy nhỏ): bỏ ảnh minh hoạ cho đủ chỗ form */
@media (max-width: 899px) and (max-height: 700px) {
  .illus { display: none; }
  .pwz .l1 { font-size: 44px; }
  .pwz .l2 { font-size: 48px; }
}

/* --- popup đăng nhập thành công (kiểu hệ thống cũ) --- */
.ok-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .72);
  display: flex; align-items: center; justify-content: center; padding: 56px 16px 24px; animation: fade .25s ease-out both; }
.ok-card { position: relative; width: 100%; max-width: 380px; background: #fff; border-radius: 22px;
  padding: 74px 28px 28px; text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); animation: pop .35s .05s ease-out both; }
.ok-badge { position: absolute; top: -42px; left: 50%; transform: translateX(-50%); width: 84px; height: 84px; border-radius: 50%;
  background: var(--brand); border: 4px solid #fff; color: #fff; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
.ok-badge svg { width: 46px; height: 46px; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .45s .35s ease-out forwards; }
.ok-card h2 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: .02em; color: #1f1f1f; }
.ok-count { font-size: 48px; font-weight: 300; line-height: 1.2; margin: 6px 0 2px; color: #1f1f1f; font-variant-numeric: tabular-nums; }
.ok-welcome { margin: 10px 0 16px; font-size: 22px; font-weight: 800; color: #1f1f1f; }
.ok-usage { display: flex; flex-direction: column; gap: 2px; background: #fff3ea; border-radius: 12px; padding: 12px 14px; margin-bottom: 22px; }
.ok-usage .ok-label { font-size: 13px; color: #8a5a35; }
.ok-usage b { font-size: 24px; color: var(--brand-dark); line-height: 1.25; }
.ok-usage .ok-sub { font-size: 13px; color: #6b6b6b; }
.ok-btn { display: flex; align-items: center; justify-content: center; height: 48px; border-radius: 99px;
  background: var(--brand); color: #fff !important; font-size: 18px; text-decoration: none !important; }
.ok-btn:hover { filter: brightness(1.06); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.92); } }

@media (prefers-reduced-motion: reduce) { .splash-card, .check, .ok-overlay, .ok-card, .ok-badge svg { animation: none !important; } .ok-badge svg { stroke-dashoffset: 0; } .splash-video { display: none; } }
