body.login-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    background-image:
            linear-gradient(90deg, rgba(248, 250, 252, 0.9), rgba(248, 250, 252, 0.58)),
            url("../2_res/background.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

body.login-page::before {
    background:
            radial-gradient(circle at 78% 12%, rgba(37, 99, 235, 0.14), transparent 28rem),
            linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.32));
}

body.login-page .system-status-banner {
    top: 0;
    left: 0;
    right: 0;
    border-radius: 0;
}

body.login-page.has-system-status-banner .login-container {
    margin-top: clamp(6.5rem, 13vh, 8rem);
}

/**
 * DIVs
 */
.login-container {
    width: min(27rem, calc(100vw - 2rem));
    margin-top: clamp(2rem, 7vh, 5rem);
    background: rgba(255, 255, 255, 0.94);
    padding: 2rem 2.1rem;
    margin-left: 1rem;
    margin-right: 1rem;
    border: 1px solid #e6edf6;
    border-radius: 0.9rem;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
    height: fit-content;
    box-sizing: border-box;

    z-index: 1;
}

.login-container form {
    margin: 0;
}

/**
 * LABELS, H1, ...
 */
.login-container h1 {
    color: #172033;
    margin: 1rem 0 0;
    text-align: center;
    font-size: 1.28rem;
    line-height: 1.25;
}

.login-container h4, .login-container h5 {
    font-size: calc(0.75 * var(--font-size));
    font-weight: lighter;
    font-style: italic;
    margin: 0;
    padding-top: 0;
    text-align: center;
}

.login-container h4 {
    color: #2563eb;
    text-decoration: underline;
    cursor: pointer;
}

.login-license {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    max-width: 100%;
    margin: -0.35rem 0 1rem;
    padding: 0.4rem 0.65rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.55rem;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.72rem;
    line-height: 1.2;
}

.login-license i {
    flex: 0 0 auto;
    color: #94a3b8;
}

.login-license strong {
    min-width: 0;
    overflow: hidden;
    color: #334155;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/**
 * INPUTs
 */
.login-input {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-height: 2.55rem;
    margin: 0.35rem 0 0.8rem;
    padding: 0.65rem 0.85rem !important;
    border-radius: 0.55rem;
}

/**
 * BUTTONs
 */
.login-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    height: 2.55rem;
    margin-top: 1rem !important;
    margin-bottom: 1rem !important;
    min-height: 2.55rem;
    padding: 0.65rem 0.85rem !important;
    color: white;
    background: linear-gradient(135deg, #16a34a, #15803d);
    border-radius: 0.55rem;
    font-weight: 800 !important;
    line-height: 1;
    transform: none !important;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

body.login-page .login-container button.login-button {
    width: 100%;
    height: 2.55rem;
    min-height: 2.55rem;
    margin-top: 1rem !important;
    margin-bottom: 1rem !important;
    border-width: 1px;
    font-weight: 800 !important;
    transform: none !important;
    translate: none !important;
    scale: none !important;
}

body.login-page button.login-button:not([disabled]):hover,
body.login-page button.login-button:not([disabled]):focus,
body.login-page button.login-button:not([disabled]):focus-visible,
body.login-page button.login-button:not([disabled]):active {
    background: linear-gradient(135deg, #14532d, #15803d) !important;
    color: white !important;
    width: 100%;
    height: 2.55rem;
    min-height: 2.55rem;
    margin-top: 1rem !important;
    margin-bottom: 1rem !important;
    border-width: 1px;
    font-weight: 800 !important;
    transform: none !important;
    translate: none !important;
    scale: none !important;
}

body.login-page .login-container button.login-button i {
    transform: none !important;
}

/**
 * As
 */
.login-a {
    display: block;
    text-align: center;
    font-size: 10pt;
    color: #2563eb;
    text-decoration: underline;
    cursor: pointer;
    margin-bottom: 5pt;
}

/**
 * IMAGES
 */
.login-logo-stack {
    position: relative;
    display: table;
    margin: 0 auto;
}

.login-logo {
    display: block;
    height: clamp(4.5rem, 9vh, 6rem);
    padding: 0;
    margin: 0;
}

.login-companylogo {
    position: absolute;
    right: -2.65rem;
    bottom: -0.25rem;
    display: block;
    width: clamp(3.3rem, 8vh, 4.25rem);
    max-height: 2.1rem;
    padding: 0.16rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.32rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 3px 9px rgba(15, 23, 42, 0.13);
    object-fit: contain;
}

.login-ohoitlogo {
    display: block;
    height: 2vh;
    padding: 0;
    margin: 10px auto 10px;
    cursor: pointer;
}

body.darkmode.login-page .login-container {
    background: rgba(15, 23, 42, 0.94);
    color: #dbeafe;
    border-color: rgba(148, 163, 184, 0.3);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
}

body.darkmode.login-page {
    background-image:
            linear-gradient(90deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.64)),
            url("../2_res/background_dark.png");
}

body.darkmode.login-page .login-container h1,
body.darkmode.login-page .login-container label,
body.darkmode.login-page .login-container h5 {
    color: #e5edf9;
}

body.darkmode.login-page .login-container *[class*=":noDark"] {
    color: #e5edf9 !important;
}

body.darkmode.login-page .login-container h4,
body.darkmode.login-page .login-a {
    color: #93c5fd;
}

body.darkmode.login-page .login-license {
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(30, 41, 59, 0.72);
    color: #94a3b8;
}

body.darkmode.login-page .login-license strong {
    color: #dbeafe;
}

body.darkmode.login-page .login-button {
    background: linear-gradient(135deg, #14532d, #16a34a);
    color: white;
}

body.darkmode.login-page .dialog-full-size {
    background: rgba(15, 23, 42, 0.98);
    color: #dbeafe;
    border-color: rgba(148, 163, 184, 0.3);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

body.darkmode.login-page .dialog-header {
    color: #93c5fd;
    border-bottom-color: rgba(147, 197, 253, 0.32);
}

body.login-page .login-changelog-dialog {
    left: 50%;
    right: auto;
    width: min(56rem, calc(100vw - 3rem));
    max-height: calc(100vh - 4rem);
    transform: translateX(-50%) translateY(-0.5rem) scale(0.98);
}

body.login-page .login-changelog-dialog.show {
    transform: translateX(-50%) translateY(0) scale(1);
}

body.login-page .login-changelog-dialog.hide {
    transform: translateX(-50%) translateY(-0.5rem) scale(0.98);
}

body.login-page .login-changelog-dialog .dialog-content {
    max-height: calc(100vh - 9rem);
}

.login-changelog {
    box-sizing: border-box;
    width: 100%;
    height: min(34rem, calc(100vh - 10rem));
    margin: 0;
    padding: 0.85rem;
    border: 1px solid #e6edf6;
    border-radius: 0.65rem;
    background: #f8fafc;
    color: #172033;
    font: 0.9rem/1.5 Consolas, "Courier New", monospace;
    overflow: auto;
    white-space: pre-wrap;
}

body.darkmode .login-changelog {
    background: #111827;
    color: #dbeafe;
    border-color: rgba(148, 163, 184, 0.26);
}

@media (max-width: 650px) {
    body.login-page .login-changelog-dialog,
    body.login-page .login-changelog-dialog.show,
    body.login-page .login-changelog-dialog.hide {
        left: 50%;
        right: auto;
        width: calc(100vw - 1.5rem);
        transform: translateX(-50%);
    }
}
