html {
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
}

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

body.login-page {
    min-height: 100%;
    width: 100%;
    min-width: 0;
    margin: 0;
    overflow-x: hidden;
    background: #eef3fa;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #18233a;
}

.login-shell {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(14px, 4vw, 24px) clamp(12px, 4vw, 16px);
}

.login-card {
    width: min(100%, 560px);
    max-width: 100%;
    background: #fff;
    border: 1px solid #dbe4ef;
    border-radius: 24px;
    box-shadow: 0 18px 42px rgba(26, 43, 72, 0.08);
    padding: 34px 32px 28px;
}

.login-logo {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo img {
    display: inline-block;
    max-width: 180px;
    width: clamp(128px, 48%, 180px);
    height: auto;
}

.login-alert {
    border-radius: 12px;
    margin-bottom: 18px;
}

.login-form-group {
    margin-bottom: 22px;
}

.login-form-group label {
    display: block;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #19243d;
}

.login-form-control {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 52px;
    border: 1px solid #cfd8e3;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 16px;
    line-height: 1.35;
    outline: none;
    background: #fff;
    color: #18233a;
    -webkit-appearance: none;
    appearance: none;
}

.login-form-control:focus {
    border-color: #2f6dde;
    box-shadow: 0 0 0 3px rgba(47, 109, 222, 0.12);
}

.login-submit,
.login-secondary-submit,
.login-captcha-refresh {
    font-family: inherit;
    cursor: pointer;
    touch-action: manipulation;
}

.login-submit {
    width: 100%;
    height: 56px;
    border: none;
    border-radius: 14px;
    background: #3e7fbe;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}

.login-submit:hover {
    background: #2f6fae;
}

.login-submit:disabled,
.login-secondary-submit:disabled,
.login-captcha-refresh:disabled {
    cursor: not-allowed;
    opacity: .72;
}

.login-actions {
    margin-top: 14px;
    text-align: right;
}

.login-actions a {
    color: #2f6dde;
    text-decoration: none;
    font-size: 16px;
}

.login-captcha {
    margin-bottom: 22px;
}

.login-captcha-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 60px;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.login-captcha-image {
    width: 100%;
    min-width: 0;
    height: 64px;
    border: 1px solid #ccd7e5;
    border-radius: 14px;
    background: #f8fbff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-captcha-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-captcha-refresh {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    border: 1px solid #cfd8e3;
    background: #fff;
    color: #1f2d49;
    font-size: 28px;
    line-height: 1;
}

.login-validation {
    color: #c0392b;
    font-size: 14px;
    margin-top: 6px;
}

.validation-summary-errors ul,
.validation-summary-valid ul {
    margin: 0;
    padding-left: 18px;
}

.validation-summary-valid {
    display: none;
}

.login-toast {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    width: auto;
    min-width: min(320px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 14px;
    box-shadow: 0 18px 42px rgba(26, 43, 72, 0.12);
    border: 1px solid transparent;
    font-size: 16px;
}

.login-toast__icon {
    font-size: 26px;
    line-height: 1;
}

.login-toast__text {
    flex: 1 1 auto;
    min-width: 0;
}

.login-toast--error {
    background: #fdeeee;
    border-color: #f0c8c8;
    color: #b44638;
}

.login-toast--success {
    background: #edf8f1;
    border-color: #cfe8d8;
    color: #287548;
}

.login-toast--warning {
    background: #fff7e7;
    border-color: #f0dcaa;
    color: #9a6a00;
}

.login-device-warning {
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid #bfd7ff;
    background: #eff6ff;
    color: #1e3a5f;
}

.login-device-warning--otp {
    background: #f8fbff;
    border-color: #dbe7f6;
}

.login-device-warning__title {
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 8px;
    color: #14213d;
}

.login-device-warning__text {
    font-size: 15px;
    line-height: 1.5;
}

.login-device-warning__device {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #dbe7f6;
    font-size: 14px;
    color: #26364f;
    overflow-wrap: anywhere;
}

.login-secondary-submit {
    width: 100%;
    height: 52px;
    margin-top: 12px;
    border: 1px solid #cfd8e3;
    border-radius: 14px;
    background: #fff;
    color: #1f2d49;
    font-size: 16px;
    font-weight: 700;
}

.login-secondary-submit:hover {
    background: #f8fbff;
}

.login-actions--center {
    text-align: center;
}

.login-form-control--otp {
    text-align: center;
    letter-spacing: 8px;
    font-size: 24px;
    font-weight: 800;
}

@media (max-width: 640px) {
    .login-shell {
        align-items: flex-start;
        padding: max(14px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom));
    }

    .login-card {
        padding: 24px 18px 22px;
        border-radius: 20px;
    }

    .login-logo {
        margin-bottom: 20px;
    }

    .login-form-group,
    .login-captcha {
        margin-bottom: 18px;
    }

    .login-captcha-row {
        grid-template-columns: minmax(0, 1fr) 56px;
        gap: 10px;
    }

    .login-captcha-refresh {
        width: 56px;
        height: 56px;
        font-size: 26px;
    }

    .login-toast {
        width: calc(100vw - 24px);
        font-size: 15px;
        padding: 12px 14px;
    }
}

@media (max-width: 420px) {
    .login-card {
        padding: 20px 14px 18px;
        border-radius: 18px;
    }

    .login-form-group label {
        font-size: 15px;
        margin-bottom: 8px;
    }

    .login-form-control {
        height: 48px;
        padding: 10px 12px;
    }

    .login-submit {
        height: 52px;
    }

    .login-captcha-row {
        grid-template-columns: minmax(0, 1fr) 52px;
    }

    .login-captcha-image {
        height: 58px;
    }

    .login-captcha-refresh {
        width: 52px;
        height: 52px;
        border-radius: 12px;
        font-size: 24px;
    }

    .login-actions,
    .login-actions a {
        font-size: 15px;
    }
}

@media (max-width: 340px) {
    .login-card {
        padding-left: 12px;
        padding-right: 12px;
    }

    .login-captcha-row {
        grid-template-columns: 1fr;
    }

    .login-captcha-refresh {
        width: 100%;
    }
}
