html,
body {
    box-sizing: border-box;
    display: block;
    width: 100%;
    height: auto;
    min-height: 100%;
    margin: 0;
}

.app-auth-page {
    display: block;
    width: 100%;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    vertical-align: initial;
    padding: 28px 16px;
    background:
        radial-gradient(ellipse at 50% 12%, rgba(255, 255, 255, .16), transparent 44%),
        linear-gradient(140deg, #716df1 0%, #625fe0 48%, #514fce 100%);
    color: #29364a;
    font-family: var(--app-font-family, 'Inter', Roboto, Arial, sans-serif);
}

.app-auth-page *,
.app-auth-page *::before,
.app-auth-page *::after {
    box-sizing: border-box;
}

.app-auth-layout {
    display: grid;
    min-height: calc(100vh - 56px);
    min-height: calc(100dvh - 56px);
    place-items: center;
}

.form.app-auth-card {
    position: relative;
    display: grid;
    width: min(100%, 440px) !important;
    margin: 38px auto 24px;
    padding: 62px 30px 28px;
    border: 1px solid rgba(226, 231, 240, .9);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(27, 30, 82, .25);
    color: #29364a;
    text-align: left;
}

.form.app-auth-card.app-auth-recovery-form {
    width: min(100%, 520px) !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 14px;
}

.app-auth-recovery-form > .app-auth-brand,
.app-auth-recovery-form > .app-auth-heading,
.app-auth-recovery-form > .app-auth-notice,
.app-auth-recovery-form > .app-auth-field {
    grid-column: 1 / -1;
}

.app-auth-recovery-form .app-auth-notice {
    margin: 0 0 20px;
    padding: 13px 15px;
    border: 1px solid #dfe5f2;
    border-radius: 10px;
    background: #f5f7fc;
    color: #536176;
    font-size: 13px;
    line-height: 1.65;
}

.app-auth-recovery-form .app-auth-secondary-action {
    display: grid;
    grid-column: 2;
    place-items: center;
    padding: 10px 14px;
    color: #46556a;
    text-align: center;
    text-decoration: none;
}

.app-auth-recovery-form > .app-auth-submit {
    grid-column: 1;
}

.app-auth-recovery-form > .app-auth-submit,
.app-auth-recovery-form > .app-auth-secondary-action {
    height: 46px;
    margin: 4px 0 0 !important;
}

.form.app-auth-card[hidden] {
    display: none !important;
}

.app-auth-login-form {
    grid-template-columns: minmax(0, 1fr);
}

.app-auth-login-form > br {
    display: none;
}

.app-auth-login-form > .app-auth-heading,
.app-auth-login-form > .app-auth-choice-group,
.app-auth-login-form > #company_select,
.app-auth-login-form > .app-auth-field,
.app-auth-login-form > .app-auth-submit,
.app-auth-login-form > .link,
.app-auth-login-form > .app-auth-secondary-action {
    grid-column: 1;
}

.app-auth-brand {
    position: absolute;
    top: -48px;
    left: 50%;
    display: grid;
    width: 88px;
    height: 88px;
    place-items: center;
    margin: 0;
    padding: 0;
    transform: translateX(-50%);
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.app-auth-login-form > .app-auth-brand {
    left: calc(50% - 15px);
}

.app-auth-brand a {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    overflow: visible;
    border-radius: 0;
}

.app-auth-brand img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0;
    background: transparent;
}

.app-auth-heading {
    margin: 0 0 22px;
    text-align: center;
}

.app-auth-heading .login-title {
    margin: 0 0 5px;
    color: #29364a;
    font-family: var(--app-font-family, 'Inter', Roboto, Arial, sans-serif);
    font-size: clamp(22px, 3vw, 27px);
    font-weight: 750;
    line-height: 1.25;
}

.app-auth-heading p {
    margin: 0;
    color: #778398;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
}

.app-auth-choice-group {
    min-width: 0;
    margin: 0 0 18px;
    padding: 10px 12px 12px;
    border: 1px solid #e3e8f0;
    border-radius: 10px;
    background: #f8f9fc;
}

.app-auth-choice-group legend {
    width: auto;
    margin: 0;
    padding: 0 5px;
    color: #536176;
    font-size: 12px !important;
    font-weight: 700;
}

.app-auth-choice-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 18px;
    margin: 0;
    background: transparent;
    text-align: center;
}

.app-auth-choice-options input[type="radio"] {
    accent-color: #6966e9;
}

.app-auth-choice-options .labelz {
    margin: 0;
    color: #425168;
    font-size: 13px;
    font-weight: 600;
}

.app-auth-channel {
    grid-column: 1 / -1;
    min-width: 0;
}

.app-auth-channel .login-input {
    margin: 0 0 16px;
}

.app-auth-field {
    display: grid;
    min-width: 0;
    gap: 7px;
    margin: 0 0 15px;
    color: #46556a;
    font-size: 13px;
    font-weight: 650;
}

