/* Login / OTP pop-up */
body.auth-open { overflow: hidden; }

.auth-backdrop {
    position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1000; background: rgba(20, 8, 8, .65);
    display: flex; align-items: center; justify-content: center; padding: 16px;
    overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
    animation: authFade .2s ease;
}
.auth-backdrop[hidden] { display: none; }
.auth-dialog {
    position: relative; width: 100%; max-width: 460px; margin: auto;
    background: #fff; border-top: 6px solid var(--red); border-radius: 14px;
    padding: 34px 30px 28px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
    animation: authPop .25s ease;
}
/* Close icon sits on the pop-up's top-right corner: half outside, half inside */
.auth-close {
    /* position: absolute; top: -16px; right: -16px; */ z-index: 2; width: 36px; height: 36px; padding: 0;
    display: flex; align-items: center; justify-content: center; text-decoration: none;
    border-radius: 50%; background: #fff; color: #000; border: 2px solid #fff;
    font-size: 16px; line-height: 1; cursor: pointer; box-shadow: 0 3px 10px rgba(0, 0, 0, .4);

    position: relative;
    padding: 0.5rem 1rem;
    width: fit-content;
    border-radius: 0;
    height: auto;
    text-align: right;
    right: 0%;
    margin-left: auto;
    margin-bottom: 15px;
}
.auth-close:hover { background: #b9040f; color: #fff; }
.auth-step[hidden] { display: none; }
.auth-title {
    font-family: 'Roboto Condensed', 'Arial Narrow', sans-serif; font-weight: 700;
    text-transform: uppercase; font-size: 28px; text-align: center; margin-bottom: 20px;
}
.auth-label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.auth-sub { text-align: center; color: #555; font-size: 15px; margin-bottom: 18px; }
.nowrap { white-space: nowrap; }

.auth-input-group { display: flex; border: 1.5px solid #bbb; border-radius: 8px; overflow: hidden; background: #fff; }
.auth-input-group:focus-within, .auth-plain:focus, .otp-box:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(227, 6, 19, .15); outline: 0; }
.auth-prefix { padding: 12px 14px; background: #f3ece2; font-weight: 600; border-right: 1.5px solid #bbb; }
.auth-input-group input { flex: 1; min-width: 0; border: 0; padding: 12px 14px; font: inherit; font-size: 17px; outline: 0; }
.auth-input-group.is-invalid { border-color: #b42318; }
.auth-error-text { color: #b42318; font-size: 13px; min-height: 18px; margin-top: 4px; }

.auth-terms { display: flex; align-items: flex-start; gap: 10px; margin: 16px 0; font-size: 14px; line-height: 1.4; cursor: pointer; }
.auth-terms input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--red); cursor: pointer; }
.auth-terms a, .auth-link { color: var(--red); }
.auth-link { background: none; border: 0; font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; padding: 0 4px; }

.auth-btn { width: 100%; font-size: 20px; padding: 12px; border: 0; cursor: pointer; }
.auth-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.auth-msg { margin-top: 14px; padding: 10px 12px; border-radius: 6px; font-size: 14px; border-left: 4px solid; background: #fff; }
.auth-msg[hidden] { display: none; }
.auth-msg.is-error { border-color: #b42318; background: #fdeceb; color: #7a1710; }
.auth-msg.is-success { border-color: #0f6b3a; background: #e8f6ee; color: #0b4f2b; }

.otp-row { display: flex; justify-content: center; gap: 8px; margin-bottom: 18px; }
.otp-box {
    width: 46px; height: 54px; text-align: center; font-size: 22px; font-weight: 600;
    border: 1.5px solid #bbb; border-radius: 8px;
}
.auth-resend { text-align: center; margin-top: 14px; font-size: 14px; color: #555; }

@keyframes authFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes authPop { from { opacity: 0; transform: translateY(20px) scale(.96); } to { opacity: 1; transform: none; } }

@media (max-width: 480px) {
    .auth-dialog { padding: 30px 18px 22px; }
    .auth-title { font-size: 24px; }
    .otp-row { gap: 6px; }
    .otp-box { width: 40px; height: 48px; font-size: 20px; }
}

.result-dialog { text-align: center; max-width: 440px; }
.result-text { font-size: 20px; font-weight: 600; margin: 4px 0 6px; }

/* Captcha */
.auth-captcha { display: flex; align-items: center; gap: 10px; margin: 14px 0 8px; }
.auth-captcha img { display: block; max-width: calc(100% - 54px); height: auto; border: 1.5px solid #ddd; border-radius: 6px; background: #f5f5f0; }
.auth-captcha-refresh {
    flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid #ddd; background: #fff;
    color: var(--red); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.auth-captcha-refresh:hover { background: #fdf0df; }
.auth-plain {
    width: 100%; border: 1.5px solid #bbb; border-radius: 8px; padding: 12px 14px; font: inherit; font-size: 16px;
    text-transform: uppercase; letter-spacing: .12em;
}
.auth-plain::placeholder { text-transform: none; letter-spacing: normal; }
.auth-plain:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(227, 6, 19, .15); outline: 0; }
