/* ============================================================
   auth/register.css — Login / Register / Forgot Password
   Palette: navy #0a2d6e | blue #0d5db5 | cyan #29b6f6 | red #e53935
   ============================================================ */

/* ── Page wrapper ────────────────────────────────────────── */
.auth-register {
    padding: 48px 20px 64px;
    background: linear-gradient(160deg, #061b45 0%, #0a2d6e 40%, #0d5db5 100%);
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Dot texture */
.auth-register::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(41, 182, 246, 0.06) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
}

/* Glow blob */
.auth-register::after {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(41, 182, 246, 0.12), transparent 65%);
    pointer-events: none;
}

.auth-register__container {
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Heading */
.auth-register__heading {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    text-align: center;
    line-height: 1.3;
}

.auth-register__subheading {
    margin: 0 0 28px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
    line-height: 1.6;
}

/* ── Box ─────────────────────────────────────────────────── */
.auth-register__box {
    background: #fff;
    border-radius: 20px;
    padding: 32px 28px;
    box-shadow: 0 24px 64px rgba(10, 45, 110, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-register__title {
    margin: 0 0 22px;
    font-size: 20px;
    font-weight: 800;
    color: #0a2d6e;
    text-align: center;
}

/* Forgot password desc */
.auth-register__forgot-desc {
    margin: 0 0 16px;
    font-size: 14px;
    color: #5a6a8a;
    text-align: left;
    line-height: 1.6;
}

/* ── Social buttons ──────────────────────────────────────── */
.auth-social { margin-bottom: 6px; }

.auth-social__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: 1.5px solid #c5d8f0;
    background: #fff;
    color: #374151;
    transition: background 0.15s, box-shadow 0.15s;
    cursor: pointer;
    margin-bottom: 10px;
    font-family: inherit;
}

.auth-social__btn:hover {
    background: #f0f7ff;
    box-shadow: 0 2px 8px rgba(13, 93, 181, 0.1);
    color: #374151;
}

.auth-social__btn--facebook {
    background: #1877f2;
    border-color: #1877f2;
    color: #fff;
}

.auth-social__btn--facebook:hover {
    background: #0c5fd6;
    border-color: #0c5fd6;
    color: #fff;
    box-shadow: 0 2px 8px rgba(24, 119, 242, 0.35);
}

.auth-social__icon { flex-shrink: 0; }

.auth-social__divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
    color: #9ca3af;
    font-size: 13px;
}

.auth-social__divider::before,
.auth-social__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e8f4fd;
}

/* ── Form ────────────────────────────────────────────────── */
.auth-register__form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-register__field { position: relative; }

/* Input */
.auth-register__input {
    width: 100%;
    height: 48px;
    border: 1.5px solid #c5d8f0;
    border-radius: 12px;
    padding: 0 14px;
    font-size: 14px;
    color: #374151;
    background: #f8fbff;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.auth-register__input:focus {
    border-color: #29b6f6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(41, 182, 246, 0.12);
}

