/* =========================================================
   ePRMS LOGIN - full-screen layout
   Uses the design tokens from screen.css (--eprms-green etc.)
   ========================================================= */

* {
    box-sizing: border-box;
}

html,
body.login-screen {
    height: 100%;
}

/* screen.css gives body a 1000px min-width for the app chrome;
   the login page is responsive and must not inherit it */
body.login-screen {
    min-width: 0;
    margin: 0;
    padding: 0;

    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 14px;
    color: var(--text);

    background: var(--background);
}


/* Two-column shell
--------------------------------------------------------- */

.login-shell {
    min-height: 100vh;

    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}


/* Left: brand panel
--------------------------------------------------------- */

.login-brand {
    position: relative;
    overflow: hidden;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    padding: 48px 56px;

    color: #ffffff;

    background:
        radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.14), transparent 40%),
        radial-gradient(circle at 90% 95%, rgba(0, 0, 0, 0.18), transparent 45%),
        linear-gradient(150deg, var(--eprms-green) 0%, var(--eprms-green-dark) 55%, #0f5132 100%);
}

/* soft rings in the background */
.login-brand::before,
.login-brand::after {
    content: "";
    position: absolute;

    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.10);

    pointer-events: none;
}

.login-brand::before {
    width: 520px;
    height: 520px;
    right: -180px;
    top: -160px;
}

.login-brand::after {
    width: 380px;
    height: 380px;
    left: -140px;
    bottom: -120px;
}

.brand-top,
.brand-main,
.brand-bottom {
    position: relative;
    z-index: 1;
}

