﻿/* ===== Màn Đăng nhập / Đăng ký / Xác thực SĐT / Tạo mật khẩu =====
   Nguồn: Figma - section "Đăng nhập lần đầu", "Đăng nhập lần sau", "Đăng ký" (frame rộng 393px) */

/* ---- Thành phần dùng chung ---- */
.ui-field { display: flex; flex-direction: column; }
.ui-field__label { margin: 0; padding: 0 0 4px; font-size: 16px; font-weight: 600; line-height: 19.09px; color: var(--text-primary); }
.ui-field__help { padding-top: 4px; font-size: 14px; font-weight: 400; line-height: 20px; color: var(--text-secondary); }

.ui-input { display: flex; align-items: center; min-height: 48px; padding: 4px 4px 4px 0; background: #fff; border: 1px solid var(--border-input); border-radius: 8px; overflow: hidden; }
.ui-input--pad { padding-left: 12px; }
.ui-input--focus, .ui-input:focus-within { min-height: 52px; border-color: var(--text-primary); }
.ui-input__text { flex: 1 1 auto; min-width: 0; padding: 10px 0; border: 0; outline: 0; background: transparent; font-size: 16px; font-weight: 400; line-height: 19.09px; color: var(--text-primary); }
.ui-input__text::placeholder { color: var(--placeholder); opacity: 1; }
.ui-input__icon { flex: 0 0 48px; display: flex; align-items: center; justify-content: center; align-self: stretch; padding: 10px 12px; }
.ui-input__icon img { width: 24px; height: 24px; }
.ui-input__divider { flex: 0 0 1px; width: 1px; height: 36px; background: var(--divider); }
.ui-input__country { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; padding: 10px 12px; font-size: 16px; font-weight: 400; line-height: 19.09px; color: var(--text-primary); }
.ui-input__country img { width: 21px; height: 15px; }
.ui-input__btn { flex: 0 0 40px; width: 40px; height: 40px; padding: 8px; border: 0; border-radius: 8px; background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ui-input__btn img { width: 24px; height: 24px; }

.ui-btn { display: flex; align-items: center; justify-content: center; width: 100%; height: 48px; padding: 8px 12px; border: 0; border-radius: 9999px; background: var(--btn-primary); color: #fff; font-size: 16px; font-weight: 600; line-height: 19.09px; text-decoration: none; cursor: pointer; }
.ui-btn:disabled, .ui-btn.is-disabled { background: var(--btn-disabled-bg); color: var(--btn-disabled-text); cursor: default; }
.ui-btn-face { flex: 0 0 48px; width: 48px; height: 48px; padding: 10px; border: 1px solid var(--btn-face-border); border-radius: 90px; background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ui-btn-face img { width: 26px; height: 26px; }
.ui-btn-group { display: flex; gap: 8px; }

.ui-contact { display: flex; flex-direction: column; align-items: center; text-align: center; font-size: 14px; font-weight: 400; line-height: 20px; }
.ui-contact__line { display: flex; align-items: flex-start; gap: 7px; height: 27px; padding-top: 1px; }
.ui-contact__hotline { font-size: 18px; font-weight: 700; line-height: 21.48px; }

/* ---- Màn Đăng nhập / Đăng ký (nền đỏ) ---- */
body.page-auth { background: #4B0A08 url("../img/login-bg.jpg") center top / cover no-repeat fixed; }

.auth-login { position: relative; display: flex; flex-direction: column; width: 100%; max-width: var(--app-width); min-height: 100vh; margin: 0 auto; padding-top: env(safe-area-inset-top); padding-bottom: 59px; color: #fff; }
.auth-login__back { position: absolute; top: env(safe-area-inset-top); left: 4px; width: 48px; height: 48px; padding: 12px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: transparent; }
.auth-login__back img { width: 24px; height: 24px; }
.auth-login__logo { position: absolute; top: calc(48px + env(safe-area-inset-top)); left: 16px; width: 143px; height: auto; }
.auth-login__hello { position: absolute; top: calc(112px + env(safe-area-inset-top)); left: 15px; margin: 0; font-size: 23px; font-weight: 700; line-height: 27.4px; color: #fff; }
.auth-login__mascot { position: absolute; top: env(safe-area-inset-top); right: 31px; width: 179px; height: 194px; object-fit: contain; pointer-events: none; }

.auth-card { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 20px; margin: 184px 16px 0; padding: 16px 16px 20px; border-radius: 24px; background: linear-gradient(180deg, var(--card-top) 0%, var(--card-bottom) 100%); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .8); color: var(--text-primary); }

.auth-tab { display: flex; gap: 4px; height: 48px; padding: 4px; border-radius: 999px; background: var(--tab-track); overflow: hidden; }
.auth-tab__item { text-decoration: none; flex: 1 1 0; display: flex; align-items: center; justify-content: center; padding: 8px; border: 0; border-radius: 8px; background: transparent; font-size: 16px; font-weight: 600; line-height: 19.09px; color: var(--text-tab-inactive); cursor: pointer; }
.auth-tab__item.is-active { border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 0 0 .5px var(--border-input); color: var(--text-primary); }

.auth-panel { display: none; flex-direction: column; gap: 20px; }
.auth-panel.is-active { display: flex; }
.auth-fields { display: flex; flex-direction: column; gap: 16px; }
.auth-name { margin: 0; font-size: 18px; font-weight: 700; line-height: 21.48px; color: var(--text-negative); }
.auth-forgot { display: block; padding: 0; border: 0; background: none; font-size: 16px; font-weight: 600; line-height: 19.09px; text-align: center; color: var(--text-secondary); }
.auth-intro { display: flex; flex-direction: column; gap: 2px; }
.auth-intro__title { margin: 0; font-size: 18px; font-weight: 700; line-height: 21.48px; color: #222; }
.auth-intro__sub { margin: 0; font-size: 16px; font-weight: 400; line-height: 19.09px; color: var(--text-secondary); }

.auth-login__contact { margin-top: auto; padding: 0 12px; color: #fff; }

/* ---- Màn nền sáng: Xác thực SĐT / Tạo mật khẩu ---- */
body.page-step { background: var(--page-bg-light); }
.step { display: flex; flex-direction: column; width: 100%; max-width: 768px; min-height: 100vh; margin: 0 auto; }
.step__bar { display: flex; align-items: center; gap: 0; height: 56px; margin-top: calc(8px + env(safe-area-inset-top)); padding: 4px 8px; background: #fff; }
.step__back { flex: 0 0 48px; width: 48px; height: 48px; padding: 12px; border: 0; border-radius: 32px; background: transparent; display: flex; align-items: center; justify-content: center; }
.step__back img { width: 24px; height: 24px; }
.step__title { margin: 0; font-size: 18px; font-weight: 600; line-height: 21.48px; color: var(--text-primary); }
.step__panel { flex: 1 1 auto; display: flex; flex-direction: column; gap: 24px; margin-top: 4px; padding: 16px; background: #fff; }
.step__head { display: flex; flex-direction: column; gap: 4px; }
.step__head-title { margin: 0; font-size: 18px; font-weight: 600; line-height: 21.48px; color: var(--text-primary); }
.step__head-sub { margin: 0; font-size: 14px; font-weight: 400; line-height: 20px; color: var(--text-secondary); }
.step__head-sub b { font-weight: 600; line-height: 16.7px; }
.step__form { display: flex; flex-direction: column; gap: 24px; }
.step__footer { margin-top: auto; padding: 9px 0 calc(9px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--footer-border); color: var(--text-secondary); }
.step__footer .ui-contact__hotline { color: var(--brand-primary); }

.pin { display: flex; gap: 8px; height: 64px; }
.pin__cell { flex: 1 1 0; min-width: 0; height: 64px; padding: 0; border: 0; border-radius: 12px; background: var(--pin-bg); text-align: center; font-size: 18px; font-weight: 700; line-height: 21.48px; color: var(--text-primary); outline: 0; }
.pin__cell::placeholder { color: rgba(0, 0, 0, .3); font-weight: 700; opacity: 1; }
.pin__cell:focus { box-shadow: inset 0 0 0 1px var(--text-primary); }
.pin-meta { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 16px; font-size: 14px; font-weight: 400; line-height: 20px; color: var(--text-secondary); }
.pin-meta b { font-weight: 600; line-height: 16.7px; }
.pin-meta__resend { padding: 0; border: 0; background: none; font-size: 14px; font-weight: 600; line-height: 16.7px; color: var(--btn-disabled-text); }
.pin-meta__resend.is-ready { color: var(--text-primary); cursor: pointer; }
.pin-meta__count { font-size: 14px; font-weight: 600; line-height: 16.7px; color: var(--brand-primary); }
.pin-meta__resend-wrap { display: flex; align-items: center; }

.pw-rules { display: flex; flex-direction: column; gap: 8px; }
.pw-rules__note { margin: 0; font-size: 14px; font-weight: 400; line-height: 20px; color: var(--text-secondary); }
.pw-rule { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 400; line-height: 19.09px; color: var(--text-primary); }
.pw-rule img { width: 20px; height: 20px; }
.pw-rule.is-bad { color: var(--text-error); }
.pw-fields { display: flex; flex-direction: column; gap: 16px; }