body.msr-login-page,
body.msr-auth-page {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(180deg, #2285ea 0%, #1f84e8 100%);
    color: #0f172a;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.msr-login-page *,
.msr-auth-page * {
    box-sizing: border-box;
}

.msr-login-shell,
.msr-auth-shell {
    min-height: 100vh;
    padding: 26px 30px 42px;
    display: flex;
    flex-direction: column;
}

.msr-login-brand,
.msr-auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 800;
}

.msr-login-brand img,
.msr-auth-brand img {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.12);
}

.msr-login-brand-text,
.msr-auth-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.msr-login-brand-text strong,
.msr-auth-brand-text strong {
    color: #ffffff;
    font-size: 1.04rem;
    line-height: 1.1;
}

.msr-login-brand-text span,
.msr-auth-brand-text span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.msr-login-main,
.msr-auth-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 26px;
}

.msr-login-title,
.msr-auth-title {
    margin: 0;
    color: #ffffff;
    font-size: clamp(3rem, 6vw, 4.2rem);
    font-weight: 400;
    letter-spacing: -0.05em;
}

.msr-login-card,
.msr-auth-card {
    position: relative;
    padding: 40px 40px 38px;
    border-radius: 38px;
    background: #ffffff;
    box-shadow: 0 24px 56px rgba(21, 62, 108, 0.16);
}

.msr-login-card {
    width: min(100%, 550px);
}

.msr-auth-card {
    width: min(100%, 560px);
}

.msr-auth-card.is-wide {
    width: min(100%, 920px);
}

