/*
 * Giao diện Đăng nhập / Đăng ký / Quên mật khẩu (web app /app)
 * Đồng bộ với app mobile (App-Claude/src/constants/theme.ts, components/auth/*)
 */
.auth-app {
    --auth-primary: #ED1F25;
    --auth-primary-dark: #C8102E;
    --auth-primary-soft: #FDECEC;
    --auth-text: #1F1F1F;
    --auth-text-2: #6B6B6B;
    --auth-muted: #9A9AA0;
    --auth-canvas: #F3F1F5;
    --auth-input-bg: #F7F7F9;
    --auth-element: #F4F4F6;
    --auth-border: #E2E2E6;
    --auth-zalo: #0068FF;

    background: var(--auth-canvas) !important;
    color: var(--auth-text) !important;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

.auth-app a { color: var(--auth-primary); }
.auth-app a:hover { color: var(--auth-primary-dark); text-decoration: none; }

/* ---------- Khung trang ---------- */
.auth-page {
    max-width: 500px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    background: var(--auth-canvas);
}

.auth-top {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    padding-bottom: 8px;
}

/* ---------- Logo + khẩu hiệu ---------- */
.auth-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
}

.auth-header__logo img {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    display: block;
}

.auth-header__slogan {
    flex: 1;
    text-align: center;
    font-size: 14px;
    line-height: 21px;
    font-weight: 800;
    color: var(--auth-text);
    text-transform: uppercase;
}

.auth-header__slogan em {
    font-style: normal;
    color: var(--auth-primary);
}

/* ---------- Carousel video ---------- */
.auth-carousel { padding: 0; }

/* Cắt slide trong khung để slide cũ không tràn ra ngoài khi chuyển.
   Padding nằm trong từng slide để bóng đổ của video không bị cắt. */
.auth-carousel .carousel-inner { overflow: hidden; }
.auth-carousel .carousel-item { text-align: center; padding: 4px 24px 12px; }

.auth-video {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    overflow: hidden;
    background: var(--auth-border);
    box-shadow: 0 6px 12px rgba(0, 0, 0, .14);
}

.auth-video img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.auth-video__play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 56px;
    height: 56px;
    margin: -28px 0 0 -28px;
    border-radius: 50%;
    background: rgba(237, 31, 37, .9);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}

.auth-video__play::before {
    content: "";
    margin-left: 4px;
    border-style: solid;
    border-width: 10px 0 10px 16px;
    border-color: transparent transparent transparent #FFF;
}

.auth-video__title {
    margin-top: 14px;
    min-height: 66px;
    font-size: 17px;
    line-height: 22px;
    font-weight: 600;
    color: var(--auth-text);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Nút trái/phải: lớp phủ đúng bằng khung video 16:9, nút nằm giữa theo chiều dọc */
.auth-carousel__stage { position: relative; }

.auth-carousel__nav {
    position: absolute;
    top: 4px;
    left: 24px;
    right: 24px;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    pointer-events: none;
}

.auth-carousel__btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: var(--auth-text) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
    pointer-events: auto;
    transition: background-color .15s ease, transform .1s ease;
}

.auth-carousel__btn:hover { background: #FFF; }
.auth-carousel__btn:active { transform: scale(.94); }
.auth-carousel__btn:focus { outline: 0; box-shadow: 0 0 0 3px rgba(237, 31, 37, .35); }

.auth-carousel .carousel-indicators {
    position: static;
    margin: 0 0 16px;
    gap: 6px;
}

.auth-carousel .carousel-indicators li {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    margin: 0;
    border: 0;
    border-radius: 4px;
    background: var(--auth-border);
    opacity: 1;
    text-indent: -999px;
    transition: width .25s ease, background-color .25s ease;
}

.auth-carousel .carousel-indicators li.active {
    width: 22px;
    background: var(--auth-primary);
}

/* ---------- Sheet trắng chứa form ---------- */
.auth-sheet {
    position: relative;
    background: #FFF;
    border-radius: 36px 36px 0 0;
    padding: 24px 24px calc(24px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .08);
}

.auth-title {
    margin: 0 0 18px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .3px;
    text-transform: uppercase;
    color: var(--auth-text);
}

.auth-title--with-back {
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: none;
    letter-spacing: 0;
    font-size: 16px;
    line-height: 1.35;
}

.auth-back {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--auth-element);
    color: var(--auth-text) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-stack { display: flex; flex-direction: column; gap: 14px; }
.auth-stack > * { margin-top: 0; margin-bottom: 0; }

/* ---------- Ô nhập ---------- */
.auth-field {
    display: flex;
    align-items: center;
    height: 50px;
    margin: 0;
    border: 1.5px solid var(--auth-border);
    border-radius: 12px;
    background: var(--auth-input-bg);
    overflow: hidden;
    cursor: text;
    transition: border-color .15s ease, background-color .15s ease;
}

.auth-field:focus-within {
    border-color: var(--auth-primary);
    background: #FFF;
}

.auth-field__icon {
    flex: 0 0 46px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--auth-element);
    border-right: 1px solid var(--auth-border);
    color: #3A3A3A;
    font-size: 18px;
}

