body.auth-page {
    position: relative;
    overflow-x: hidden;
    --auth-input-padding-y: 0.55rem;
    --auth-input-padding-x: 0.95rem;
    --auth-input-font-size: 0.9rem;
    --auth-label-size: 0.875rem;
    --auth-field-gap: 0.85rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(36, 118, 182, 0.35) rgba(36, 118, 182, 0.06);
}

body.auth-page::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

body.auth-page::-webkit-scrollbar-track {
    background: rgba(36, 118, 182, 0.06);
    border-radius: 999px;
}

body.auth-page::-webkit-scrollbar-thumb {
    background: rgba(36, 118, 182, 0.32);
    border-radius: 999px;
    border: 1px solid transparent;
    background-clip: padding-box;
}

body.auth-page::-webkit-scrollbar-thumb:hover {
    background: rgba(36, 118, 182, 0.48);
    background-clip: padding-box;
}

body.auth-page #toast-container {
    position: absolute !important;
    top: 0.85rem !important;
    right: 0.85rem !important;
    left: auto !important;
    bottom: auto;
    padding: 0 !important;
    z-index: 4000;
    max-width: min(24rem, calc(100vw - 1.7rem));
    pointer-events: none;
}

body.auth-page #toast-container .toast-message {
    pointer-events: auto;
}

.auth-layout {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    min-height: calc(100vh - var(--legal-bar-height));
    height: calc(100vh - var(--legal-bar-height));
    background: #fff;
}

.auth-layout__form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    min-height: calc(100vh - var(--legal-bar-height));
    height: 100%;
    padding: 1.75rem 1.25rem;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    box-sizing: border-box;
}

.auth-layout__header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.auth-logo {
    display: block;
    max-width: 132px;
    height: auto;
    margin: 0 auto 0.75rem;
}

.auth-heading {
    color: var(--fsmm-primary);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0;
}

.auth-heading--page {
    font-size: 1.2rem;
    margin-top: 0.15rem;
}

.auth-lead {
    margin-top: 0.45rem;
    font-size: 0.88rem;
    line-height: 1.45;
    color: #64748b;
}

.auth-heading--register {
    font-size: 1.2rem;
}

.auth-subheading {
    color: var(--fsmm-primary);
    font-size: 1.05rem;
    font-weight: 500;
    margin-top: 0.35rem;
    margin-bottom: 0;
}

.auth-google-wrap {
    position: relative;
    margin-bottom: 0;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.58rem 0.9rem;
    border: 1px solid #dadce0;
    border-radius: 999px;
    background: #fff;
    color: #3c4043;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: not-allowed;
    opacity: 0.85;
}

.btn-google svg {
    flex-shrink: 0;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #6c757d;
    font-size: 0.85rem;
    margin: 0.75rem 0 var(--auth-field-gap);
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #dee2e6;
}

.auth-field,
.auth-gdpr {
    margin-bottom: var(--auth-field-gap);
}

.auth-field {
    overflow: visible;
}

.auth-field label,
.auth-field__label {
    display: block;
    font-size: var(--auth-label-size);
    font-weight: 500;
    margin-bottom: 0.3rem;
    color: #212529;
}

.auth-field .form-control {
    border-radius: 999px;
    padding: var(--auth-input-padding-y) var(--auth-input-padding-x);
    font-size: var(--auth-input-font-size);
    line-height: 1.35;
    border-color: #ced4da;
}

.auth-field .form-control:focus {
    border-color: var(--fsmm-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--fsmm-primary-rgb), 0.15);
}

.auth-submit {
    width: 100%;
    border-radius: 999px;
    padding: 0.62rem 0.95rem;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 0;
}

.auth-gdpr {
    margin-top: 0;
}

.auth-gdpr .form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0;
}

.auth-gdpr .form-check-input {
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.auth-gdpr .form-check-label {
    font-size: 0.72rem;
    line-height: 1.45;
    color: #495057;
}

.auth-gdpr__link {
    color: var(--fsmm-primary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-gdpr__link:hover {
    color: #1d6196;
}

.auth-gdpr .form-check-input:checked {
    background-color: var(--fsmm-primary);
    border-color: var(--fsmm-primary);
}

.auth-gdpr .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--fsmm-primary-rgb), 0.15);
}

.auth-alt {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 0.85rem;
}

.auth-divider--alt {
    margin: 0.7rem 0;
}

.btn.auth-alt-btn {
    width: 100%;
    border-radius: 999px;
    padding: 0.62rem 0.95rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.btn.auth-alt-btn:hover,
.btn.auth-alt-btn:focus-visible {
    color: #fff;
    text-decoration: none;
}

.btn.auth-alt-btn--reset {
    background: #ef8712;
    border-color: #ef8712;
}

.btn.auth-alt-btn--reset:hover,
.btn.auth-alt-btn--reset:focus-visible {
    background: #dc760c;
    border-color: #dc760c;
}

.btn.auth-alt-btn--register {
    background: #2ebd68;
    border-color: #2ebd68;
}

.btn.auth-alt-btn--register:hover,
.btn.auth-alt-btn--register:focus-visible {
    background: #249a56;
    border-color: #249a56;
}

.auth-footer {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #495057;
    text-align: center;
}

.auth-footer a {
    color: var(--fsmm-primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%);
    background: #212529;
    color: #fff;
    font-size: 0.8125rem;
    padding: 0.4rem 0.75rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 10;
}

.auth-tooltip.is-visible {
    opacity: 1;
}

.auth-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #212529;
}

