:root {
    --brand-navy: #0B2E4F;
    --brand-navy-deep: #071F36;
    --brand-steel: #1E4E7A;
    --cement: #E7E9EC;
    --cement-dark: #C9CED4;
    --ink: #1A1D21;
    --white: #FFFFFF;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
}

body.login-page {
    font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
    background: var(--cement);
    color: var(--ink);
    min-height: 100vh;
}

.login-shell {
    display: flex;
    min-height: 100vh;
}

/* Left brand panel */
.brand-panel {
    position: relative;
    flex: 0 0 55%;
    max-width: 55%;
    background: linear-gradient(160deg, var(--brand-navy-deep), var(--brand-navy));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 48px;
}

.brand-texture {
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.05) 0px,
        rgba(255, 255, 255, 0.05) 2px,
        transparent 2px,
        transparent 24px
    );
    pointer-events: none;
}

.brand-panel-inner {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 420px;
}

.brand-logo {
    max-height: 88px;
    width: auto;
    margin-bottom: 24px;
}

.brand-primary {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--white);
}

.brand-secondary {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0 0 16px;
    color: var(--cement);
    opacity: .9;
}

.brand-tagline {
    font-size: .85rem;
    color: var(--cement);
    opacity: .75;
    margin: 0;
    letter-spacing: .02em;
    line-height: 1.5;
}

/* Right login panel */
.login-panel {
    flex: 0 0 45%;
    max-width: 45%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--cement);
}

.login-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(11, 46, 79, 0.12);
    max-width: 420px;
    width: 100%;
    padding: 32px;
}

.login-heading {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 20px;
    color: var(--ink);
}

.alert-error {
    background: #FDECEC;
    border: 1px solid #F3B7B7;
    color: #8A1F1F;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: .875rem;
    margin-bottom: 16px;
}

/* Informational, not a failure — an idle timeout is normal, so it must not read as an error. */
.alert-notice {
    background: #EAF2FB;
    border: 1px solid #B7D2F3;
    color: #1F4A8A;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: .875rem;
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--ink);
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--cement-dark);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--ink);
    background: var(--white);
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
    outline: none;
    border-color: var(--brand-steel);
    box-shadow: 0 0 0 3px rgba(30, 78, 122, 0.2);
}

.password-wrap {
    position: relative;
}

.password-wrap input {
    padding-right: 44px;
}

.toggle-password {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5f6b7a;
    border-radius: 6px;
    line-height: 0;
}

.toggle-password:hover {
    color: var(--brand-navy);
}

.toggle-password:focus-visible {
    outline: 2px solid var(--brand-steel);
    outline-offset: 2px;
}

.form-row-remember {
    margin-bottom: 20px;
}

.remember-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .875rem;
    color: var(--ink);
    cursor: pointer;
}

.remember-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--brand-navy);
}

.btn-submit {
    width: 100%;
    min-height: 44px;
    background: var(--brand-navy);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-submit:hover {
    background: var(--brand-steel);
}

.btn-submit:focus-visible {
    outline: 3px solid var(--brand-steel);
    outline-offset: 2px;
}

.login-footer {
    margin: 20px 0 0;
    text-align: center;
    font-size: .75rem;
    color: #6b7480;
}

/* Tablet / mobile: single column, brand panel collapses into a compact header */
@media (max-width: 991.98px) {
    body.login-page {
        height: auto;
    }

    .login-shell {
        flex-direction: column;
        min-height: 100vh;
    }

    .brand-panel {
        flex: 0 0 auto;
        max-width: 100%;
        width: 100%;
        padding: 28px 20px;
    }

    .brand-logo {
        max-height: 64px;
        margin-bottom: 12px;
    }

    .brand-primary {
        font-size: 1.3rem;
    }

    .brand-secondary {
        font-size: 1rem;
    }

    .brand-tagline {
        font-size: .75rem;
    }

    .login-panel {
        flex: 1 1 auto;
        max-width: 100%;
        width: 100%;
        padding: 24px 16px 40px;
    }

    .login-card {
        padding: 24px;
    }
}

@media (max-width: 360px) {
    .brand-panel {
        padding: 24px 16px;
    }

    .login-panel {
        padding: 20px 12px 32px;
    }

    .login-card {
        padding: 20px;
    }
}
