/* ===== ĐĂNG KÝ 3 BƯỚC (thông tin → OTP email → thành công) — phần RIÊNG của trang (2026-11-16) =====
   Khung, khối giới thiệu động, ô nhập nhãn nổi, nút gradient, dấu tích/pháo hoa: /shared-static/css/auth-flow.css.
   Màu đi qua biến --af-* ⇒ đúng cả Sáng lẫn Tối. Animation chỉ transform/opacity. */

.sg-card { max-width: 600px; justify-self: end; }

/* ---- 🏷️ đợt khuyến mãi (gói đang chọn): giá niêm yết gạch ngang mờ · giá bán đậm · chip "-X%" · dòng hạn ưu đãi ---- */
.sg-km { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: -6px 0 16px; padding: 10px 12px; border-radius: 12px;
  background: var(--af-soft); font-variant-numeric: tabular-nums; min-width: 0; }
.sg-km[hidden] { display: none; }
.sg-km-old { color: var(--af-muted); font-size: 14px; font-weight: 600; text-decoration: line-through; text-decoration-thickness: 1.5px; white-space: nowrap; }
.sg-km-new { color: var(--af-text); font-size: 17px; font-weight: 800; white-space: nowrap; }
.sg-km-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--af-err-bg);
  color: var(--af-err); font-size: 12px; font-weight: 800; white-space: nowrap; }
.sg-km-note { flex: 1 1 100%; display: flex; align-items: flex-start; gap: 6px; color: var(--af-warn); font-size: 12.5px; font-weight: 600;
  line-height: 1.45; overflow-wrap: anywhere; }
.sg-km-note .ic { flex: 0 0 auto; width: 15px; height: 15px; margin-top: 1px; }
.sg-pill { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 14px; padding: 6px 12px; border-radius: 999px;
  background: var(--af-soft); color: var(--af-a1); font-weight: 800; font-size: 12.5px; }