.auth-register__input::placeholder { color: #9ca3af; }

.auth-register__input.is-error { border-color: #e53935; }

/* Password field */
.auth-register__field--password .auth-register__input { padding-right: 46px; }

.auth-register__toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    color: #9ca3af;
    line-height: 1;
    transition: color 0.15s;
}

.auth-register__toggle-password:hover { color: #0d5db5; }

/* Verify field */
.auth-register__field--verify { display: flex; }

.auth-register__input--verify {
    border-radius: 12px 0 0 12px;
    border-right: none;
    flex: 1;
}

.auth-register__send-code {
    width: 120px;
    height: 48px;
    border: none;
    background: #0d5db5;
    color: #fff;
    border-radius: 0 12px 12px 0;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
    flex-shrink: 0;
}

.auth-register__send-code:hover { background: #0a4d9b; }

.auth-register__send-code:disabled { opacity: 0.6; cursor: not-allowed; }

/* Submit button — RED */
.auth-register__submit {
    height: 48px;
    border: none;
    border-radius: 12px;
    background: #e53935;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 4px 16px rgba(229, 57, 53, 0.35);
    transition: background 0.2s, transform 0.2s;
    margin-top: 4px;
}

.auth-register__submit:hover {
    background: #c62828;
    transform: translateY(-1px);
}

/* Links */
.auth-register__links {
    margin-top: 14px;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    flex-wrap: wrap;
    gap: 6px;
}

.auth-register__links a {
    color: #0d5db5;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.15s, text-decoration-color 0.15s;
    text-underline-offset: 3px;
}

.auth-register__links a:hover {
    color: #0d5db5;
    text-decoration: underline;
    text-decoration-color: #0d5db5;
}

.auth-register__link-btn {
    /* reset global button styles từ style.css */
    display: inline !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    /* custom */
    color: #0d5db5 !important;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    text-underline-offset: 3px;
    transition: color 0.15s, text-decoration-color 0.15s;
}

.auth-register__link-btn:hover {
    background: transparent !important;
    color: #0d5db5 !important;
    text-decoration: underline !important;
    text-decoration-color: #0d5db5 !important;
    transform: none !important;
    box-shadow: none !important;
}

/* ── Alerts ──────────────────────────────────────────────── */
.auth-register__alert {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    text-align: left;
    line-height: 1.6;
}

.auth-register__alert--error {
    background: #fdecea;
    border: 1px solid #f9baba;
    color: #c62828;
}

.auth-register__alert--success {
    background: #e8f4fd;
    border: 1px solid #c5d8f0;
    color: #0a2d6e;
}

.auth-register__error {
    margin: 4px 0 0;
    font-size: 13px;
    color: #e53935;
    text-align: left;
}

/* Field status (AJAX) */
.auth-register__status {
    margin-top: 4px;
    font-size: 13px;
    text-align: left;
    min-height: 18px;
}

.auth-register__status.is-checking { color: #5a6a8a; }
.auth-register__status.is-success { color: #16a34a; }
.auth-register__status.is-error { color: #e53935; }

/* ── Password rules ──────────────────────────────────────── */
.auth-register__password-rules {
    margin-top: -2px;
    margin-bottom: 4px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #f0f7ff;
    border: 1px solid #c5d8f0;
    text-align: left;
}

.auth-register__password-rules-title {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    color: #0a2d6e;
}

.auth-register__password-rules-list {
    margin: 0;
    padding-left: 18px;
    color: #5a6a8a;
    font-size: 13px;
    line-height: 1.7;
}

/* ── Countdown ───────────────────────────────────────────── */
.auth-register__countdown {
    display: none;
    margin-top: -4px;
    margin-bottom: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #e8f4fd;
    border: 1px solid #c5d8f0;
    font-size: 13px;
    color: #0a2d6e;
    text-align: left;
    line-height: 1.5;
}

/* ── OTP Modal ───────────────────────────────────────────── */
.auth-register__otp-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    padding: 16px;
    background: rgba(10, 45, 110, 0.55);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.auth-register__otp-dialog {
    position: relative;
    width: min(100%, 430px);
    padding: 28px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 64px rgba(10, 45, 110, 0.3);
    animation: rtmOtpPopupIn 0.22s ease-out;
    text-align: left;
    border: 1px solid #c5d8f0;
}

.auth-register__otp-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #f0f7ff;
    color: #5a6a8a;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.auth-register__otp-close:hover { background: #e8f4fd; }

.auth-register__otp-icon {
    width: 58px;
    height: 58px;
    margin-bottom: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8f4fd, #c5d8f0);
    color: #0d5db5;
    font-size: 28px;
    font-weight: 700;
}

.auth-register__otp-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    padding: 5px 12px;
    border-radius: 999px;
    background: #e8f4fd;
    color: #0d5db5;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid #c5d8f0;
}

.auth-register__otp-title {
    margin: 0 0 10px;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.3;
    color: #0a2d6e;
}

.auth-register__otp-text {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.7;
    color: #5a6a8a;
}

.auth-register__otp-timer {
    margin: 0 0 18px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #e8f4fd;
    border: 1px solid #c5d8f0;
    color: #0a2d6e;
    font-size: 13px;
    line-height: 1.5;
}

.auth-register__otp-btn { margin-top: 0; }

@keyframes rtmOtpPopupIn {
    from { opacity: 0; transform: translateY(10px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Footer note ─────────────────────────────────────────── */
.auth-register__footer {
    margin-top: 20px;
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.7;
}

.auth-register__footer a {
    color: #29b6f6;
    font-weight: 600;
    text-decoration: none;
}

.auth-register__footer a:hover { color: #fff; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 767px) {
    .auth-register { padding: 36px 16px 48px; }
    .auth-register__box { padding: 24px 20px; border-radius: 18px; }
    .auth-register__heading { font-size: 22px; }
    .auth-register__otp-dialog { padding: 22px 18px; border-radius: 18px; }
    .auth-register__otp-title { font-size: 20px; }
}

/* ── Forgot password — step flow ─────────────────────────── */

/* Step 2: OTP code + new password — ẩn mặc định, JS sẽ show */
#rtm_forgot_code,
#rtm_forgot_new_password,
#rtm_forgot_confirm_password {
    display: none;
}

#rtm_forgot_code ~ .auth-register__field,
.auth-register__field:has(#rtm_forgot_code),
.auth-register__field:has(#rtm_forgot_new_password),
.auth-register__field:has(#rtm_forgot_confirm_password) {
    display: none;
}

/* Khi JS thêm class is-step-2 vào form → hiện step 2 */
#rtm-forgot-form.is-step-2 .auth-register__field:has(#rtm_forgot_code),
#rtm-forgot-form.is-step-2 .auth-register__field:has(#rtm_forgot_new_password),
#rtm-forgot-form.is-step-2 .auth-register__field:has(#rtm_forgot_confirm_password) {
    display: flex;
}

#rtm-forgot-form.is-step-2 #rtm_forgot_code,
#rtm-forgot-form.is-step-2 #rtm_forgot_new_password,
#rtm-forgot-form.is-step-2 #rtm_forgot_confirm_password {
    display: block;
}

/* Nút "Đổi mật khẩu bằng mã" — ẩn ở step 1 */
#rtm-forgot-reset-btn {
    display: none;
}

#rtm-forgot-form.is-step-2 #rtm-forgot-reset-btn {
    display: flex;
}

/* Nút "Gửi mã xác nhận" — ẩn ở step 2 */
#rtm-forgot-form.is-step-2 #rtm-forgot-send-code {
    display: none;
}

/* OTP input đặc biệt — center + tracking */
#rtm_forgot_code {
    text-align: center;
    letter-spacing: 0.3em;
    font-size: 22px;
    font-weight: 700;
    color: #0a2d6e;
}

/* Countdown box */
#rtm-forgot-countdown {
    font-size: 13px;
    color: #5a6a8a;
    text-align: center;
    padding: 8px 12px;
    background: #e8f4fd;
    border-radius: 8px;
    border: 1px solid #c5d8f0;
}

/* Separator label cho step 2 */
.auth-register__step-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #29b6f6;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 4px 0 -2px;
}

.auth-register__step-label::before,
.auth-register__step-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e8f4fd;
}