/* =====================================================================
   AUTH FLOW — trang ĐĂNG NHẬP (/login) + ĐĂNG KÝ (/dang-ky) kiểu web bán SaaS hiện đại
   (chủ tool 2026-11-16: "flow đăng nhập đăng ký làm lại cho đẹp … có animation càng tốt").

   Bố cục: trái = khối giới thiệu động (nền aurora, thẻ kính nổi, điện thoại chạy phụ đề karaoke)
           phải = thẻ form kính. ≤960px: khối giới thiệu thu thành dải đầu trang gọn.
   Sáng/Tối: html[data-theme="dark"] (cookie `theme`, cùng nút với App). Không viết màu cứng ngoài bảng
   biến dưới đây. Animation CHỈ dùng transform/opacity (60fps); prefers-reduced-motion ⇒ tắt hết.
   Không thư viện, không CDN (CSP 'self'). Font: /shared-static/css/fonts.css.
   Dùng chung bởi: modules/auth/.../login.html, modules/accounts/.../dang_ky.html
   (khung đầu trang + khối giới thiệu: modules/auth/presentation/templates/_auth_flow.html).
   ===================================================================== */
:root {
  --af-bg: #f4f6fb;
  --af-card: rgba(255, 255, 255, .86);
  --af-card-solid: #fff;
  --af-line: #e6e9f2;
  --af-line2: #d7dce7;
  --af-text: #171a23;
  --af-body: #3b4150;
  --af-muted: #525866;
  --af-faint: #5f6573;
  --af-input: #f8f9fc;
  --af-a1: #2459d1;
  --af-a2: #7c5cff;
  --af-a3: #22d3ee;
  --af-grad: linear-gradient(135deg, #2459d1 0%, #3366e0 45%, #6a4fe0 100%);
  --af-ok: #16a34a;
  --af-err: #e11d48;
  --af-err-bg: #fff1f3;
  --af-warn: #8a5a00;
  --af-warn-bg: #fff7e0;
  --af-soft: #eef3ff;
  --af-ring: rgba(47, 107, 255, .18);
  --af-shadow: 0 30px 80px -30px rgba(30, 40, 90, .28);
  --af-blob1: rgba(47, 107, 255, .20);
  --af-blob2: rgba(124, 92, 255, .16);
  --af-blob3: rgba(34, 211, 238, .14);
  --af-gut: clamp(16px, 4vw, 32px);
  color-scheme: light;
}
html[data-theme="dark"] {
  --af-bg: #0a0c12;
  --af-card: rgba(22, 25, 34, .84);
  --af-card-solid: #161922;
  --af-line: #262a36;
  --af-line2: #313646;
  --af-text: #eef1f7;
  --af-body: #c4c9d4;
  --af-a1: #7ea6ff;
  --af-muted: #9aa1b0;
  --af-faint: #8a91a0;
  --af-input: #10131a;
  --af-ok: #22c55e;
  --af-err: #fb7185;
  --af-err-bg: rgba(225, 29, 72, .12);
  --af-warn: #fbbf24;
  --af-warn-bg: rgba(245, 158, 11, .12);
  --af-soft: rgba(79, 139, 255, .14);
  --af-ring: rgba(79, 139, 255, .30);
  --af-shadow: 0 30px 80px -30px rgba(0, 0, 0, .7);
  --af-blob1: rgba(47, 107, 255, .22);
  --af-blob2: rgba(124, 92, 255, .18);
  --af-blob3: rgba(34, 211, 238, .10);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html body.af {
  margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--af-bg); color: var(--af-body);
  font: 400 15px/1.6 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
.af a { color: var(--af-a1); text-decoration: none; }
html[data-theme="dark"] .af a { color: #7ea6ff; }
.af h1, .af h2, .af h3 { color: var(--af-text); margin: 0; line-height: 1.2; letter-spacing: -.015em; }
.af .ic { width: 1.15em; height: 1.15em; vertical-align: -.18em; flex: none; display: inline-block; }
.af-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- nền aurora cả trang (các đốm mờ trôi chậm) ---------- */
.af-aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.af-aurora i {
  position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; will-change: transform;
  background: radial-gradient(circle at center, var(--af-blob1), transparent 62%);
}
.af-aurora i:nth-child(1) { left: -20vmax; top: -25vmax; animation: af-drift1 26s ease-in-out infinite alternate; }
.af-aurora i:nth-child(2) { right: -25vmax; bottom: -30vmax; background: radial-gradient(circle, var(--af-blob2), transparent 62%); animation: af-drift2 32s ease-in-out infinite alternate; }
.af-aurora i:nth-child(3) { left: 30vw; top: 40vh; width: 40vmax; height: 40vmax; background: radial-gradient(circle, var(--af-blob3), transparent 62%); animation: af-drift3 22s ease-in-out infinite alternate; }
@keyframes af-drift1 { to { transform: translate3d(12vw, 10vh, 0) scale(1.15); } }
@keyframes af-drift2 { to { transform: translate3d(-10vw, -8vh, 0) scale(1.1); } }
@keyframes af-drift3 { to { transform: translate3d(-14vw, -12vh, 0) scale(.85); } }

/* ---------- thanh trên ---------- */
.af-top {
  position: relative; z-index: 3; display: flex; align-items: center; gap: 12px;
  max-width: 1280px; margin: 0 auto; padding: 16px var(--af-gut);
}
.af-logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; color: var(--af-text) !important; white-space: nowrap; min-width: 0; }
.af-logo-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #fff; background: var(--af-grad);
  box-shadow: 0 10px 24px -10px rgba(47, 107, 255, .8); flex: none; }
.af-logo-ico .ic { width: 20px; height: 20px; }
/* 🎨 logo chung 3 trang (ảnh SVG đã có nền dải màu + bo góc) ⇒ bỏ nền / bóng của ô cũ */
.af-logo-ico.af-logo-img { background: none; box-shadow: 0 10px 24px -12px rgba(70, 100, 245, .75); border-radius: 10px; }
.af-logo-img img { display: block; width: 100%; height: 100%; }
.af-logo-t { overflow: hidden; text-overflow: ellipsis; }

/* tab Đăng nhập ⇄ Đăng ký: viên kính, gạch chân chạy theo tab đang chọn */
.af-tabs {
  position: relative; display: inline-flex; margin: 0 auto; padding: 4px; border-radius: 999px;
  background: var(--af-card); border: 1px solid var(--af-line); box-shadow: 0 6px 20px -12px rgba(30, 40, 90, .35);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.af-tab {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 18px;
  border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--af-muted) !important; white-space: nowrap; transition: color .2s;
}
.af-tab:hover { color: var(--af-text) !important; }
.af-tab.on { color: var(--af-a1) !important; }
html[data-theme="dark"] .af-tab.on { color: #8fb3ff !important; }
.af-tab::after {
  content: ""; position: absolute; left: 18px; right: 18px; bottom: 5px; height: 2.5px; border-radius: 3px;
  background: var(--af-grad); transform: scaleX(0); transform-origin: left; transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
.af-tab:hover::after { transform: scaleX(.35); }
.af-tab.on::after { transform: scaleX(1); animation: af-underline .6s cubic-bezier(.2, .8, .2, 1); }
@keyframes af-underline { from { transform: scaleX(0); } }

.af-prefs { display: flex; gap: 8px; flex: none; }
.af-pref {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; min-width: 40px; padding: 0 12px;
  border-radius: 12px; border: 1px solid var(--af-line); background: var(--af-card); color: var(--af-muted) !important;
  font: 700 13px/1 sans-serif; font-family: inherit; cursor: pointer; transition: color .15s, border-color .15s, transform .15s;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.af-pref:hover { color: var(--af-a1) !important; border-color: var(--af-a1); }
.af-pref:active { transform: scale(.96); }
.af-pref .ic { width: 18px; height: 18px; }
html[data-theme="dark"] .af-pref .ic-moon, html:not([data-theme="dark"]) .af-pref .ic-sun { display: none; }

/* ---------- bố cục 2 cột ---------- */
.af-main {
  position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 520px);
  gap: clamp(20px, 3.5vw, 48px); max-width: 1280px; margin: 0 auto; padding: clamp(8px, 2vw, 24px) var(--af-gut) 48px; align-items: stretch;
}
.af-main.narrow { grid-template-columns: minmax(0, 1fr) minmax(0, 460px); }

/* ---------- KHỐI GIỚI THIỆU ĐỘNG ---------- */
.af-show {
  position: relative; overflow: hidden; isolation: isolate; border-radius: 28px; min-height: 620px;
  padding: clamp(24px, 3.4vw, 44px); color: #fff; display: flex; flex-direction: column;
  background: linear-gradient(150deg, #0b1638 0%, #142a6b 48%, #2a2a8f 100%);
  box-shadow: 0 40px 90px -40px rgba(20, 40, 120, .7);
}
.af-mesh { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.af-mesh i { position: absolute; border-radius: 50%; will-change: transform; }
.af-mesh i:nth-child(1) { width: 520px; height: 520px; left: -160px; top: -200px; background: radial-gradient(circle, rgba(79, 139, 255, .55), transparent 65%); animation: af-m1 18s ease-in-out infinite alternate; }
.af-mesh i:nth-child(2) { width: 460px; height: 460px; right: -180px; top: 30%; background: radial-gradient(circle, rgba(124, 92, 255, .55), transparent 65%); animation: af-m2 22s ease-in-out infinite alternate; }
.af-mesh i:nth-child(3) { width: 420px; height: 420px; left: 20%; bottom: -220px; background: radial-gradient(circle, rgba(34, 211, 238, .38), transparent 65%); animation: af-m3 20s ease-in-out infinite alternate; }
.af-mesh::after { /* lưới chấm mờ cho cảm giác "sản phẩm" */
  content: ""; position: absolute; inset: 0; opacity: .18;
  background-image: radial-gradient(rgba(255, 255, 255, .5) 1px, transparent 1px); background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 75%); mask-image: linear-gradient(180deg, #000, transparent 75%);
}
@keyframes af-m1 { to { transform: translate3d(120px, 80px, 0) scale(1.12); } }
@keyframes af-m2 { to { transform: translate3d(-100px, -60px, 0) scale(.9); } }
@keyframes af-m3 { to { transform: translate3d(80px, -90px, 0) scale(1.15); } }

.af-pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); font-weight: 700; font-size: 13px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.af-pill .ic { color: #5fd4ff; }
.af-show h2 { color: #fff; margin: 18px 0 10px; font-size: clamp(1.6rem, 1rem + 2vw, 2.55rem); font-weight: 800; line-height: 1.12; max-width: 15ch; }
.af-grad-t { background: linear-gradient(90deg, #5fd4ff, #a5b4ff 50%, #f0abfc); -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 200% 100%; animation: af-shine 6s linear infinite; }
@keyframes af-shine { to { background-position: -200% 0; } }
.af-show-p { margin: 0; max-width: 44ch; color: rgba(255, 255, 255, .78); font-size: 15px; }

/* sân khấu: điện thoại + thẻ kính nổi */
.af-stage { position: relative; flex: 1; min-height: 330px; margin: 22px 0 18px; display: grid; place-items: center; }
.af-phone {
  position: relative; width: 186px; aspect-ratio: 9 / 18.5; border-radius: 30px; padding: 8px;
  background: linear-gradient(160deg, #1b2347, #0c1029); border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 40px 70px -30px rgba(0, 0, 0, .8), inset 0 0 0 1px rgba(255, 255, 255, .05);
  animation: af-float 7s ease-in-out infinite;
}
.af-phone::before { content: ""; position: absolute; top: 14px; left: 50%; width: 52px; height: 6px; margin-left: -26px; border-radius: 6px; background: rgba(0, 0, 0, .55); z-index: 2; }
.af-screen { position: relative; height: 100%; border-radius: 23px; overflow: hidden; background: #0d1530; }
.af-scene { position: absolute; inset: -12%; will-change: transform; animation: af-kenburns 9s ease-in-out infinite alternate;
  background:
    radial-gradient(60% 45% at 30% 30%, rgba(255, 196, 120, .85), transparent 70%),
    radial-gradient(70% 50% at 75% 70%, rgba(124, 92, 255, .9), transparent 70%),
    linear-gradient(180deg, #1d3a8a, #0d1530 70%); }
.af-scene::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 55%; background: linear-gradient(180deg, transparent, rgba(5, 8, 20, .85)); }
@keyframes af-kenburns { from { transform: scale(1) translate3d(0, 0, 0); } to { transform: scale(1.12) translate3d(-4%, -3%, 0); } }
.af-screen-top { position: absolute; top: 26px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; font-size: 10px; font-weight: 800; color: #fff; z-index: 1; }
.af-rec { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border-radius: 999px; background: rgba(0, 0, 0, .35); }
.af-rec::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #ff4d6d; animation: af-blink 1.2s ease-in-out infinite; }
@keyframes af-blink { 50% { opacity: .25; } }
/* phụ đề karaoke: từng chữ sáng lên lần lượt (delay đặt inline theo thứ tự chữ) */
.af-karaoke { position: absolute; left: 12px; right: 12px; bottom: 34px; z-index: 1; text-align: center; font-weight: 800; font-size: 12.5px; line-height: 1.45; color: rgba(255, 255, 255, .55); }
.af-karaoke span { display: inline-block; margin: 0 1.5px; animation: af-word var(--af-kara, 6s) linear infinite; animation-delay: calc(var(--i) * .42s); }
@keyframes af-word {
  0% { color: rgba(255, 255, 255, .55); transform: none; }
  3% { color: #ffd84d; transform: translateY(-2px) scale(1.06); }
  9% { color: #fff; transform: none; }
  100% { color: #fff; }
}
.af-pbar { position: absolute; left: 12px; right: 12px; bottom: 16px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .22); overflow: hidden; z-index: 1; }
.af-pbar i { position: absolute; inset: 0; background: linear-gradient(90deg, #5fd4ff, #7c5cff); transform-origin: left; animation: af-progress var(--af-kara, 6s) linear infinite; }
@keyframes af-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.af-glass {
  position: absolute; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 16px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); color: #fff; font-size: 13px; font-weight: 700;
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .6); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); white-space: nowrap;
}
.af-glass small { display: block; font-weight: 600; font-size: 11.5px; color: rgba(255, 255, 255, .7); }
.af-glass-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--af-grad); }
.af-glass-ico.ok { background: linear-gradient(135deg, #16a34a, #22d3ee); }
.af-glass-ico .ic { width: 18px; height: 18px; }
.af-glass.g1 { left: 2%; top: 10%; animation: af-float 6s ease-in-out infinite; }
.af-glass.g2 { right: 0; bottom: 14%; animation: af-float 7.5s ease-in-out -2s infinite; }
.af-glass.g3 { right: 4%; top: 6%; padding: 9px 12px; animation: af-float 8s ease-in-out -4s infinite; }
.af-mini { width: 110px; height: 5px; margin-top: 6px; border-radius: 5px; background: rgba(255, 255, 255, .2); overflow: hidden; position: relative; }
.af-mini i { position: absolute; inset: 0; background: linear-gradient(90deg, #5fd4ff, #a5b4ff); transform-origin: left; animation: af-mini 3.6s cubic-bezier(.5, 0, .3, 1) infinite; }
@keyframes af-mini { 0% { transform: scaleX(.05); } 80%, 100% { transform: scaleX(1); } }
@keyframes af-float { 50% { transform: translate3d(0, -10px, 0); } }

/* chip nền tảng trôi nổi */
.af-chips { position: absolute; inset: 0; pointer-events: none; }
.af-chip {
  position: absolute; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 800; color: #fff; background: rgba(10, 14, 35, .55); border: 1px solid rgba(255, 255, 255, .18);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: af-float 6.5s ease-in-out infinite;
}
.af-chip b { width: 8px; height: 8px; border-radius: 50%; background: #25f4ee; box-shadow: 3px 0 0 #fe2c55; }
.af-chip.yt b { background: #ff0033; box-shadow: none; }
.af-chip.ig b { background: linear-gradient(135deg, #f9ce34, #ee2a7b, #6228d7); box-shadow: none; }
.af-chip.c1 { left: 6%; bottom: 18%; animation-delay: -1s; }
.af-chip.c2 { left: 22%; top: 2%; animation-delay: -3s; }
.af-chip.c3 { right: 8%; top: 42%; animation-delay: -5s; }

.af-benefits { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.af-benefits li { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14.5px; color: rgba(255, 255, 255, .92);
  opacity: 0; animation: af-rise .6s cubic-bezier(.2, .8, .2, 1) forwards; animation-delay: calc(.25s + var(--i) * .12s); }
.af-benefits li > b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; background: rgba(255, 255, 255, .16); color: #5fd4ff; }
.af-benefits li > b .ic { width: 14px; height: 14px; }
.af-trust { margin: 18px 0 0; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: rgba(255, 255, 255, .62); }
.af-trust .ic { color: #5fd4ff; }
@keyframes af-rise { from { opacity: 0; transform: translate3d(0, 12px, 0); } to { opacity: 1; transform: none; } }

/* ---------- THẺ FORM ---------- */
.af-card {
  position: relative; align-self: center; width: 100%; border-radius: 26px; padding: clamp(22px, 3.6vw, 40px);
  background: var(--af-card); border: 1px solid var(--af-line); box-shadow: var(--af-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
  animation: af-card-in .7s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes af-card-in { from { opacity: 0; transform: translate3d(0, 18px, 0) scale(.985); } }
.af-card.shake { animation: af-shake .42s; }
@keyframes af-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.af-card h1 { font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2rem); font-weight: 800; }
.af-sub { margin: 6px 0 22px; color: var(--af-muted); font-size: 14.5px; }
.af-card-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 16px; color: #fff;
  background: var(--af-grad); box-shadow: 0 14px 30px -14px rgba(47, 107, 255, .9); }
.af-card-ico .ic { width: 26px; height: 26px; }

.af-alert { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; padding: 11px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5;
  border: 1px solid transparent; color: var(--af-text); animation: af-rise .35s ease both; }
.af-alert .ic { margin-top: 2px; }
.af-alert.err { background: var(--af-err-bg); border-color: color-mix(in srgb, var(--af-err) 30%, transparent); }
.af-alert.err .ic { color: var(--af-err); }
.af-alert.warn { background: var(--af-warn-bg); border-color: color-mix(in srgb, var(--af-warn) 30%, transparent); }
.af-alert.warn .ic { color: var(--af-warn); }

/* ô nhập NHÃN NỔI: nhãn nằm trong ô, gõ/đặt con trỏ thì bay lên viền trên */
.af-field { position: relative; margin-bottom: 16px; }
.af-input, .af-select {
  display: block; width: 100%; height: 56px; padding: 22px 16px 6px 46px; border-radius: 14px;
  border: 1.5px solid var(--af-line2); background: var(--af-input); color: var(--af-text);
  font: 600 15.5px/1.2 sans-serif; font-family: inherit; outline: none; appearance: none; -webkit-appearance: none;
  transition: border-color .2s, box-shadow .25s, background-color .2s;
}
.af-input::placeholder { color: transparent; transition: color .2s; }
.af-input:focus::placeholder { color: var(--af-faint); }
.af-field > label {
  position: absolute; left: 46px; top: 18px; max-width: calc(100% - 60px); pointer-events: none; transform-origin: left top;
  color: var(--af-muted); font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), color .2s;
}
.af-input:focus + label, .af-input:not(:placeholder-shown) + label, .af-field.fixed > label { transform: translate3d(0, -10px, 0) scale(.78); color: var(--af-a1); }
.af-input:not(:focus):not(:placeholder-shown) + label, .af-field.fixed > .af-select:not(:focus) + label { color: var(--af-muted); }
/* 🔑 TRÌNH DUYỆT TỰ ĐIỀN (2026-11-18 "chọn cả text và placeholder chồng nhau"): lúc Chrome XEM TRƯỚC gợi ý / vừa điền,
   giá trị còn rỗng với CSS (:placeholder-shown vẫn đúng) ⇒ nhãn không bay lên, đè lên chữ ⇒ :autofill cũng đẩy nhãn lên.
   Viết TÁCH từng luật: trình duyệt không biết 1 bộ chọn là bỏ CẢ nhóm. Nền vàng/xanh mặc định ⇒ giữ màu ô theo giao diện. */
.af-input:-webkit-autofill + label { transform: translate3d(0, -10px, 0) scale(.78); color: var(--af-muted); }
.af-input:autofill + label { transform: translate3d(0, -10px, 0) scale(.78); color: var(--af-muted); }
.af-input:-webkit-autofill:focus + label { color: var(--af-a1); }
.af-input:-webkit-autofill {
  -webkit-text-fill-color: var(--af-text); caret-color: var(--af-text);
  box-shadow: inset 0 0 0 1000px var(--af-input); transition: background-color 600000s 0s, color 600000s 0s;
}
.af-input:-webkit-autofill:focus { box-shadow: inset 0 0 0 1000px var(--af-card-solid), 0 0 0 4px var(--af-ring); }
.af-input:focus, .af-select:focus { border-color: var(--af-a1); background-color: var(--af-card-solid); box-shadow: 0 0 0 4px var(--af-ring), 0 8px 24px -12px rgba(47, 107, 255, .5); }
.af-field > .af-ico { position: absolute; left: 15px; top: 18px; color: var(--af-faint); line-height: 0; pointer-events: none; transition: color .2s, transform .2s; }
.af-field > .af-ico .ic { width: 20px; height: 20px; }
.af-field:focus-within > .af-ico { color: var(--af-a1); transform: scale(1.08); }
.af-input.bad { border-color: var(--af-err); box-shadow: 0 0 0 4px color-mix(in srgb, var(--af-err) 15%, transparent); }
.af-input.bad + label { color: var(--af-err); }
.af-select { padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%238A8D94' stroke-width='2'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; }
.af-select option { color: initial; }
/* 🎛️ danh sách chọn tự vẽ cho select.af-select (auth-flow.js) — thay popup gốc của trình duyệt (2026-11-17) */
.af-cd-pop { position: fixed; z-index: 1000; overflow-y: auto; padding: 6px; border-radius: 14px; box-sizing: border-box;
  background: var(--af-card-solid); border: 1.5px solid var(--af-line2); box-shadow: var(--af-shadow); overscroll-behavior: contain; scrollbar-width: thin; }
.af-cd-it { padding: 12px 14px; border-radius: 10px; font-size: 15px; font-weight: 600; color: var(--af-text); cursor: pointer; line-height: 1.35; overflow-wrap: anywhere; }
.af-cd-it.on { background: var(--af-soft); }
.af-cd-it.chon { color: var(--af-a1); }
.af-cd-it.tat { opacity: .45; cursor: not-allowed; }
.af-hint { display: block; margin: -10px 0 14px 4px; color: var(--af-muted); font-size: 12.5px; }
.af-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.af-row > div { min-width: 0; }

/* nút hiện/ẩn mật khẩu: bật thì vẽ gạch chéo qua mắt */
.af-eye {
  position: absolute; right: 8px; top: 8px; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 11px;
  background: transparent; color: var(--af-muted); cursor: pointer; transition: background .15s, color .15s;
}
.af-eye:hover { background: var(--af-soft); color: var(--af-a1); }
.af-eye .ic { width: 20px; height: 20px; }
.af-eye::after { content: ""; position: absolute; width: 22px; height: 2px; border-radius: 2px; background: currentColor; transform: rotate(-45deg) scaleX(0); transition: transform .2s; }
.af-eye.on::after { transform: rotate(-45deg) scaleX(1); }
.af-field.has-eye .af-input { padding-right: 52px; }

/* thanh độ mạnh mật khẩu (4 vạch) */
.af-strength { display: flex; align-items: center; gap: 8px; margin: -8px 0 14px 4px; font-size: 12px; font-weight: 700; color: var(--af-muted); }
.af-strength-bars { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.af-strength-bars i { height: 5px; border-radius: 5px; background: var(--af-line); position: relative; overflow: hidden; }
.af-strength-bars i::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--af-sc, var(--af-err)); transform: scaleX(0); transform-origin: left; transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.af-strength[data-lv="1"] { --af-sc: #ef4444; } .af-strength[data-lv="2"] { --af-sc: #f59e0b; }
.af-strength[data-lv="3"] { --af-sc: #22c55e; } .af-strength[data-lv="4"] { --af-sc: #10b981; }
.af-strength[data-lv="1"] i:nth-child(-n+1)::after, .af-strength[data-lv="2"] i:nth-child(-n+2)::after,
.af-strength[data-lv="3"] i:nth-child(-n+3)::after, .af-strength[data-lv="4"] i::after { transform: scaleX(1); }
.af-strength b { min-width: 52px; text-align: right; color: var(--af-sc, var(--af-muted)); }

.af-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -4px 0 18px; font-size: 13.5px; }
.af-link { border: 0; background: none; padding: 6px 2px; color: var(--af-a1); font: 700 14px sans-serif; font-family: inherit; cursor: pointer; }
html[data-theme="dark"] .af-link { color: #8fb3ff; }
.af-link:hover:not(:disabled) { text-decoration: underline; }
.af-link:disabled { color: var(--af-faint); cursor: default; }

/* NÚT CHÍNH: gradient + vệt sáng chạy + vòng xoay khi đang gửi */
.af-btn {
  position: relative; overflow: hidden; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 54px; padding: 0 22px; border: 0; border-radius: 15px; color: #fff; cursor: pointer;
  background: var(--af-grad); background-size: 140% 100%; font: 800 15.5px/1 sans-serif; font-family: inherit; letter-spacing: .2px;
  box-shadow: 0 16px 32px -14px rgba(47, 107, 255, .85); transition: transform .15s, box-shadow .25s, opacity .2s, background-position .4s;
}
.af-btn::before { content: ""; position: absolute; inset: 0; z-index: -1; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .38), transparent); transform: translateX(-160%) skewX(-18deg); animation: af-shimmer 3.4s ease-in-out infinite; }
@keyframes af-shimmer { 0%, 55% { transform: translateX(-160%) skewX(-18deg); } 100% { transform: translateX(360%) skewX(-18deg); } }
.af-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 20px 38px -14px rgba(47, 107, 255, .95); background-position: 100% 0; }
.af-btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.af-btn:disabled { opacity: .62; cursor: not-allowed; box-shadow: none; }
.af-btn:disabled::before { animation: none; opacity: 0; }
.af-btn .ic { width: 19px; height: 19px; }
.af-btn .af-arrow { transition: transform .2s; }
.af-btn:hover:not(:disabled) .af-arrow { transform: translateX(3px); }
.af-spin { display: none; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: af-rot .8s linear infinite; }
.af-btn.is-busy { cursor: progress; opacity: .92; }
.af-btn.is-busy:disabled { opacity: .92; }
.af-btn.is-busy .af-spin { display: inline-block; }
.af-btn.is-busy .af-btn-ic, .af-btn.is-busy .af-arrow { display: none; }
@keyframes af-rot { to { transform: rotate(360deg); } }

.af-alt { margin: 20px 0 0; text-align: center; color: var(--af-muted); font-size: 14px; }
.af-alt a { font-weight: 800; }
.af-foot { margin: 10px 0 0; display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center; color: var(--af-faint); font-size: 12.5px; }

/* ---------- THÀNH CÔNG: dấu tích vẽ nét + pháo hoa CSS ---------- */
.af-success { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; align-content: center; gap: 10px; padding: 24px; text-align: center;
  border-radius: inherit; background: var(--af-card-solid); animation: af-fade .3s ease both; }
.af-success h2 { font-size: 22px; font-weight: 800; }
.af-success p { margin: 0; color: var(--af-muted); }
@keyframes af-fade { from { opacity: 0; } }
.af-check { width: 88px; height: 88px; }
.af-check circle { fill: none; stroke: var(--af-ok); stroke-width: 3; stroke-dasharray: 252; stroke-dashoffset: 252; animation: af-draw .6s cubic-bezier(.65, 0, .45, 1) forwards; transform-origin: center; }
.af-check path { fill: none; stroke: var(--af-ok); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: af-draw .35s .5s cubic-bezier(.65, 0, .45, 1) forwards; }
.af-check-wrap { position: relative; display: grid; place-items: center; animation: af-pop .5s .45s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes af-draw { to { stroke-dashoffset: 0; } }
@keyframes af-pop { 0% { transform: scale(.9); } 50% { transform: scale(1.08); } 100% { transform: none; } }
.af-burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.af-burst i { position: absolute; left: -4px; top: -6px; width: 8px; height: 12px; border-radius: 2px; background: var(--c, #2f6bff); opacity: 0;
  animation: af-confetti 1.1s cubic-bezier(.15, .7, .3, 1) forwards; animation-delay: var(--d, 0s); }
@keyframes af-confetti {
  0% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0) scale(.6); }
  100% { opacity: 0; transform: translate3d(var(--x), var(--y), 0) rotate(var(--r)) scale(1); }
}

/* ---------- MÀN VỪA + ĐIỆN THOẠI: giới thiệu thu thành dải đầu trang ---------- */
@media (max-width: 1100px) {
  .af-glass.g3 { display: none; }
}
@media (max-width: 960px) {
  .af-main, .af-main.narrow { grid-template-columns: 1fr; max-width: 620px; gap: 16px; }
  .af-show { min-height: 0; border-radius: 22px; padding: 20px 20px 18px; }
  .af-show h2 { margin: 12px 0 6px; font-size: clamp(1.25rem, 1rem + 2vw, 1.7rem); max-width: none; }
  .af-show-p { font-size: 13.5px; }
  .af-stage { position: absolute; inset: 0; margin: 0; min-height: 0; z-index: -1; opacity: .55; }
  .af-phone, .af-glass, .af-benefits, .af-trust { display: none; }
  .af-chip.c1 { left: auto; right: 6%; bottom: 14%; } .af-chip.c2 { left: auto; right: 24%; top: 10%; } .af-chip.c3 { right: 4%; top: 46%; }
  .af-tabs { margin: 0 0 0 auto; }
}
@media (max-width: 560px) {
  .af-top { flex-wrap: wrap; padding-top: 12px; row-gap: 10px; }
  .af-tabs { order: 3; width: 100%; margin: 0; }
  .af-tab { flex: 1; justify-content: center; }
  .af-prefs { margin-left: auto; }
  .af-row { grid-template-columns: 1fr; }
  .af-card { border-radius: 22px; }
  .af-input, .af-select { font-size: 16px; }   /* iOS không tự phóng to khi gõ */
  /* chip trang trí nổi ĐÈ lên câu mô tả ở 360–414px ("phụ đề và…" bị che) ⇒ ẩn hết trên điện thoại */
  .af-chip, .af-chip.c1 { display: none; }
  /* vùng bấm ≥40px trên điện thoại (đo tools/kiem_tuong_phan.py) */
  .af-tab, .af-logo { min-height: 44px; }
  .af-link { min-height: 40px; display: inline-flex; align-items: center; }
}

/* ---------- giảm chuyển động ---------- */
@media (prefers-reduced-motion: reduce) {
  .af *, .af *::before, .af *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
  .af-aurora, .af-mesh i { display: none; }
  .af-karaoke span { color: #fff; }
  .af-btn::before { display: none; }
  .af-benefits li { opacity: 1; }
}
