/* First-time login / change password modal */
#first_time_login .modal-dialog.modal-lg {
    max-width: 792px;
}

.first-time-pw-modal {
    border: 0;
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    position: relative;
    background: #fff;
}

/* Forgot-password page: same card inside login layout (override .center_left form rules) */
.center_left > .first-time-pw-modal {
    width: 100%;
    max-width: 792px;
}

.center_left .first-time-pw-modal form.login_data {
    width: 100%;
    max-width: none;
    gap: 0;
    align-items: stretch;
}

.center_left .first-time-pw-modal .first-time-pw-field .form-control {
    padding: 1.1rem 2.75rem 0.45rem 2.75rem;
    height: 55px;
    border-radius: 10px;
    border: 1px solid #d7dee8;
    color: #1f2937;
}

.center_left .first-time-pw-modal .first-time-pw-field label {
    color: #8a97a8;
    font-size: 0.95rem;
    font-weight: 400;
}

.center_left .first-time-pw-modal .first-time-pw-field .form-control:focus ~ label,
.center_left .first-time-pw-modal .first-time-pw-field .form-control:not(:placeholder-shown) ~ label {
    font-size: 0.72rem;
    color: #6b7c93;
}

.center_left .first-time-pw-modal .first-time-pw-btn-submit,
.center_left .first-time-pw-modal .first-time-pw-btn-cancel {
    width: auto;
}

.center_left .first-time-pw-modal .first-time-pw-btn-submit {
    background: #1a73ea;
    padding: 0.55rem 1.1rem;
}

.center_left .first-time-pw-modal .first-time-pw-btn-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.left_login .first-time-pw-lock {
    width: 56px;
    height: 56px;
}

.left_login .first-time-pw-requirements-icon {
    width: 30px;
    height: 30px;
}

.first-time-pw-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    opacity: 0.55;
}

.first-time-pw-modal .modal-body {
    padding: 1.75rem 1.75rem 0.75rem;
}

.first-time-pw-header {
    display: flex;
    align-items: flex-start;
    gap: 0.95rem;
    margin-bottom: 1.25rem;
    padding-right: 1.5rem;
}

.first-time-pw-lock {
    width: 56px;
    height: 56px;
    object-fit: contain;
    flex-shrink: 0;
}

.first-time-pw-title {
    color: #1e3a5f;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0.15rem 0 0.4rem;
}

.first-time-pw-intro {
    color: #6b7c93;
    font-size: 0.95rem;
    line-height: 1.45;
}

.first-time-pw-requirements {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #f5f9ff;
    border-radius: 14px;
    padding: 1.1rem 1.2rem;
    margin-bottom: 1.35rem;
}

.first-time-pw-requirements-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
    flex-shrink: 0;
}

.first-time-pw-requirements-divider {
    width: 1px;
    align-self: stretch;
    min-height: 72px;
    background: #9eb6d8;
    flex-shrink: 0;
}

.first-time-pw-checklist {
    display: grid;
    gap: 0.55rem;
    flex: 1;
    min-width: 0;
}

.first-time-pw-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #4b5b70;
    font-size: 0.95rem;
    line-height: 1.3;
    transition: color 0.2s ease;
}

.first-time-pw-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: transparent;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.first-time-pw-icon i {
    font-size: 0.9rem;
    color: #a0adbe;
    font-weight: 700;
    transition: color 0.2s ease, transform 0.2s ease;
}

.first-time-pw-item.is-valid {
    color: #122033;
    font-weight: 600;
}

.first-time-pw-item.is-valid .first-time-pw-icon {
    background: #dcfce7;
    box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.18);
}

.first-time-pw-item.is-valid .first-time-pw-icon i {
    color: #15803d;
    transform: scale(1.15);
}