.brand-top {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    width: 56px;
    height: 56px;

    border-radius: 14px;

    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.brand-name {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.brand-main {
    max-width: 560px;
}

.brand-main h1 {
    margin: 0 0 16px;

    font-size: 34px;
    font-weight: 600;
    line-height: 1.25;

    color: #ffffff;
}

.brand-main p {
    margin: 0 0 34px;

    font-size: 15px;
    line-height: 1.6;

    color: rgba(255, 255, 255, 0.82);
}

.brand-features {
    margin: 0;
    padding: 0;

    list-style: none;

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 24px;
}

.brand-features li {
    display: flex;
    align-items: center;
    gap: 12px;

    font-size: 14px;
    color: rgba(255, 255, 255, 0.92);
}

.brand-features i {
    width: 38px;
    height: 38px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;

    border-radius: 10px;

    background: rgba(255, 255, 255, 0.14);

    font-size: 16px;
}

.brand-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    margin-top: 28px;

    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;

    border-bottom: 1px solid rgba(255, 255, 255, 0.45);
}

.brand-more:hover,
.brand-more:focus {
    border-bottom-color: #ffffff;
}

.brand-more i {
    font-size: 12px;
}

/* narrow left column (900-1100px): tighter grid */
@media (max-width: 1100px) {
    .brand-features {
        gap: 12px 14px;
    }

    .brand-features li {
        gap: 10px;
        font-size: 13px;
    }

    .brand-features i {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }
}

.brand-bottom {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
}


/* Right: sign-in panel
--------------------------------------------------------- */

.login-panel {
    display: flex;
    flex-direction: column;

    background: linear-gradient(180deg, #f7faf8 0%, #f1f5f3 100%);

    border-top: 3px solid var(--eprms-green);
}

.login-panel-body {
    flex: 1;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 48px 32px;
}

.login-card {
    width: 100%;
    max-width: 420px;

    padding: 38px 40px 34px;

    background: var(--white);

    border: 1px solid var(--border-light);
    border-radius: var(--radius-large);

    box-shadow: var(--shadow);
}

.login-logo {
    display: block;

    height: 64px;
    width: auto;

    margin: 0 0 28px;
}

.login-heading {
    margin: 0 0 6px;

    font-size: 22px;
    font-weight: 600;

    color: var(--text-dark);
}

.login-subheading {
    margin: 0 0 28px;

    font-size: 13px;
    color: var(--text-light);
}


/* Form
--------------------------------------------------------- */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;

    margin-bottom: 7px;

    font-size: 13px;
    font-weight: 600;

    color: var(--text-dark);
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 15px;
    top: 50%;

    transform: translateY(-50%);

    font-size: 16px;
    color: var(--text-light);

    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    height: 46px;

    padding: 0 15px 0 44px;

    border: 1px solid #dce3df;
    border-radius: var(--radius);

    background: #fafcfb;

    font-family: inherit;
    font-size: 14px;
    color: var(--text-dark);

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.input-wrapper input::placeholder {
    color: #a5ada8;
}

.input-wrapper input:focus {
    background: var(--white);
    border-color: var(--eprms-green);
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.14);
}

.input-wrapper:focus-within i {
    color: var(--eprms-green);
}


/* Button
--------------------------------------------------------- */

.login-button {
    width: 100%;
    height: 48px;

    margin-top: 6px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    border: 0;
    border-radius: var(--radius);

    background: linear-gradient(135deg, var(--eprms-green), var(--eprms-green-dark));

    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;

    cursor: pointer;

    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.22);

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

.login-button:hover {
    background: linear-gradient(135deg, var(--eprms-green-dark), #0f5132);
    box-shadow: 0 7px 16px rgba(25, 135, 84, 0.28);
    transform: translateY(-1px);
}

.login-button:active {
    transform: translateY(0);
}

.login-button:focus-visible {
    outline: 3px solid rgba(25, 135, 84, 0.35);
    outline-offset: 2px;
}

.login-button i {
    font-size: 14px;
}


/* Error message
--------------------------------------------------------- */

.login-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    margin: -2px 0 18px;
    padding: 12px 14px;

    border: 1px solid #f1caca;
    border-radius: var(--radius);

    background: #fff4f4;

    font-size: 13px;
    line-height: 1.5;
    color: #b02a37;
}

.login-error > i {
    margin-top: 2px;
    font-size: 16px;
}


/* Footer (same look as the app footer)
--------------------------------------------------------- */

.login-footer {
    padding: 18px 32px;

    border-top: 1px solid var(--border-light);

    background: var(--white);

    font-size: 12px;
    text-align: center;
    color: #8b9690;
}

.login-footer strong {
    color: var(--text);
}


/* Tablet / mobile: stack, brand becomes a header band
--------------------------------------------------------- */

@media (max-width: 900px) {

    .login-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .login-brand {
        padding: 24px 28px;
    }

    .brand-main,
    .brand-bottom {
        display: none;
    }

    .brand-mark {
        width: 44px;
        height: 44px;
        border-radius: 11px;
    }

    .brand-name {
        font-size: 22px;
    }

    .login-panel {
        border-top: 0;
    }

    .login-panel-body {
        align-items: flex-start;
        padding: 32px 20px;
    }
}

@media (max-width: 480px) {

    .login-card {
        padding: 28px 22px 24px;
    }

    .login-logo {
        height: 52px;
        margin-bottom: 22px;
    }

    .login-footer {
        padding: 16px 20px;
    }
}


/* Light / dark switch, top right of the sign-in panel (same choice as in the app)
--------------------------------------------------------- */
.login-panel {position: relative;}
.login-theme {position: absolute;top: 14px;right: 16px;z-index: 1;display: inline-flex;align-items: center;height: 28px;padding: 0 12px;border: 1px solid var(--field-border);border-radius: 14px;background: var(--surface);color: var(--text);font: 600 12px "Segoe UI", Arial, sans-serif;cursor: pointer;}
.login-theme:hover {border-color: var(--eprms-green);color: var(--accent);}
.login-theme:focus-visible {outline: none;box-shadow: 0 0 0 3px rgba(25, 135, 84, .25);}
.login-theme .fa {margin-right: 6px;}
.login-theme .to-light,
[data-theme="dark"] .login-theme .to-dark {display: none;}
[data-theme="dark"] .login-theme .to-light {display: inline;}
/* narrow screens: the card starts higher (padding 32px), keep it clear of the switch */
@media (max-width: 900px) {
    .login-panel-body {padding-top: 58px;}
    .login-theme {right: 20px;}
}


/* Dark theme (html[data-theme="dark"], chosen in the app): the variables come from
   screen.css; these rules cover the colours that are only used on this page
--------------------------------------------------------- */
.login-logo.logo-dark,
[data-theme="dark"] .login-logo.logo-light {display: none;}
[data-theme="dark"] .login-logo.logo-dark {display: block;}

[data-theme="dark"] .login-brand {background: linear-gradient(150deg, #146c43 0%, #0f5132 55%, #0a3522 100%);}
[data-theme="dark"] .login-panel {background: linear-gradient(180deg, var(--page-top) 0%, var(--page-bottom) 100%);}
[data-theme="dark"] .input-wrapper input:not(:focus) {border-color: var(--field-border);}
[data-theme="dark"] .input-wrapper input {background: var(--surface-alt);color: var(--field-text);}
[data-theme="dark"] .input-wrapper input::placeholder {color: var(--placeholder);}
[data-theme="dark"] .login-error {border-color: var(--danger-line);background: var(--danger-bg);color: var(--danger-text);}
[data-theme="dark"] .login-footer {color: var(--text-light);}
