html,
body.login {
    height: 100%;
    margin: 0;
}

body.login {
    color: #16324f;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.4;
}

body.login::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background: #1876c9 url("../images/cumulus-sky.jpg") center center / cover no-repeat;
}

body.login::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(8, 36, 78, 0.04) 0%, rgba(8, 36, 78, 0.28) 100%);
}

.login-stage {
    box-sizing: border-box;
    display: flex;
    min-height: 100%;
    min-height: 100dvh;
    perspective: 1200px;
    padding:
        max(16px, env(safe-area-inset-top))
        max(16px, env(safe-area-inset-right))
        max(16px, env(safe-area-inset-bottom))
        max(16px, env(safe-area-inset-left));
}

.client-login {
    box-sizing: border-box;
    width: min(420px, 100%);
    margin: auto;
    padding: clamp(22px, 4vw, 36px) clamp(18px, 4vw, 36px) 18px;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(244, 249, 255, 0.94) 100%);
    box-shadow:
        0 24px 60px rgba(8, 36, 78, 0.28),
        0 2px 8px rgba(8, 36, 78, 0.12);
    backdrop-filter: blur(10px);
    transform: translateY(0) scale(1) rotateX(0deg);
    transform-origin: center center;
    transition: transform .4s cubic-bezier(.2, .75, .25, 1), box-shadow .4s ease;
}

@media (hover: hover) and (pointer: fine) {
    .client-login:hover {
        transform: translateY(-6px) scale(1.03) rotateX(3.5deg);
        box-shadow:
            0 34px 68px rgba(8, 36, 78, 0.34),
            0 12px 22px rgba(8, 36, 78, 0.16);
    }
}

.login-brand {
    margin: 0 0 22px;
    text-align: center;
}

.login-brand img {
    display: block;
    width: min(280px, 78%);
    height: auto;
    margin: 0 auto 14px;
}

.login-brand .company {
    margin: 0;
    color: #3d5874;
    font-size: clamp(11px, 2.6vw, 13px);
    font-weight: 600;
    letter-spacing: 0.14em;
    line-height: 1.45;
    text-transform: uppercase;
}

.login-field {
    margin: 0 0 14px;
}

.login-field label {
    display: block;
    margin: 0 0 6px;
    color: #1c3d5e;
    font-size: 13px;
    font-weight: 600;
}

.login-field input {
    box-sizing: border-box;
    display: block;
    width: 100%;
    min-height: 46px;
    margin: 0;
    padding: 10px 14px;
    border: 1px solid #c5d4e6;
    border-radius: 12px;
    background: #f7fbff;
    color: #16324f;
    font: inherit;
    font-size: 16px;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.login-field input:hover {
    border-color: #8eb4d8;
}

.login-field input:focus {
    outline: none;
    border-color: #2b7ec8;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(43, 126, 200, 0.18);
}

.login-field .error {
    margin: 6px 0 0;
    color: #9d2438;
    font-size: 13px;
    line-height: 1.35;
}

.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0 16px;
    color: #2c4a66;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

.remember input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #0e3d78;
    flex: 0 0 auto;
}

.client-login button {
    box-sizing: border-box;
    display: block;
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 12px 16px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(180deg, #1d5eae 0%, #0d3b78 100%);
    color: #ffffff;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        0 8px 18px rgba(13, 59, 120, 0.28);
    transition: filter .15s ease, transform .08s ease;
}

.client-login button:hover {
    filter: brightness(1.08);
}

.client-login button:active {
    transform: translateY(1px);
    filter: brightness(0.98);
}

.client-login button:focus-visible {
    outline: none;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        0 0 0 4px rgba(43, 126, 200, 0.35);
}

.ipAddress {
    margin: 16px 0 4px;
    padding-top: 12px;
    border-top: 1px solid rgba(22, 50, 79, 0.1);
    color: #5d738a;
    font-size: 12px;
    text-align: center;
}

@media (max-width: 420px) {
    .login-stage {
        padding:
            max(12px, env(safe-area-inset-top))
            max(12px, env(safe-area-inset-right))
            max(12px, env(safe-area-inset-bottom))
            max(12px, env(safe-area-inset-left));
    }

    .client-login {
        border-radius: 18px;
    }

    .login-brand {
        margin-bottom: 16px;
    }

    .login-brand .company {
        letter-spacing: 0.08em;
    }
}

@media (max-height: 640px) {
    .login-stage {
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .client-login {
        padding-top: 14px;
        padding-bottom: 8px;
    }

    .login-brand {
        margin-bottom: 8px;
    }

    .login-brand img {
        width: min(190px, 56%);
        margin-bottom: 6px;
    }

    .login-field {
        margin-bottom: 8px;
    }

    .remember {
        margin-bottom: 10px;
    }

    .ipAddress {
        margin-top: 10px;
        padding-top: 8px;
    }

    .login-field input,
    .client-login button {
        min-height: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-field input,
    .client-login button,
    .client-login {
        transition: none;
    }

    .client-login:hover {
        transform: none;
    }
}