.first-time-pw-fields {
    display: grid;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.first-time-pw-field {
    position: relative;
}

.first-time-pw-field .form-control {
    height: 55px;
    border: 1px solid #d7dee8;
    border-radius: 10px;
    padding: 1.1rem 2.75rem 0.45rem 2.75rem;
    font-size: 0.98rem;
    color: #1f2937;
    background: #fff;
    box-shadow: none;
}

.first-time-pw-field .form-control:focus {
    border-color: #1a73ea;
    box-shadow: 0 0 0 0.2rem rgba(26, 115, 234, 0.12);
}

.first-time-pw-field label {
    position: absolute;
    left: 2.75rem;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    color: #8a97a8;
    font-size: 0.95rem;
    pointer-events: none;
    background: transparent;
    transition: all 0.15s ease;
}

.first-time-pw-field .form-control:focus ~ label,
.first-time-pw-field .form-control:not(:placeholder-shown) ~ label {
    top: 0.45rem;
    transform: none;
    font-size: 0.72rem;
    color: #6b7c93;
}

.first-time-pw-field-lock,
.first-time-pw-eye {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa6b5;
    z-index: 2;
}

.first-time-pw-field-lock {
    left: 1rem;
    font-size: 1rem;
    pointer-events: none;
}

.first-time-pw-eye {
    right: 0.95rem;
    font-size: 1rem;
    cursor: pointer;
}

.first-time-pw-match {
    min-height: 1.15rem;
}

.first-time-pw-match.is-match {
    color: #16a34a;
}

.first-time-pw-match.is-mismatch {
    color: #dc2626;
}

.first-time-pw-footer {
    border: 0;
    padding: 0.5rem 1.75rem 1.5rem;
    gap: 0.65rem;
    justify-content: flex-end;
}

.first-time-pw-btn-cancel {
    min-width: 110px;
    border: 1px solid #d7dee8;
    background: #fff;
    color: #334155;
    border-radius: 8px;
    padding: 0.55rem 1rem;
    font-weight: 500;
}

.first-time-pw-btn-cancel:hover {
    background: #f8fafc;
    border-color: #c5cedb;
    color: #1f2937;
}

.first-time-pw-btn-submit {
    min-width: 110px;
    border: 0;
    background: #1a73ea;
    color: #fff;
    border-radius: 8px;
    padding: 0.55rem 1.1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.first-time-pw-btn-submit:hover {
    background: #1558c0;
    color: #fff;
}

@media (max-width: 575.98px) {
    .first-time-pw-modal .modal-body {
        padding: 1.35rem 1.1rem 0.5rem;
    }

    .first-time-pw-footer {
        padding: 0.35rem 1.1rem 1.2rem;
    }

    .first-time-pw-requirements {
        gap: 0.8rem;
        padding: 0.9rem;
    }

    .first-time-pw-requirements-icon {
        width: 40px;
        height: 40px;
    }

    .first-time-pw-requirements-divider {
        min-height: 64px;
    }

    .first-time-pw-lock {
        width: 46px;
        height: 46px;
    }
}

/* Two-factor auth modal (#two_factor_auth) */
#two_factor_auth .tfa-modal-dialog {
    max-width: 520px;
}

.tfa-modal {
    border: 0;
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    position: relative;
}

.tfa-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    opacity: 0.45;
}

.tfa-modal-close:hover {
    opacity: 0.75;
}

.tfa-modal-body {
    padding: 1.75rem 1.75rem 1.5rem;
}

.tfa-hero {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.85rem;
    margin: 0.25rem auto 1rem;
}

.tfa-hero-shield {
    width: 88px;
    height: 88px;
    object-fit: contain;
    flex-shrink: 0;
}

.tfa-hero-dots {
    width: calc(88px * 0.7);
    height: calc(88px * 0.7);
    object-fit: contain;
    flex-shrink: 0;
    opacity: 0.85;
}

.tfa-title {
    color: #1e293b;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 0.45rem;
    text-align: center;
}

.tfa-subtitle {
    color: #6b7c93;
    font-size: 0.95rem;
    line-height: 1.45;
    margin: 0 auto 1.15rem;
    max-width: 26rem;
    text-align: center;
}

.tfa-divider {
    height: 1px;
    background: #e6ebf2;
    margin: 0 0 1.15rem;
}

.tfa-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #1e293b;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.65rem;
}