.app-auth-field .login-input,
.app-auth-card > .login-input:not([type="hidden"]),
.app-auth-card select.login-input {
    width: 100% !important;
    min-width: 0;
    height: 46px !important;
    margin: 0;
    padding: 10px 13px;
    border: 1px solid #cfd6e0;
    border-radius: 9px;
    background: #fff !important;
    color: #29364a;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4 !important;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.app-auth-field .login-input::placeholder,
.app-auth-card > .login-input::placeholder {
    color: #9aa4b3;
    opacity: 1;
}

.app-auth-field .login-input:focus,
.app-auth-card > .login-input:focus,
.app-auth-card select.login-input:focus {
    border-color: #7772ed;
    box-shadow: 0 0 0 3px rgba(105, 102, 233, .14);
    outline: none;
}

.app-auth-submit,
.app-auth-card .login-button {
    width: 100%;
    min-height: 46px;
    margin: 4px 0 0;
    padding: 11px 16px;
    border: 0;
    border-radius: 9px;
    background: #6966e9;
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .01em;
    cursor: pointer;
    transition: background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.app-auth-submit:hover,
.app-auth-card .login-button:hover {
    background: #5b58dc;
    box-shadow: 0 7px 16px rgba(83, 79, 205, .2);
}

.app-auth-submit:focus-visible,
.app-auth-card .login-button:focus-visible {
    outline: 3px solid rgba(105, 102, 233, .28);
    outline-offset: 3px;
}

.app-auth-submit:disabled,
.app-auth-card .login-button:disabled {
    cursor: not-allowed;
    opacity: .58;
    transform: none;
}

.app-auth-card > .link:not(.app-auth-brand) {
    margin: 13px 0 0 !important;
    color: #738096;
    font-size: 12px;
    line-height: 1.55;
    text-align: center;
}

.app-auth-card > .link a {
    color: #6562df !important;
    font-weight: 650;
    text-decoration: none;
}

.app-auth-card > .link a:hover {
    text-decoration: underline;
}

.app-auth-secondary-action {
    min-height: 44px !important;
    margin: 12px 0 0 !important;
    border: 1px solid #e1e5ed !important;
    border-radius: 9px !important;
    background: #f7f8fb !important;
    color: #46556a !important;
    font-family: inherit;
    font-size: 13px !important;
    font-weight: 650;
}

.app-auth-secondary-action:hover {
    border-color: #c9cde9 !important;
    background: #f0f0fb !important;
}

.form.app-auth-card.app-auth-registration-form {
    width: min(100%, 760px) !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px 18px;
    padding: 62px 30px 28px;
}

.app-auth-registration-form > .app-auth-brand,
.app-auth-registration-form > .app-auth-heading,
.app-auth-registration-form > .app-auth-choice-group,
.app-auth-registration-form > #company_select,
.app-auth-registration-form > center,
.app-auth-registration-form > .app-auth-submit,
.app-auth-registration-form > .link {
    grid-column: 1 / -1;
}

.app-auth-registration-form > br {
    display: none;
}

.app-auth-registration-form > .login-input:not([type="hidden"]) {
    width: 100% !important;
    min-width: 0;
    height: 46px !important;
    margin: 0;
    padding: 10px 13px;
    border: 1px solid #cfd6e0;
    border-radius: 9px;
    background: #fff !important;
    color: #29364a;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4 !important;
}

.app-auth-registration-form > .login-input:not([type="hidden"]):focus {
    border-color: #7772ed;
    box-shadow: 0 0 0 3px rgba(105, 102, 233, .14);
    outline: none;
}

.app-auth-registration-form .app-auth-submit {
    margin-top: 2px;
}

.app-auth-registration-form #msg {
    display: block;
    min-height: 20px;
    color: #52647a;
    font-size: 13px;
}

.app-auth-registration-form .app-auth-channel select {
    margin: 0;
}

@media (max-width: 640px) {
    .app-auth-page {
        padding: 18px 12px;
    }

    .app-auth-layout {
        min-height: calc(100dvh - 36px);
    }

    .form.app-auth-card,
    .form.app-auth-card.app-auth-registration-form {
        width: min(100%, 440px) !important;
        margin-top: 38px;
        padding: 58px 20px 24px;
    }

    .form.app-auth-card.app-auth-recovery-form {
        width: min(100%, 440px) !important;
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .app-auth-recovery-form > .app-auth-secondary-action,
    .app-auth-recovery-form > .app-auth-submit {
        grid-column: 1;
    }

    .form.app-auth-card.app-auth-registration-form {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .form.app-auth-card > .app-auth-brand {
        left: calc(50% - 10px);
    }

    .app-auth-registration-form > .app-auth-brand,
    .app-auth-registration-form > .app-auth-heading,
    .app-auth-registration-form > .app-auth-choice-group,
    .app-auth-registration-form > #company_select,
    .app-auth-registration-form > center,
    .app-auth-registration-form > .app-auth-submit,
    .app-auth-registration-form > .link {
        grid-column: 1;
    }

    .app-auth-choice-options {
        gap: 8px 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-auth-page *,
    .app-auth-page *::before,
    .app-auth-page *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