.auth-field__input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 14px;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 16px; /* >= 16px để iOS không tự phóng to khi focus */
    color: var(--auth-text);
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
}

.auth-field__input::placeholder { color: var(--auth-muted); opacity: 1; }
.auth-field__input::-webkit-outer-spin-button,
.auth-field__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

select.auth-field__input { cursor: pointer; padding-right: 0; }
select.auth-field__input:invalid,
select.auth-field__input.is-empty { color: var(--auth-muted); }
select.auth-field__input option { color: var(--auth-text); }

.auth-field__suffix,
.auth-field__eye {
    flex: 0 0 auto;
    height: 100%;
    padding: 0 14px;
    border: 0;
    background: transparent;
    color: var(--auth-muted);
    display: flex;
    align-items: center;
    font-size: 17px;
    pointer-events: none;
}

.auth-field__eye { pointer-events: auto; cursor: pointer; }
.auth-field__eye:focus { outline: 0; color: var(--auth-text); }

/* ---------- Checkbox ---------- */
.auth-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--auth-text);
    cursor: pointer;
}

.auth-check input {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    margin: 0;
    border: 2px solid #C8C8CE;
    border-radius: 7px;
    background: #FFF center / 14px no-repeat;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}

.auth-check input:checked {
    border-color: var(--auth-primary);
    background-color: var(--auth-primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}

.auth-check input:focus-visible { outline: 2px solid var(--auth-primary); outline-offset: 2px; }
.auth-check a { font-weight: 600; text-decoration: underline; }

.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
}

.auth-options .auth-check { align-items: center; }
.auth-link-strong { font-weight: 600; }

/* ---------- Nút ---------- */
.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 54px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: var(--auth-primary);
    color: #FFF !important;
    font-size: 17px;
    font-weight: 700;
    box-shadow: 0 6px 14px rgba(237, 31, 37, .28);
    cursor: pointer;
    transition: background-color .15s ease, transform .1s ease;
}

.auth-btn:hover { background: var(--auth-primary-dark); }
.auth-btn:active { transform: scale(.98); }
.auth-btn:focus { outline: 0; box-shadow: 0 0 0 3px rgba(237, 31, 37, .3); }

.auth-btn--zalo {
    height: 48px;
    background: #FFF;
    color: var(--auth-zalo) !important;
    border: 1.5px solid var(--auth-zalo);
    box-shadow: none;
    font-size: 15px;
}

.auth-btn--zalo:hover { background: #EEF5FF; }

.auth-switch {
    padding: 14px 0 0;
    text-align: center;
    font-size: 15px;
    color: var(--auth-text-2);
}

.auth-switch a { font-weight: 700; margin-left: 4px; }
.auth-switch__sep { margin: 0 12px; color: var(--auth-border); }

/* ---------- Khối hướng dẫn (quên mật khẩu) ---------- */
.auth-note {
    font-size: 14px;
    line-height: 1.55;
    color: var(--auth-text-2);
}

.auth-option {
    border: 1px solid var(--auth-border);
    border-radius: 16px;
    padding: 14px;
}

.auth-option__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 700;
}

.auth-option__num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--auth-primary-soft);
    color: var(--auth-primary);
    font-size: 13px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-option p { margin: 0 0 12px; font-size: 14px; line-height: 1.55; color: var(--auth-text-2); }

.auth-recaptcha { display: flex; justify-content: flex-start; overflow: hidden; }

.auth-header__slogan em { white-space: nowrap; }

/* Màn hẹp (iPhone 375px…): thu nhỏ một chút để khẩu hiệu giữ 2 dòng như app */
@media (max-width: 399px) {
    .auth-header { padding-left: 20px; padding-right: 20px; gap: 12px; }
    .auth-header__logo img { width: 60px; height: 60px; }
    .auth-header__slogan { font-size: 13px; line-height: 20px; }
    /* reCAPTCHA rộng cố định 304px, thu nhỏ để không bị cắt trong thẻ */
    .auth-recaptcha .g-recaptcha { transform: scale(.92); transform-origin: left top; margin-bottom: -6px; }
}