.msr-login-close,
.msr-auth-close {
    position: absolute;
    top: 28px;
    right: 28px;
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    border: 2px solid #cfd7e3;
    color: #b4bcc8;
    text-decoration: none;
    font-size: 1.8rem;
    line-height: 1;
    transition: transform 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.msr-login-close:hover,
.msr-auth-close:hover {
    transform: translateY(-1px);
    color: #8e9cad;
    border-color: #b8c5d4;
}

.msr-login-secure-copy,
.msr-auth-secure-copy {
    margin: 0;
    text-align: center;
    color: #0f172a;
    font-size: 0.89rem;
    font-weight: 500;
}

.msr-login-pill,
.msr-auth-pill {
    width: fit-content;
    max-width: 100%;
    margin: 18px auto 0;
    padding: 11px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 999px;
    background: #f3f6fb;
    color: #0f172a;
    font-size: 0.94rem;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.msr-login-pill svg,
.msr-auth-pill svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    color: #16b364;
}

.msr-login-alerts,
.msr-auth-alerts {
    margin-top: 20px;
    display: grid;
    gap: 10px;
}

.msr-login-notice,
.msr-auth-notice {
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.6;
}

.msr-login-notice.is-error,
.msr-auth-notice.is-error {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #b42318;
}

.msr-login-notice.is-success,
.msr-auth-notice.is-success {
    background: #ecfdf3;
    border: 1px solid #abefc6;
    color: #067647;
}

.msr-login-form,
.msr-auth-form {
    margin-top: 22px;
    display: grid;
    gap: 18px;
}

.msr-login-field,
.msr-auth-field {
    display: grid;
    gap: 10px;
}

.msr-login-field label,
.msr-auth-field label,
.msr-auth-consent-title {
    margin-left: 14px;
    color: #1590f4;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.18s ease;
}

.msr-login-input-shell,
.msr-auth-control {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 58px;
    padding: 0 16px;
    border-radius: 14px;
    border: 2px solid #c9d2de;
    background: #ffffff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.msr-login-input-shell:focus-within,
.msr-auth-control:focus-within {
    border-color: #1590f4;
    box-shadow: 0 0 0 4px rgba(21, 144, 244, 0.11);
}

.msr-auth-control.is-textarea {
    min-height: 132px;
    padding-top: 14px;
    padding-bottom: 14px;
    align-items: flex-start;
}

.msr-login-field.is-valid label,
.msr-auth-field.is-valid label,
.msr-auth-consent.is-valid .msr-auth-consent-title {
    color: #2fbf12;
}

.msr-login-field.is-valid .msr-login-input-shell,
.msr-auth-field.is-valid .msr-auth-control,
.msr-auth-consent.is-valid {
    border-color: #2fd000;
    box-shadow: none;
}

.msr-login-field.is-valid .msr-login-input-shell:focus-within,
.msr-auth-field.is-valid .msr-auth-control:focus-within {
    border-color: #2fd000;
    box-shadow: 0 0 0 4px rgba(47, 208, 0, 0.11);
}

.msr-login-input-shell input,
.msr-auth-control input,
.msr-auth-control select,
.msr-auth-control textarea {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: #0f172a;
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
}

.msr-login-input-shell input::placeholder,
.msr-auth-control input::placeholder,
.msr-auth-control textarea::placeholder {
    color: #d1d5db;
    font-weight: 700;
}

.msr-auth-control textarea {
    min-height: 100px;
    resize: vertical;
}

.msr-auth-control select {
    appearance: none;
}

.msr-auth-control input[readonly] {
    color: #64748b;
    cursor: default;
}

.msr-login-input-shell input:-webkit-autofill,
.msr-login-input-shell input:-webkit-autofill:hover,
.msr-login-input-shell input:-webkit-autofill:focus,
.msr-login-input-shell input:-webkit-autofill:active,
.msr-auth-control input:-webkit-autofill,
.msr-auth-control input:-webkit-autofill:hover,
.msr-auth-control input:-webkit-autofill:focus,
.msr-auth-control input:-webkit-autofill:active,
.msr-auth-control textarea:-webkit-autofill,
.msr-auth-control textarea:-webkit-autofill:hover,
.msr-auth-control textarea:-webkit-autofill:focus,
.msr-auth-control textarea:-webkit-autofill:active {
    -webkit-text-fill-color: #0f172a;
    caret-color: #0f172a;
    border-radius: 8px;
    box-shadow: 0 0 0 1000px #ffffff inset;
    transition: background-color 9999s ease-out 0s, color 9999s ease-out 0s;
}

.msr-login-side-link,
.msr-auth-side-link {
    flex: 0 0 auto;
    color: #0092ff;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.msr-login-side-link:hover,
.msr-auth-side-link:hover,
.msr-auth-helper-btn:hover {
    text-decoration: underline;
}

.msr-login-check,
.msr-auth-check {
    display: none;
    width: 18px;
    height: 18px;
    place-items: center;
    color: #2fd000;
    font-size: 1rem;
    font-weight: 900;
    flex: 0 0 auto;
}

.msr-login-field.is-valid .msr-login-check,
.msr-auth-field.is-valid .msr-auth-check {
    display: inline-grid;
}

.msr-login-submit,
.msr-auth-submit {
    margin-top: 12px;
    width: 100%;
    min-height: 58px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, #dadada 0%, #d1d1d1 100%);
    color: #ffffff;
    cursor: not-allowed;
    font: inherit;
    font-size: 1rem;
    font-weight: 500;
    box-shadow: 0 16px 24px rgba(15, 23, 42, 0.12);
    transition: transform 0.18s ease, filter 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.msr-login-submit:not(:disabled):hover,
.msr-auth-submit:not(:disabled):hover {
    transform: translateY(-1px);
    filter: brightness(0.98);
}

.msr-login-submit:disabled,
.msr-auth-submit:disabled {
    opacity: 1;
}

.msr-login-submit.is-ready,
.msr-auth-submit.is-ready {
    background: linear-gradient(180deg, #2fe000 0%, #28d100 100%);
    cursor: pointer;
    box-shadow: 0 16px 28px rgba(47, 208, 0, 0.28);
}

.msr-login-footer,
.msr-auth-footer,
.msr-auth-helper-row {
    display: flex;
    justify-content: center;
}

.msr-login-register,
.msr-auth-switch {
    min-width: 170px;
    padding: 14px 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 999px;
    border: 3px solid rgba(255, 255, 255, 0.26);
    color: #ffffff;
    text-decoration: none;
    font-size: 0.98rem;
    font-weight: 500;
    backdrop-filter: blur(8px);
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.msr-auth-switch {
    min-width: 210px;
}

.msr-login-register:hover,
.msr-auth-switch:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.5);
}

.msr-login-register svg,
.msr-auth-switch svg {
    width: 22px;
    height: 22px;
}

.msr-auth-grid {
    display: grid;
    gap: 18px;
}

.msr-auth-grid.is-two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.msr-auth-consent-grid {
    display: grid;
    gap: 12px;
}

.msr-auth-consent {
    padding: 16px 18px;
    border: 2px solid #c9d2de;
    border-radius: 18px;
    background: #ffffff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.msr-auth-consent label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.msr-auth-consent input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    accent-color: #2fd000;
}

.msr-auth-consent span {
    color: #0f172a;
    font-size: 0.94rem;
    font-weight: 500;
    line-height: 1.6;
}

.msr-auth-consent a {
    color: #0092ff;
    font-weight: 800;
    text-decoration: none;
}

.msr-auth-footnote {
    margin: 8px 0 0;
    text-align: center;
    color: rgba(15, 23, 42, 0.68);
    font-size: 0.88rem;
    font-weight: 500;
}

.msr-auth-code-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.msr-auth-code-input {
    width: 100%;
    min-height: 58px;
    border-radius: 14px;
    border: 2px solid #c9d2de;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.msr-auth-code-input:focus {
    border-color: #1590f4;
    box-shadow: 0 0 0 4px rgba(21, 144, 244, 0.11);
}

.msr-auth-helper-btn {
    border: 0;
    background: transparent;
    color: #0092ff;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
}

html[dir="rtl"] .msr-auth-brand-text {
    text-align: right;
}

html[dir="rtl"] .msr-auth-close {
    right: auto;
    left: 28px;
}

html[dir="rtl"] .msr-auth-field label,
html[dir="rtl"] .msr-auth-consent-title {
    margin-left: 0;
    margin-right: 14px;
}

html[dir="rtl"] .msr-auth-control input:not([dir="ltr"]),
html[dir="rtl"] .msr-auth-control select,
html[dir="rtl"] .msr-auth-control textarea {
    text-align: right;
}

html[dir="rtl"] .msr-auth-helper-btn {
    letter-spacing: 0;
    text-transform: none;
}

[hidden] {
    display: none !important;
}

@media (max-width: 820px) {
    .msr-auth-grid.is-two-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .msr-login-shell,
    .msr-auth-shell {
        padding: 18px 16px 28px;
    }

    .msr-login-card,
    .msr-auth-card {
        padding: 30px 22px 28px;
        border-radius: 30px;
    }

    .msr-login-close,
    .msr-auth-close {
        top: 18px;
        right: 18px;
        width: 38px;
        height: 38px;
        font-size: 1.6rem;
    }

    .msr-login-main,
    .msr-auth-main {
        gap: 20px;
    }

    .msr-login-input-shell,
    .msr-auth-control:not(.is-textarea),
    .msr-auth-control {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        flex-wrap: nowrap;
        padding: 0 12px;
    }

    .msr-auth-control.is-textarea {
        padding: 14px 16px;
        align-items: flex-start;
        flex-wrap: nowrap;
    }

    .msr-login-side-link,
    .msr-auth-side-link {
        width: auto;
        white-space: nowrap;
        text-align: left;
        font-size: 0.76rem;
        order: 0;
    }

    .msr-login-check,
    .msr-auth-check {
        margin-left: 0;
        align-self: center;
    }

    .msr-auth-code-row {
        gap: 8px;
    }

    html[dir="rtl"] .msr-auth-close {
        right: auto;
        left: 18px;
    }
}