.auth-layout__hero {
    --shape-size: 182px;
    --shape-gap-x: 2.25rem;
    --shape-gap-y: 1.85rem;
    display: none;
    align-items: center;
    justify-content: center;
    height: calc(100vh - var(--legal-bar-height));
    max-height: calc(100vh - var(--legal-bar-height));
    overflow: hidden;
    background: #fff;
}

.auth-hero__columns {
    display: flex;
    gap: var(--shape-gap-x);
    align-items: flex-start;
    justify-content: center;
}

.auth-hero__column {
    display: flex;
    flex-direction: column;
    gap: var(--shape-gap-y);
    flex: 0 0 var(--shape-size);
    width: var(--shape-size);
}

.auth-hero__column--offset {
    padding-top: calc(var(--shape-size) * 0.55);
}

.auth-hero__column--offset-sm {
    padding-top: calc(var(--shape-size) * 0.2);
}

.auth-hero__shape {
    flex: 0 0 auto;
    width: var(--shape-size);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.auth-hero__shape--circle {
    height: var(--shape-size);
    border-radius: 50%;
}

.auth-hero__shape--pill {
    height: calc(var(--shape-size) * 2.35);
    border-radius: 999px;
}

@media (min-width: 992px) {
    .auth-layout {
        grid-template-columns: 1fr 1fr;
    }

    .auth-layout__form {
        justify-self: center;
        align-self: stretch;
        padding: 1.5rem 2rem;
    }

    .auth-layout__hero {
        display: flex;
    }

    .auth-layout--login.auth-layout--login-notice {
        grid-template-columns: minmax(20rem, 1fr) 19rem minmax(20rem, 0.95fr);
        align-items: center;
    }

    .auth-layout--login.auth-layout--login-notice .auth-layout__form {
        grid-column: 1;
        justify-self: center;
    }

    .auth-layout--login .legacy-panel-alert {
        grid-column: 2;
        grid-row: 1;
        position: static;
        transform: none;
        width: 100%;
        max-width: 19rem;
        margin: 0 auto;
        align-self: center;
    }

    .auth-layout--login.auth-layout--login-notice .auth-layout__hero {
        --shape-size: 132px;
        --shape-gap-x: 1.25rem;
        --shape-gap-y: 1.35rem;
        grid-column: 3;
        grid-row: 1;
        justify-content: flex-end;
        padding-right: 1.25rem;
    }

    .auth-layout--login.auth-layout--login-notice .auth-hero__column--offset-sm {
        display: none;
    }

    body.auth-page--register,
    body.auth-page--register .auth-layout--register {
        grid-template-columns: 1fr;
        justify-items: center;
        height: calc(100vh - var(--legal-bar-height));
        max-height: calc(100vh - var(--legal-bar-height));
        overflow: hidden;
    }

    body.auth-page--register .auth-footer {
        margin-top: 0.85rem;
    }
}

@media (min-width: 1200px) {
    .auth-layout__hero {
        --shape-size: 200px;
        --shape-gap-x: 2.5rem;
        --shape-gap-y: 2rem;
    }
}

.auth-password-rules {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 0.65rem;
    margin: 0.5rem 0 1.35rem;
}

.auth-password-rules__item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 500;
    color: #adb5bd;
    transition: color 0.15s ease;
}

.auth-password-rules__icon {
    flex-shrink: 0;
    font-size: 0.78rem;
    color: #ced4da;
    transition: color 0.15s ease;
}

.auth-password-rules__item.is-valid {
    color: #198754;
}

.auth-password-rules__item.is-valid .auth-password-rules__icon {
    color: #198754;
}

.auth-password-rules--compact {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.28rem 0.65rem;
    margin: -0.25rem 0 0.5rem;
}

body.auth-page--register {
    --auth-field-gap: 0.7rem;
    --auth-input-padding-y: 0.5rem;
    --auth-input-padding-x: 0.95rem;
    --auth-input-font-size: 0.9rem;
    --auth-label-size: 0.84rem;
}

body.auth-page--register .auth-layout {
    grid-template-columns: 1fr;
    justify-items: center;
}

body.auth-page--register .auth-layout__form {
    justify-content: flex-start;
    min-height: auto;
    height: auto;
    max-width: 100%;
    padding: 0;
}

body.auth-page--register .auth-layout__register-header {
    margin-bottom: 1.15rem;
}

body.auth-page--register .auth-layout__hero {
    display: none;
}

body.auth-page--register .auth-field label,
body.auth-page--register .auth-field__label {
    margin-bottom: 0.18rem;
}

body.auth-page--register .form-text {
    margin-top: 0.18rem;
    font-size: 0.72rem;
    line-height: 1.3;
}

body.auth-page--register textarea.form-control {
    min-height: 0;
    border-radius: 1rem;
    resize: vertical;
}