.tfa-label-shield {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex-shrink: 0;
}

.tfa-code-field {
    position: relative;
    margin-bottom: 0.85rem;
}

.tfa-code-input {
    height: 54px;
    border: 1.5px solid #b7d0f5;
    border-radius: 10px;
    padding: 0.75rem 2.85rem 0.75rem 1rem;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-align: left;
    color: #1f2937;
    background: #fff;
    box-shadow: none;
}

.tfa-code-input::placeholder {
    color: #94a3b8;
    letter-spacing: 0.35em;
    font-weight: 500;
}

.tfa-code-input:focus {
    border-color: #1a73ea;
    box-shadow: 0 0 0 0.2rem rgba(26, 115, 234, 0.12);
}

.tfa-code-check {
    position: absolute;
    top: 50%;
    right: 0.95rem;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    object-fit: contain;
    pointer-events: none;
}

.tfa-forgot {
    margin-bottom: 1.15rem;
    text-align: center;
}

.tfa-forgot p {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #1a73ea;
    font-size: 0.92rem;
    font-weight: 500;
}

.tfa-forgot i {
    font-size: 0.95rem;
}

.tfa-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    text-align: left;
}

.tfa-footer-hint {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #6b7c93;
    font-size: 0.82rem;
    line-height: 1.35;
    flex: 1;
    min-width: 0;
}

.tfa-phone-badge {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
}

.tfa-footer-sep {
    width: 1px;
    align-self: stretch;
    min-height: 36px;
    background: #d7dee8;
    flex-shrink: 0;
}

