/* ============================================================
   auth.css — Trang /dang-nhap/ (P5)
   Bố cục 2 cột port từ kimholding, RESKIN xanh #1652E4 + Be Vietnam Pro.
   Màu lấy từ biến trong tokens.css (nạp trước) — sửa thương hiệu 1 chỗ.
   tokens.css đã reset box-sizing toàn cục + font-family:inherit cho form control.
   ============================================================ */
.kha-body { margin: 0; background: #fff; font-family: var(--kh-font); -webkit-font-smoothing: antialiased; }

/* 🔴 Hàng 6 ô OTP có min-content rất rộng vì <input> mang bề rộng mặc định của trình duyệt.
   `1fr` = `minmax(auto,1fr)`, sàn `auto` = MIN-CONTENT ⇒ cột lưới phình theo hàng ô đó, đẩy
   trang rộng hơn khung. Chữa chuẩn: minmax(0,1fr) để sàn = 0, kèm min-width:0 cho con. */
.kha-split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.kha-split > * { min-width: 0; }

/* ===== Brand panel trái ===== */
.kha-brand {
  position: sticky; top: 0; align-self: start; height: 100vh;
  background: linear-gradient(150deg, var(--kh-brand) 0%, #0E3AA8 52%, var(--kh-hero) 100%);
  overflow: hidden; display: flex; flex-direction: column;
  justify-content: space-between; gap: 24px;
  padding: 48px 56px; box-sizing: border-box;
}
.kha-orb { position: absolute; border-radius: 50%; pointer-events: none; }
.kha-orb-tr { top: -140px; right: -120px; width: 480px; height: 480px; background: radial-gradient(circle, rgba(255,255,255,.24), transparent 64%); }
.kha-orb-bl { bottom: -160px; left: -100px; width: 420px; height: 420px; background: radial-gradient(circle, rgba(0,0,0,.30), transparent 66%); }
.kha-orb-mid { top: 34%; left: -170px; width: 360px; height: 360px; background: radial-gradient(circle, rgba(120,170,255,.20), transparent 68%); }
.kha-dots {
  position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.16) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 62%, transparent 92%);
          mask-image: linear-gradient(180deg, #000 0%, #000 62%, transparent 92%);
}
.kha-deco { position: absolute; inset: 0; pointer-events: none; color: #fff; }
.kha-deco-i { position: absolute; }
.kha-deco-1 { top: 12%;  right: 16%; width: 54px; height: 54px; opacity: .16; transform: rotate(-8deg); }
.kha-deco-2 { top: 26%;  left: 12%;  width: 40px; height: 40px; opacity: .13; transform: rotate(12deg); }
.kha-deco-3 { bottom: 30%; right: 12%; width: 44px; height: 44px; opacity: .14; transform: rotate(6deg); }
.kha-deco-4 { top: 6%;   left: 46%;  width: 62px; height: 62px; opacity: .10; transform: rotate(-4deg); }
.kha-deco-5 { bottom: 14%; left: 30%; width: 34px; height: 34px; opacity: .11; transform: rotate(10deg); }

.kha-stats {
  position: relative; display: flex; align-items: center; gap: 18px;
  background: rgba(255,255,255,.12);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.20); border-radius: 16px;
  padding: 16px 20px; max-width: 440px; box-sizing: border-box;
}
.kha-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kha-stat b { font-family: var(--kh-font); font-size: 24px; font-weight: 700; color: #fff; line-height: 1.1; letter-spacing: -.3px; }
.kha-stat span { font-size: 11.5px; color: rgba(255,255,255,.80); white-space: nowrap; }
.kha-stat-sep { width: 1px; align-self: stretch; background: rgba(255,255,255,.22); flex: none; }
.kha-brand-top { display: flex; align-items: center; gap: 12px; position: relative; text-decoration: none; }
.kha-brand-logo { width: 50px; height: 50px; border-radius: var(--kh-r-md); background: #fff; display: grid; place-items: center; flex: none; }
.kha-brand-name { display: block; font-weight: 700; font-size: 18px; letter-spacing: .04em; color: #fff; line-height: 1.1; }
.kha-brand-tag { display: block; font-size: 9px; font-weight: 600; letter-spacing: .11em; color: rgba(255,255,255,.85); margin-top: 3px; }
.kha-brand-mid { position: relative; }
.kha-brand-mid h2 { font-family: var(--kh-font); font-weight: 700; font-size: 34px; line-height: 1.2; color: #fff; margin: 0; max-width: 440px; text-wrap: balance; letter-spacing: -.5px; }
.kha-brand-mid p { font-size: 15px; line-height: 1.7; color: rgba(255,255,255,.85); margin: 18px 0 0; max-width: 420px; }
.kha-usp { display: flex; flex-direction: column; gap: 13px; margin-top: 28px; }
.kha-usp-row { display: flex; align-items: center; gap: 12px; color: #fff; font-size: 14px; }
.kha-usp-ic { width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; flex: none; }

/* ===== Form panel phải ===== */
.kha-form-side { display: flex; align-items: center; justify-content: center; padding: 40px 32px; }
.kha-form-box { width: 100%; max-width: 420px; }
/* audit #13: đệm dương + lề âm bù — chữ giữ nguyên chỗ, vùng chạm ≥24px (cũ cao 16–20) */
.kha-backhome { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--kh-muted-2); padding: 6px 8px; margin: -6px -8px 20px; text-decoration: none; transition: color .2s; }
.kha-backhome:hover { color: var(--kh-brand); }
.kha-h1 { font-family: var(--kh-font); font-weight: 700; font-size: 28px; color: var(--kh-ink); margin: 0; letter-spacing: -.5px; }
.kha-sub { font-size: 14px; color: var(--kh-muted-2); margin: 8px 0 0; line-height: 1.6; }
.kha-field { margin-top: 16px; }
/* Hàng "Số điện thoại | Email" xếp 2 dòng: hộp form kẹp 420px, 2 ô + icon không đủ chỗ cho
   chữ mẫu email → tách dòng cho thoáng (theo bài học kimholding). */
.kha-row2 { display: flex; flex-direction: column; gap: 0; }
.kha-row2 .kha-field { flex: 1; min-width: 0; }
.kha-lbl { display: block; font-size: 13px; font-weight: 600; color: var(--kh-ink); margin-bottom: 7px; }
.kha-lblrow { display: flex; align-items: center; justify-content: space-between; }
.kha-lblrow .kha-minilink { margin-bottom: 7px; }
/* audit #5+#6: viền 1px + radius token + liệt kê thuộc tính transition (site cấm `all`) */
.kha-in { width: 100%; box-sizing: border-box; border: 1px solid var(--kh-line-strong); border-radius: var(--kh-r); padding: 14px 16px; font-size: 14.5px; color: var(--kh-ink); transition: border-color .15s, box-shadow .15s, background .15s; background: #fff; font-family: inherit; outline: none; }
.kha-in::placeholder { color: var(--kh-placeholder); }
.kha-in:focus { border-color: var(--kh-brand); box-shadow: 0 0 0 3px rgba(22,82,228,.12); }
/* Icon trong ô nhập — pointer-events:none để bấm trúng icon vẫn focus vào ô. */
.kha-inwrap { position: relative; display: block; }
.kha-inwrap .kha-in,
.kha-pwwrap .kha-in { padding-left: 44px; }
.kha-ico { position: absolute; top: 50%; left: 15px; transform: translateY(-50%); pointer-events: none; }
.kha-inwrap:focus-within .kha-ico,
.kha-pwwrap:focus-within .kha-ico { stroke: var(--kh-brand); }
.kha-hint { font-size: 11.5px; color: var(--kh-muted-3); margin-top: 5px; }
.kha-pwwrap { position: relative; }
.kha-pwwrap .kha-in { padding-right: 46px; }
.kha-eye { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 36px; height: 36px; border: none; background-color: transparent; border-radius: 9px; cursor: pointer; background-repeat: no-repeat; background-position: center; background-size: 18px 18px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A8A8A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
.kha-eye.is-show { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231652E4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94'/%3E%3Cpath d='M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19'/%3E%3Cpath d='M14.12 14.12a3 3 0 1 1-4.24-4.24'/%3E%3Cpath d='M1 1l22 22'/%3E%3C/svg%3E"); }
.kha-eye:hover { background-color: var(--kh-brand-tint-2); }
.kha-check { display: flex; align-items: center; gap: 9px; margin-top: 16px; font-size: 13.5px; color: var(--kh-text-2); cursor: pointer; line-height: 1.5; }
.kha-check input { width: 16px; height: 16px; accent-color: var(--kh-brand); flex: none; margin: 0; }
.kha-check-top { align-items: flex-start; font-size: 13px; }
.kha-check-top input { margin-top: 2px; }
.kha-err { font-size: 13px; font-weight: 600; color: var(--kh-brand); background: var(--kh-brand-tint); border-radius: var(--kh-r-sm); padding: 10px 14px; margin-top: 16px; line-height: 1.5; }
.kha-btn { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; box-sizing: border-box; background: var(--kh-brand); color: #fff; font-size: 15px; font-weight: 700; padding: 15px; border-radius: var(--kh-r-md); margin-top: 20px; border: none; cursor: pointer; font-family: inherit; text-decoration: none; transition: background .15s, box-shadow .15s, transform .15s; }
.kha-btn:hover { background: var(--kh-brand-hover); transform: translateY(-1px); box-shadow: 0 2px 8px -2px rgba(22,82,228,.5); }
.kha-btn:disabled { opacity: .65; cursor: default; transform: none; box-shadow: none; }
.kha-swap { text-align: center; font-size: 14px; color: var(--kh-muted-2); margin: 24px 0 0; }
.kha-strong-link { display: inline-block; font-weight: 700; color: var(--kh-brand); border: none; background: none; padding: 6px 8px; margin: -6px -8px; cursor: pointer; font-family: inherit; font-size: inherit; text-decoration: none; }
.kha-strong-link:hover { color: var(--kh-brand-hover); }
.kha-backlink { display: inline-flex; align-items: center; gap: 6px; }
.kha-minilink { display: inline-block; font-size: 12.5px; font-weight: 600; color: var(--kh-brand); border: none; background: none; padding: 6px 8px; margin: -6px -8px; cursor: pointer; font-family: inherit; }
.kha-minilink:hover { color: var(--kh-brand-hover); }
.kha-minilink:disabled { color: var(--kh-muted-3); cursor: default; }

/* ===== Ô OTP ===== */
.kha-otp-row { display: flex; gap: 10px; margin-top: 22px; }
.kha-otp-box { flex: 1; min-width: 0; box-sizing: border-box; height: 56px; text-align: center; font-size: 22px; font-weight: 700; color: var(--kh-ink); border: 1px solid var(--kh-line-strong); border-radius: var(--kh-r-md); outline: none; transition: border-color .15s, box-shadow .15s; font-family: inherit; }
.kha-otp-box:focus { border-color: var(--kh-brand); box-shadow: 0 0 0 3px rgba(22,82,228,.12); }
.kha-otp-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: 12.5px; color: var(--kh-muted-2); }

/* ===== Màn thành công ===== */
.kha-ok { text-align: center; padding: 20px 0; }
.kha-ok-ic { width: 70px; height: 70px; border-radius: 50%; background: var(--kh-brand-tint); display: inline-grid; place-items: center; }
.kha-ok-title { font-size: 26px; margin-top: 20px; }
.kha-ok-msg { font-size: 14.5px; color: var(--kh-muted-2); line-height: 1.7; margin-top: 12px; }
.kha-ok-cta { margin-top: 24px; }
.kha-ok-back { display: inline-block; margin-top: 12px; font-size: 13.5px; font-weight: 700; color: var(--kh-ink); border: none; background: none; cursor: pointer; font-family: inherit; }
.kha-ok-back:hover { color: var(--kh-brand); }

/* ===== Responsive: ẩn brand panel dưới 900px ===== */
@media (max-width: 900px) {
  .kha-brand { display: none; }
  .kha-split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .kha-form-side { padding: 28px 18px; }
  .kha-otp-row { gap: 7px; }
  .kha-otp-box { height: 50px; font-size: 19px; }
}