body.auth-page--register .auth-password-rules--compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.2rem 0.4rem;
    margin: 0.1rem 0 0.35rem;
}

body.auth-page--register .auth-submit {
    padding: 0.52rem 0.9rem;
    margin-top: 0.15rem;
}

body.auth-page--register .auth-footer {
    margin-top: 0.55rem;
}

body.auth-page--register .auth-gdpr .form-check-label {
    font-size: 0.68rem;
    line-height: 1.4;
}

body.auth-page--register .auth-gdpr .form-check-input {
    margin-top: 0.12rem;
}

.auth-field--account-type {
    margin-bottom: var(--auth-field-gap);
}

.auth-account-type-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.42rem 0.72rem;
    border: 1px solid #ced4da;
    border-radius: 999px;
    background: #f8fafc;
}

.auth-account-type-switch__label {
    flex: 1 1 0;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.25;
    color: #6c757d;
    text-align: center;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease;
}

.auth-account-type-switch__label--left {
    text-align: right;
}

.auth-account-type-switch__label--right {
    text-align: left;
}

.auth-account-type-switch__label.is-active {
    color: var(--fsmm-primary, #2476b6);
}

.auth-account-type-switch__control {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    min-height: 0;
}

.auth-account-type-switch__control .form-check-input {
    width: 2.4rem;
    height: 1.22rem;
    margin: 0;
    cursor: pointer;
}

.auth-account-type-switch__control .form-check-input:checked {
    background-color: var(--fsmm-primary, #2476b6);
    border-color: var(--fsmm-primary, #2476b6);
}

.auth-account-type-switch__control .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--fsmm-primary-rgb), 0.15);
}

.auth-password-field {
    position: relative;
    overflow: visible;
}

.auth-password-field__input {
    padding-right: 7.75rem;
}

.auth-password-field__tools {
    position: absolute;
    top: 50%;
    right: 0.35rem;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 0.1rem;
    overflow: visible;
    z-index: 2;
}

.auth-password-tool-wrap {
    position: relative;
    overflow: visible;
}

.auth-password-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #6c757d;
    font-size: 0.92rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.auth-password-tool-btn:hover,
.auth-password-tool-btn:focus-visible {
    color: var(--fsmm-primary);
    background: rgba(var(--fsmm-primary-rgb), 0.08);
}

.auth-password-tool-wrap .auth-tooltip {
    left: 50%;
    right: auto;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: 20;
}

.auth-password-tool-wrap .auth-tooltip::after {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}

body.auth-page--register .auth-layout__form {
    position: relative;
}

.legacy-panel-alert {
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: calc(100% - 2.5rem);
    max-width: 22.5rem;
    margin: 0 auto 1.5rem;
    padding: 1.45rem 1.4rem 1.35rem;
    background: #fff;
    border-radius: 1.35rem;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
}

.legacy-panel-alert__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.1rem;
    height: 3.1rem;
    margin-bottom: 0.95rem;
    border-radius: 999px;
    background: rgba(var(--fsmm-accent-rgb), 0.12);
    color: var(--fsmm-accent);
}

.legacy-panel-alert__icon svg {
    width: 1.7rem;
    height: 1.7rem;
}

.legacy-panel-alert__title {
    margin: 0 0 0.45rem;
    color: #1a1d21;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.02em;
}

.legacy-panel-alert__text {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.45;
}

.legacy-panel-alert__text + .legacy-panel-alert__text {
    margin-top: 0.45rem;
}

.legacy-panel-alert__when {
    color: var(--fsmm-accent);
    font-weight: 700;
}

.legacy-panel-alert__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.62rem 1rem;
    border: 1.5px solid var(--fsmm-accent);
    border-radius: 999px;
    background: #fff;
    color: var(--fsmm-accent);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
}

.legacy-panel-alert__button:hover {
    background: rgba(var(--fsmm-accent-rgb), 0.08);
    color: var(--fsmm-accent);
}

@media (max-width: 991.98px) {
    body.auth-page--login {
        overflow-y: auto;
    }

    .auth-layout--login {
        display: flex;
        flex-direction: column;
        justify-content: center;
        height: auto;
        min-height: calc(100vh - var(--legal-bar-height));
        padding: 1rem 0;
    }

    .auth-layout--login .auth-layout__form {
        flex: 0 0 auto;
        min-height: 0;
        height: auto;
        padding-top: 0.5rem;
        padding-bottom: 0;
    }

    .auth-layout--login .legacy-panel-alert {
        flex: 0 0 auto;
        margin: 0.75rem auto 0;
    }
}

.phone-prefix,
.auth-phone-prefix {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.phone-prefix__code,
.auth-phone-prefix__code {
    display: inline-flex;
    align-items: center;
    padding: 0 0.75rem;
    border: 1px solid #d7e3ee;
    border-right: 0;
    border-radius: 0.5rem 0 0 0.5rem;
    background: #f4f8fb;
    color: #334155;
    font-weight: 600;
    white-space: nowrap;
}

.phone-prefix .form-control,
.auth-phone-prefix .form-control {
    border-radius: 0 0.5rem 0.5rem 0;
}
