/* ============================================================
   0724 Client Area — Login / Password Reset / Account Access (Phase 9)
   login | password-reset-* | two-factor-* | user-verify-email
   ============================================================ */

.cx-auth {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: 26.5rem;
    margin: 0.5rem auto 1.5rem;
    min-width: 0;
}

.cx-auth__panel {
    width: 100%;
    min-width: 0;
    padding: 1.35rem 1.35rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.cx-auth__panel--center,
.cx-auth__panel--center .cx-auth__header {
    text-align: center;
}

.cx-auth__brand {
    display: flex;
    justify-content: center;
    margin-bottom: 1.1rem;
}

.cx-auth__logo {
    display: block;
    width: auto;
    max-width: min(160px, 70vw);
    height: auto;
    max-height: 48px;
}

.cx-auth__header {
    margin-bottom: 1.1rem;
}

.cx-auth__title {
    margin: 0 0 0.35rem;
    color: var(--white);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.cx-auth__subtitle {
    margin: 0;
    color: var(--muted2);
    font-size: 0.92rem;
    line-height: 1.45;
}

.cx-auth__form {
    width: 100%;
}

.cx-auth .form-group {
    margin-bottom: 0.95rem;
}

.cx-auth label,
.cx-auth .form-control-label,
.cx-auth .control-label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--muted2);
    font-size: 0.82rem;
    font-weight: 550;
}

.cx-auth .form-control,
.cx-auth .form-control-lg {
    width: 100%;
    min-height: 2.6rem;
    padding: 0.55rem 0.85rem;
    background: var(--bg) !important;
    border: 1px solid var(--border-l) !important;
    border-radius: 10px !important;
    color: var(--text) !important;
    font-family: var(--sans);
    font-size: 0.95rem;
    box-shadow: none !important;
}

.cx-auth .form-control:focus,
.cx-auth .form-control-lg:focus {
    border-color: var(--cyan) !important;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.14) !important;
    color: var(--white) !important;
    outline: none;
}

.cx-auth .form-control::placeholder {
    color: var(--muted);
}

.cx-auth__pw-group {
    flex-wrap: nowrap;
    width: 100%;
}

.cx-auth__pw-group .form-control {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    min-width: 0;
}

.cx-auth__pw-group .input-group-append {
    flex: 0 0 auto;
}

.cx-auth__pw-group .btn-reveal-pw {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    height: 100%;
    min-height: 2.6rem;
    padding: 0 0.75rem;
    background: var(--surface2) !important;
    border: 1px solid var(--border-l) !important;
    border-left: 0 !important;
    border-radius: 0 10px 10px 0 !important;
    color: var(--muted2) !important;
    box-shadow: none !important;
}

.cx-auth__pw-group .btn-reveal-pw:hover,
.cx-auth__pw-group .btn-reveal-pw:focus-visible {
    color: var(--cyan) !important;
    outline: none;
    box-shadow: inset 0 0 0 1px var(--cyan-border) !important;
}

.cx-auth__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem 1rem;
    margin: 0.15rem 0 1.05rem;
}

.cx-auth__remember {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
}

.cx-auth__remember .form-check-input {
    margin: 0;
    position: static;
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
}

.cx-auth__forgot {
    color: var(--muted2);
    font-size: 0.88rem;
    text-decoration: none;
}

.cx-auth__forgot:hover,
.cx-auth__forgot:focus-visible {
    color: var(--cyan);
    outline: none;
}

.cx-auth .cx-btn--block,
.cx-auth button.cx-btn--block,
.cx-auth a.cx-btn--block {
    width: 100%;
}

.cx-auth__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.cx-auth__actions .cx-btn {
    flex: 1 1 auto;
}

.cx-auth__footer {
    margin: 1.05rem 0 0;
    color: var(--muted);
    font-size: 0.88rem;
    text-align: center;
    line-height: 1.45;
}

.cx-auth__footer a {
    color: var(--cyan);
    font-weight: 600;
    text-decoration: none;
}

