html {
    min-height: 100%;
    background: #f1f5f9;
}

body.auth-page {
    --auth-ink: #172e49;
    --auth-muted: #586a7d;
    --auth-blue: #245e96;
    --auth-line: #c7d2df;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--auth-ink);
    background: #f1f5f9;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.auth-page *,
.auth-page *::before,
.auth-page *::after {
    box-sizing: border-box;
}

.auth-page ::selection {
    color: #172e49;
    background: #d9e9f7;
}

.auth-shell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 48px 24px 28px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.auth-brand img {
    flex: 0 0 auto;
    width: 48px;
    height: 54px;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.auth-brand-name {
    margin: 0 0 2px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.auth-brand-caption {
    margin: 0;
    color: var(--auth-muted);
    font-size: 13px;
}

.auth-page .auth-card.card {
    width: 100%;
    max-width: 440px;
    margin: 0 !important; /* The legacy auth initializer adds Bootstrap's mt-5. */
    border: 0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 40px -16px rgba(23, 46, 73, 0.25);
    transition: none;
}

.auth-page .auth-card .card-body {
    padding: 36px 36px 28px;
}

.auth-card h1 {
    margin: 0 0 8px;
    color: var(--auth-ink);
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.25;
}

.auth-description {
    margin: 0 0 28px;
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 1.6;
}

.auth-field {
    margin-bottom: 20px;
}

.auth-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
}

.auth-input {
    position: relative;
}

.auth-input > .mdi {
    position: absolute;
    top: 50%;
    left: 14px;
    z-index: 1;
    color: var(--auth-muted);
    font-size: 20px;
    line-height: 1;
    pointer-events: none;
    transform: translateY(-50%);
}

.auth-card .form-control {
    width: 100%;
    height: 48px;
    padding: 11px 14px;
    color: var(--auth-ink);
    background: #fff;
    border: 1px solid var(--auth-line);
    border-radius: 7px;
    font-family: inherit;
    font-size: 16px;
    line-height: 24px;
    caret-color: var(--auth-blue);
    box-shadow: none;
    transition: border-color 150ms ease;
}

.auth-input .form-control {
    padding-left: 44px;
}

.auth-card .form-control::placeholder {
    color: #66788a;
    opacity: 1;
}

.auth-card .form-control:hover {
    border-color: #8fa3b8;
}

.auth-card .form-control:focus {
    border-color: var(--auth-blue);
    outline: 3px solid #c5dcf0;
    outline-offset: 1px;
    box-shadow: none;
}

.auth-card .form-control:disabled {
    color: var(--auth-muted);
    background: #eef2f6;
    cursor: not-allowed;
}

.auth-captcha {
    display: flex;
    justify-content: center;
    min-height: 78px;
    margin: 24px 0 4px;
}

.auth-recovery {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 18px;
}

.auth-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 8px 0;
    border: 0;
    background: transparent;
    color: var(--auth-blue);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    text-underline-offset: 3px;
    cursor: pointer;
}

.auth-link:hover {
    color: #194a78;
    text-decoration: underline;
}

.auth-card .btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    margin-top: 8px;
    padding: 12px 16px;
    border: 1px solid var(--auth-blue);
    border-radius: 7px;
    color: #fff;
    background: var(--auth-blue);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 22px;
    box-shadow: none;
    transition: background-color 150ms ease, border-color 150ms ease;
}

.auth-card .btn-primary .mdi {
    font-size: 19px;
    line-height: 1;
}

.auth-card .btn-primary:hover {
    border-color: #1b4d7d;
    background: #1b4d7d;
}

.auth-card .btn-primary:active {
    border-color: #163f66;
    background: #163f66;
}

.auth-card .btn-primary:disabled,
.auth-card .btn-primary.disabled {
    border-color: #52779d;
    background: #52779d;
    opacity: 1;
    cursor: wait;
}

.auth-link:focus-visible,
.auth-card .btn-primary:focus-visible,
.auth-footer a:focus-visible {
    outline: 3px solid #93b9db;
    outline-offset: 4px;
    box-shadow: none;
}

.auth-navigation {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 16px;
    margin-top: 18px;
}

.auth-card-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px 24px;
    border-top: 1px solid #e8edf3;
    color: var(--auth-muted);
    font-size: 12px;
    text-align: center;
}

.auth-card-footer .mdi {
    margin-right: 4px;
    font-size: 14px;
}

.auth-version {
    font-size: 11px;
}

.auth-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
    color: var(--auth-muted);
    font-size: 11px;
}

.auth-footer a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.auth-footer img {
    display: block;
    width: 80px;
    height: 44px;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.auth-card .alert {
    margin: 0 0 24px;
    padding: 12px 14px;
    border-radius: 7px;
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.auth-card .alert-danger {
    color: #8d2929;
    border: 1px solid #edc5c5;
    background: #fff2f2;
}

.auth-card .alert-success {
    color: #21643c;
    border: 1px solid #b9dec8;
    background: #eff9f2;
}

.main-hidden,
.auth-component-login-alert,
.auth-component-error,
.auth-component-success {
    display: none;
}

@media (max-width: 479px) {
    .auth-shell {
        padding: 32px 16px 24px;
    }

    .auth-brand {
        gap: 12px;
        align-self: flex-start;
        margin: 0 8px 24px;
    }

    .auth-brand-name {
        max-width: 230px;
        font-size: 15px;
    }

    .auth-page .auth-card .card-body {
        padding: 28px 24px 24px;
    }

    .auth-card h1 {
        font-size: 24px;
    }
}

@media (max-width: 374px) {
    .auth-page .auth-card .card-body {
        padding-right: 16px;
        padding-left: 16px;
    }

    .auth-captcha {
        justify-content: flex-start;
        width: calc(100% / 0.84);
        min-height: 66px;
        margin-bottom: -8px;
        transform: scale(0.84);
        transform-origin: left top;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-page *,
    .auth-page *::before,
    .auth-page *::after {
        transition: none !important;
    }
}