/* Màn hình thấp: thu nhỏ vùng video để form không bị đẩy quá xa */
@media (max-height: 700px) {
    .auth-video__title { min-height: 0; -webkit-line-clamp: 2; font-size: 15px; }
    .auth-header { padding-top: 10px; padding-bottom: 10px; }
}

/* =========================================================
 * Các bước xác nhận đăng ký (layout auth_steps)
 * ========================================================= */
.auth-steps__bar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(243, 241, 245, .94);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.auth-steps__logo img {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: block;
}

.auth-steps__info { flex: 1; min-width: 0; }

.auth-steps__label {
    font-size: 13px;
    font-weight: 700;
    color: var(--auth-text-2);
    margin-bottom: 6px;
}

.auth-steps__progress { display: flex; gap: 6px; }

.auth-steps__progress span {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--auth-border);
}

.auth-steps__progress span.is-done { background: var(--auth-primary); }

.auth-steps__body {
    flex: 1 0 auto;
    padding: 8px 16px calc(104px + env(safe-area-inset-bottom));
}

.auth-steps__title {
    margin: 4px 0 4px;
    font-size: 22px;
    line-height: 1.3;
    font-weight: 800;
    color: var(--auth-text);
}

.auth-steps__lead {
    margin: 0 0 16px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--auth-text-2);
}

/* Thẻ nội dung */
.auth-card {
    background: #FFF;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--auth-text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}

.auth-card p { margin: 0 0 10px; }
.auth-card > :last-child { margin-bottom: 0; }

.auth-card--warn {
    background: var(--auth-primary-soft);
    box-shadow: none;
    display: flex;
    gap: 12px;
}

.auth-card--warn .auth-card__icon {
    flex: 0 0 auto;
    color: var(--auth-primary);
    font-size: 18px;
    line-height: 1.4;
}

.auth-card--muted {
    background: var(--auth-element);
    box-shadow: none;
    display: flex;
    gap: 12px;
    color: var(--auth-text-2);
}

.auth-card--muted .auth-card__icon {
    flex: 0 0 auto;
    color: var(--auth-text-2);
    font-size: 17px;
    line-height: 1.45;
}

.auth-card__heading {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 800;
}

/* Danh sách có dấu tích */
.auth-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.auth-list li {
    position: relative;
    padding-left: 32px;
    margin-bottom: 10px;
}

.auth-list li:last-child { margin-bottom: 0; }

.auth-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 1px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--auth-primary-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ED1F25' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.auth-list b { color: var(--auth-primary); }

/* Nhóm video */
.auth-section-title {
    margin: 24px 0 12px;
    font-size: 16px;
    font-weight: 800;
    color: var(--auth-text);
}

.auth-video-list { display: grid; gap: 14px; }
.auth-video-list .auth-video__title { min-height: 0; margin-top: 8px; font-size: 15px; line-height: 20px; -webkit-line-clamp: 2; }
.auth-video-item { display: block; color: inherit !important; }

/* Gói dịch vụ */
.auth-pkg {
    display: flex;
    gap: 12px;
}

.auth-pkg__num {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--auth-primary);
    color: #FFF;
    font-size: 14px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-pkg__body { flex: 1; min-width: 0; }

.auth-pkg__name {
    margin: 3px 0 6px;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.35;
}

.auth-pkg__about { font-size: 14px; color: var(--auth-text-2); }

.auth-pkg__price {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 13px;
    color: var(--auth-text-2);
}

.auth-pkg__chip {
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--auth-primary-soft);
    color: var(--auth-primary);
    font-weight: 700;
    white-space: nowrap;
}

/* Báo chí */
.auth-press { display: grid; gap: 16px; }

.auth-press__item { display: flex; gap: 12px; font-size: 14px; line-height: 1.5; color: var(--auth-text-2); }

.auth-press__logo {
    flex: 0 0 64px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--auth-border);
    background: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
}

.auth-press__logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.auth-press__item a { font-weight: 600; white-space: nowrap; }

/* Thanh hành động cố định dưới cùng */
.auth-actionbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: #FFF;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .08);
}

.auth-actionbar .auth-btn { flex: 1 1 0; height: 50px; font-size: 16px; }
.auth-actionbar .auth-btn--primary { flex-grow: 1.8; }

.auth-btn--ghost {
    background: var(--auth-element);
    color: var(--auth-text-2) !important;
    box-shadow: none;
}

.auth-btn--ghost:hover { background: var(--auth-border); }