html[data-theme="dark"] .sg-pill { color: #8fb3ff; }

/* ---- thanh bước: 3 chấm + vạch nền + vạch tiến độ chạy theo --sg-p (0 → .5 → 1) ---- */
.sg-steps { position: relative; list-style: none; margin: 0 0 22px; padding: 0; display: flex; justify-content: space-between; }
.sg-steps::before, .sg-steps::after { content: ""; position: absolute; left: 14px; right: 14px; top: 13px; height: 3px; border-radius: 3px; background: var(--af-line); }
.sg-steps::after { background: var(--af-grad); transform-origin: left; transform: scaleX(var(--sg-p, 0)); transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.sg-steps li { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0;
  font-size: 12.5px; font-weight: 700; color: var(--af-faint); transition: color .3s; }
.sg-steps li:first-child { align-items: flex-start; }
.sg-steps li:last-child { align-items: flex-end; }
.sg-steps em { font-style: normal; white-space: nowrap; }
.sg-steps span { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 50%; border: 2px solid var(--af-line2);
  background: var(--af-card-solid); font-size: 12.5px; font-weight: 800; transition: background .3s, border-color .3s, color .3s, transform .3s; }
.sg-steps li.on { color: var(--af-a1); }
html[data-theme="dark"] .sg-steps li.on { color: #8fb3ff; }
.sg-steps li.on span { border-color: var(--af-a1); background: var(--af-a1); color: #fff; transform: scale(1.1); box-shadow: 0 0 0 5px var(--af-ring); }
.sg-steps li.done { color: var(--af-text); }   /* chữ bước xong: màu chữ thường (xanh lá trên nền sáng chỉ 3.3:1) — dấu tích vẫn xanh lá */
.sg-steps li.done span { border-color: var(--af-ok); background: var(--af-ok); color: #fff; font-size: 0; }
.sg-steps li.done span::before { content: "✓"; font-size: 14px; }

/* ---- chuyển bước: trượt + mờ dần (hướng theo data-dir JS đặt trên form) ---- */
.sg-pane { animation: sg-in-r .45s cubic-bezier(.2, .8, .2, 1) both; }
#sg-form[data-dir="back"] .sg-pane { animation-name: sg-in-l; }
@keyframes sg-in-r { from { opacity: 0; transform: translate3d(28px, 0, 0); } }
@keyframes sg-in-l { from { opacity: 0; transform: translate3d(-28px, 0, 0); } }

/* ---- bước OTP ---- */
.sg-otp-head { text-align: center; margin-bottom: 18px; }
.sg-mail-ico { position: relative; width: 68px; height: 68px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 22px;
  color: #fff; background: var(--af-grad); box-shadow: 0 16px 32px -14px rgba(47, 107, 255, .9); animation: af-float 4s ease-in-out infinite; }
.sg-mail-ico .ic { width: 30px; height: 30px; }
.sg-mail-ico i { position: absolute; inset: -6px; border-radius: 26px; border: 2px solid var(--af-a1); opacity: 0; animation: sg-ping 2.2s ease-out infinite; }
@keyframes sg-ping { 0% { opacity: .55; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.25); } }
.sg-otp-head h3 { font-size: 20px; font-weight: 800; }
.sg-otp-head p { margin: 6px 0 0; color: var(--af-muted); overflow-wrap: anywhere; }
.sg-otp-head b { color: var(--af-text); }
.sg-otp { display: flex; justify-content: center; gap: clamp(6px, 2vw, 12px); margin: 8px 0 22px; }
.sg-otp input {
  width: clamp(42px, 12vw, 58px); height: clamp(54px, 14vw, 66px); padding: 0; text-align: center; border-radius: 15px;
  border: 1.5px solid var(--af-line2); background: var(--af-input); color: var(--af-text); outline: none;
  font: 800 clamp(22px, 6vw, 28px)/1 sans-serif; font-family: inherit; caret-color: var(--af-a1);
  transition: border-color .2s, box-shadow .25s, background-color .2s;
}
.sg-otp input:focus { border-color: var(--af-a1); background: var(--af-card-solid); box-shadow: 0 0 0 4px var(--af-ring); }
.sg-otp input.filled { border-color: var(--af-a1); background: var(--af-soft); color: var(--af-a1); animation: sg-pop .28s cubic-bezier(.2, 1.6, .4, 1); }
html[data-theme="dark"] .sg-otp input.filled { color: #8fb3ff; }
@keyframes sg-pop { 0% { transform: scale(.82); } 100% { transform: none; } }
.sg-otp.shake { animation: af-shake .42s; }
.sg-otp.shake input { border-color: var(--af-err); }
.sg-otp-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.sg-otp-foot .af-link { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; }
.sg-otp-foot .af-link:empty { display: none; }   /* nút "Gửi lại" chưa có chữ (đang đếm giờ) ⇒ không để ô bấm rỗng 4px */
.sg-hint { margin: 12px 0 0; display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center; color: var(--af-muted); font-size: 13px; }
.sg-hint .ic { color: var(--af-warn); }
.sg-test { margin-bottom: 14px; padding: 10px 12px; border-radius: 12px; background: var(--af-warn-bg); color: var(--af-warn); font-size: 13px; text-align: center; }

/* ---- bước 3: thành công ---- */
.sg-done { display: grid; justify-items: center; gap: 8px; padding: 18px 0 6px; text-align: center; }
.sg-done h3 { font-size: 22px; font-weight: 800; }
.sg-done p { margin: 0; color: var(--af-muted); }
.sg-done-spin { display: inline-block; margin-top: 6px; border-color: var(--af-line2); border-top-color: var(--af-a1); }

@media (max-width: 960px) { .sg-card { max-width: none; justify-self: stretch; } }
@media (max-width: 420px) {
  .sg-steps em { font-size: 11px; }
  /* 6 ô OTP co theo bề ngang thẻ (360px: 6×42px + khe tràn ngang cả trang) */
  .sg-otp { gap: 6px; }
  .sg-otp input { width: 0; flex: 1 1 0; min-width: 0; max-width: 52px; }   /* width 0: không cộng bề ngang tự nhiên của ô vào bề ngang thẻ */
}
@media (prefers-reduced-motion: reduce) { .sg-pane, .sg-mail-ico, .sg-mail-ico i, .sg-otp input.filled { animation: none !important; } }