.tfa-login-btn {
    border: 0;
    background: #1a73ea;
    color: #fff;
    border-radius: 10px;
    padding: 0.7rem 1.15rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.tfa-login-btn:hover,
.tfa-login-btn:focus {
    background: #1558c0;
    color: #fff;
}

.tfa-login-lock {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

@media (max-width: 575.98px) {
    .tfa-modal-body {
        padding: 1.35rem 1.1rem 1.2rem;
    }

    .tfa-hero {
        gap: 0.55rem;
    }

    .tfa-hero-shield {
        width: 72px;
        height: 72px;
    }

    .tfa-hero-dots {
        width: calc(72px * 0.7);
        height: calc(72px * 0.7);
    }

    .tfa-title {
        font-size: 1.15rem;
    }

    .tfa-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .tfa-footer-sep {
        display: none;
    }

    .tfa-login-btn {
        width: 100%;
    }
}

/* Reset password: left image only, right white form */
.login.login-reset {
    background: #fff;
}

.login.login-reset .reset-image-panel {
    position: relative;
    flex: 0 0 60%;
    width: 60%;
    height: 100vh;
    overflow: hidden;
    background: #0f172a;
}

.login.login-reset .reset-image-panel__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.login.login-reset .reset-image-panel__bg.is-missing {
    display: none;
}

.login.login-reset .reset-form-panel {
    flex: 0 0 40%;
    width: 40%;
    height: 100vh;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 28px;
}

.login.login-reset .reset-form-panel__inner {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 70vh;
}

.login.login-reset .reset-password-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
}

.login.login-reset .reset-password-form h1 {
    margin-bottom: 0;
    font-size: 26px;
    color: #1f2937;
}

.login.login-reset .reset-password-form > p {
    margin-bottom: 0.35rem;
    color: rgba(138, 138, 138, 1);
    font-size: 14px;
}

.login.login-reset .reset-password-form label {
    color: rgba(61, 61, 61, 1);
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 0;
}

.login.login-reset .reset-password-form .form-control {
    padding: 10px;
    color: rgba(138, 138, 138, 1);
    border-radius: 8px;
    border: 1px solid rgba(230, 230, 230, 1);
    box-shadow: none;
}

.login.login-reset .reset-password-form .input-group-text {
    border-radius: 0 8px 8px 0;
    border: 1px solid rgba(230, 230, 230, 1);
    background: #fff;
}

.login.login-reset .reset-submit-btn {
    background-color: var(--primaryNavy, rgba(26, 115, 234, 1));
    width: 100%;
    padding: 12px 10px;
    color: #fff;
    border: none;
    outline: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    margin-top: 8px;
    transition: background-color 0.15s ease;
}

.login.login-reset .reset-submit-btn:hover,
.login.login-reset .reset-submit-btn:focus {
    background-color: #1558c0;
    color: #fff;
}

.login.login-reset .login-secure-access {
    margin-top: auto;
}

/* Reset page: first-time-pw form in narrow panel (keep cyberlastimage) */
.login.login-reset .reset-form-panel {
    overflow-y: auto;
}

.login.login-reset .first-time-pw-modal {
    width: 100%;
    max-width: 100%;
    box-shadow: none;
    border-radius: 0;
}

.login.login-reset .first-time-pw-modal .modal-body {
    padding: 0 0 0.75rem;
}

.login.login-reset .first-time-pw-footer {
    padding: 0.5rem 0 0;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.login.login-reset .first-time-pw-btn-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.login.login-reset .first-time-pw-header {
    padding-right: 0;
}

.login.login-reset .first-time-pw-requirements {
    flex-direction: column;
    align-items: flex-start;
}

.login.login-reset .first-time-pw-requirements-divider {
    display: none;
}

.login.login-reset .first-time-pw-item {
    align-items: flex-start;
}

.login.login-reset .first-time-pw-label {
    font-size: 0.85rem;
}

.login .login-secure-access-meta {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55em;
}

.login .login-secure-access-copy {
    color: inherit;
}

.login .login-legal-links {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    color: var(--primaryNavy, #1a73ea);
    font-size: inherit;
    line-height: inherit;
    white-space: nowrap;
}

.login .login-legal-links a {
    color: var(--primaryNavy, #1a73ea);
    text-decoration: none;
    font-weight: 500;
}

.login .login-legal-links a:hover,
.login .login-legal-links a:focus {
    color: #1558c0;
    text-decoration: underline;
}

.login .login-legal-sep {
    margin: 0 0.35em;
    color: var(--primaryNavy, #1a73ea);
    opacity: 0.55;
}

@media screen and (max-width: 850px) {
    .login.login-reset {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .login.login-reset .reset-image-panel {
        width: 100%;
        height: 220px;
        flex: 0 0 auto;
        order: 1;
    }

    .login.login-reset .reset-form-panel {
        width: 100%;
        height: auto;
        min-height: calc(100vh - 220px);
        flex: 1 1 auto;
        order: 2;
        padding: 36px 24px 28px;
    }

    .login.login-reset .reset-form-panel__inner {
        min-height: 0;
    }
}

@media screen and (max-width: 600px) {
    .login.login-reset .reset-image-panel {
        height: 160px;
    }

    .login.login-reset .reset-form-panel {
        min-height: calc(100vh - 160px);
        padding: 28px 18px 24px;
    }
}

/* Mobile login: stack panels without overlapping (negative margins in custom.css) */
@media screen and (max-width: 850px) {
    .login {
        flex-direction: column;
        align-items: stretch;
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .login .left_login,
    .login .right_login {
        position: relative;
        width: 100%;
        height: auto;
        min-height: 0;
        margin-top: 0;
    }

    .login .right_login {
        order: 2;
        min-height: 0;
        padding-bottom: 0;
        flex-shrink: 0;
    }

    .login .left_login {
        order: 1;
        z-index: 1;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
        background-color: #fff;
        padding: 40px 28px 32px;
    }

    .login .right_login_bg_img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .login .right_login_content {
        position: relative;
        z-index: 1;
        height: auto;
        min-height: 0;
        padding: 32px 24px 28px;
    }

    .login .center_left form {
        width: 100%;
        max-width: 500px;
    }
}

@media screen and (max-width: 600px) {
    .login .left_login {
        margin-top: 0;
        padding: 36px 20px 28px;
    }

    .login .right_login_content {
        padding: 28px 18px 24px;
    }

    .login .right_login_footer {
        flex-direction: column;
        gap: 12px;
    }
}