.cx-auth__footer a:hover,
.cx-auth__footer a:focus-visible {
    text-decoration: underline;
    outline: none;
}

.cx-auth__captcha {
    margin: 0.25rem 0 0.95rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.cx-auth__captcha .recaptcha-container,
.cx-auth__captcha #google-recaptcha-domainchecker,
.cx-auth__captcha .g-recaptcha {
    max-width: 100%;
    overflow: hidden;
}

.cx-auth__captcha iframe {
    max-width: 100%;
}

.cx-auth__captcha #default-captcha-domainchecker,
.cx-auth__captcha .captchaimage img {
    max-width: 100%;
    height: auto;
}

.cx-auth__notice {
    width: 100%;
    margin: 0 0 0.25rem;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.cx-auth__notice--warning {
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.35);
    color: #ffc089;
}

.cx-auth .alert {
    margin-bottom: 1rem;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    border-width: 1px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.cx-auth .alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.35);
    color: #ffb4b4;
}

.cx-auth .alert-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.35);
    color: #9be7b5;
}

.cx-auth .alert-warning {
    background: rgba(249, 115, 22, 0.1);
    border-color: rgba(249, 115, 22, 0.35);
    color: #ffc089;
}

.cx-auth .alert-info {
    background: rgba(0, 212, 255, 0.08);
    border-color: var(--cyan-border);
    color: var(--text);
}

.cx-auth__success {
    margin: 0 0 1rem;
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.5;
}

.cx-auth__challenge {
    margin-bottom: 0.85rem;
    min-width: 0;
}

.cx-auth__challenge input,
.cx-auth__challenge .form-control {
    max-width: 100%;
}

.cx-auth__backup-code {
    margin: 0.75rem 0 1rem;
    padding: 0.85rem 1rem;
    background: var(--bg);
    border: 1px dashed var(--cyan-border);
    border-radius: 10px;
    color: var(--cyan);
    font-family: var(--mono);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: center;
    overflow-wrap: anywhere;
}

.cx-auth #passwordStrengthBar {
    height: 0.45rem;
    background: var(--surface2);
    border-radius: 999px;
    overflow: hidden;
}

.cx-auth .progress-bar {
    border-radius: 999px;
}

.cx-auth .providerPreLinking,
.cx-auth .social-signin-btns {
    width: 100%;
    margin-top: 0.25rem;
}

.cx-auth .social-signin-btns {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.cx-auth .social-signin-btns a,
.cx-auth .social-signin-btns button {
    max-width: 100%;
}

/* Tighten empty vertical space on auth pages inside the shell */
body.cx-app .primary-content:has(.cx-auth) {
    display: flex;
    justify-content: center;
}

@media (max-width: 767.98px) {
    .cx-auth {
        margin-top: 0.15rem;
        max-width: 100%;
    }

    .cx-auth__panel {
        padding: 1.15rem 1rem 1.25rem;
        border-radius: 12px;
    }

    .cx-auth__title {
        font-size: 1.22rem;
    }

    .cx-auth__row {
        flex-direction: column;
        align-items: flex-start;
    }

    .cx-auth__forgot {
        order: 2;
    }

    .cx-auth__actions .cx-btn,
    .cx-auth__actions input.cx-btn {
        width: 100%;
    }

    /* Keep visible reCAPTCHA within narrow viewports without clipping controls */
    .cx-auth__captcha .g-recaptcha {
        transform-origin: left top;
    }
}

@media (max-width: 389.98px) {
    .cx-auth__captcha .g-recaptcha > div {
        max-width: 100%;
    }

    .cx-auth__logo {
        max-height: 42px;
    }
}

@media (max-width: 360px) {
    .cx-auth__captcha {
        display: flex;
        justify-content: flex-start;
    }

    .cx-auth__captcha .g-recaptcha {
        transform: scale(0.92);
        transform-origin: 0 0;
    }
}

/* Focus visibility for native submit fallbacks inside challenge modules */
.cx-auth button:focus-visible,
.cx-auth a:focus-visible,
.cx-auth input:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}
