:root {
    --cism-green: #32d52b;
    --cism-green-dark: #17981b;
    --cism-green-soft: #dbffcb;
    --cism-blue: #1428ff;
    --cism-surface: #ffffff;
    --cism-text: #16311a;
    --cism-muted: #5a715e;
    --cism-border: #d2e8c7;
    --cism-bg-1: #f7fff1;
    --cism-bg-2: #e5ffd7;
}

.login-body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    color: var(--cism-text);
    background: radial-gradient(circle at 12% 20%, #ffffff 0, #f2ffe9 40%, #dfffcf 100%);
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    box-sizing: border-box;
}

.login-shell {
    width: min(1120px, 100%);
    min-height: 620px;
    display: grid;
    grid-template-columns: 1.08fr 1fr;
    background: var(--cism-surface);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 24px 52px rgba(51, 140, 23, 0.18);
}

.brand-pane {
    padding: 42px;
    background: linear-gradient(155deg, var(--cism-bg-1) 0%, var(--cism-bg-2) 100%);
    border-right: 1px solid var(--cism-border);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.brand-logo-wrap {
    padding: 18px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid #d6eec9;
    max-width: 470px;
    box-shadow: 0 12px 28px rgba(36, 122, 26, 0.08);
}

.brand-logo {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

.brand-title {
    margin: 24px 0 8px;
    font-size: clamp(1.7rem, 2vw, 2.15rem);
    line-height: 1.2;
    color: var(--cism-green-dark);
}

.brand-subtitle {
    margin: 0;
    font-size: 1.04rem;
    color: #1f7d22;
    font-weight: 700;
}

.brand-note {
    margin-top: 14px;
    color: var(--cism-muted);
    line-height: 1.7;
    max-width: 46ch;
}

.form-pane {
    padding: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
}

.form-card {
    width: min(460px, 100%);
}

.form-title {
    margin: 0;
    color: var(--cism-green-dark);
    font-size: 1.95rem;
}

.form-subtitle {
    margin: 8px 0 22px;
    color: var(--cism-muted);
    line-height: 1.6;
}

.field-group {
    margin-top: 16px;
}

.field-label {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 0.94rem;
    color: #216d23;
    font-weight: 700;
}

.login-input {
    width: 100%;
}

.login-input.ui-inputfield {
    box-sizing: border-box;
    width: 100%;
    height: 46px;
    padding: 11px 13px;
    border: 1px solid var(--cism-border);
    border-radius: 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: #133728;
}

.login-input.ui-inputfield:focus {
    border-color: #34c62a;
    box-shadow: 0 0 0 3px rgba(52, 198, 42, 0.18);
}

.login-button {
    margin-top: 24px;
    width: 100%;
    border: none;
    border-radius: 11px;
    min-height: 48px;
    background: linear-gradient(90deg, #149117 0%, var(--cism-green) 100%);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.login-button:hover,
.login-button:focus {
    background: linear-gradient(90deg, #118414 0%, #29c421 100%);
}

#messages {
    margin-bottom: 10px;
}

.ui-messages {
    margin: 0 0 12px;
}

.ui-messages .ui-messages-error,
.ui-messages .ui-messages-warn,
.ui-messages .ui-messages-info,
.ui-messages .ui-messages-fatal {
    border-radius: 10px;
}

/* ── Loader overlay ─────────────────────────────────── */
.sgels-loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 60, 25, 0.52);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    backdrop-filter: blur(3px);
}
.sgels-loader-box {
    background: #fff;
    border-radius: 20px;
    padding: 38px 52px;
    text-align: center;
    box-shadow: 0 16px 48px rgba(15, 93, 47, 0.24);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.sgels-loader-spinner {
    width: 54px;
    height: 54px;
    border: 5px solid #d4eed9;
    border-top-color: #0f5d2f;
    border-radius: 50%;
    animation: sgelsSpinAnim 0.75s linear infinite;
}
@keyframes sgelsSpinAnim { to { transform: rotate(360deg); } }
.sgels-loader-label {
    color: #0f5d2f;
    font-size: 0.97rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.2px;
}

@media (max-width: 990px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .brand-pane {
        border-right: none;
        border-bottom: 1px solid var(--cism-border);
        padding: 28px 24px;
    }

    .form-pane {
        padding: 28px 24px;
    }
}

@media (max-width: 620px) {
    .login-page {
        padding: 12px;
    }

    .brand-logo-wrap {
        padding: 12px;
    }

    .form-title {
        font-size: 1.6rem;
    }
}
