/** Login Styling (modernized, responsive, accessible) **/

:root {
    --bp-bg: #f3f7fb;
    --bp-surface: rgba(255,255,255,0.78);
    --bp-surface-strong: rgba(255,255,255,0.92);
    --bp-primary: #51a6cc;
    --bp-primary-strong: #3b95bf;
    --bp-accent: #37d1c9;
    --bp-text: #1a2730;
    --bp-muted: #6b7c86;
    --bp-shadow: 0 10px 30px rgba(0,0,0,0.12);
    --bp-radius: 12px;
    --bp-focus: 0 0 0 3px rgba(81,166,204,0.35);
}

#login_page  {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background-image: url('../images/login_bg.jpg');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    background-color: var(--bp-bg);
    z-index: 9999999 !important;
}

.login-form  {
    width: 100%;
    max-width: 420px;
    background-color: var(--bp-surface);
    backdrop-filter: saturate(120%) blur(6px);
    -webkit-backdrop-filter: saturate(120%) blur(6px);
    border-radius: var(--bp-radius);
    box-shadow: var(--bp-shadow);
    overflow: visible;
    position: relative;
}

.login_subcontainer  {
	width: 100%;
	height: auto;
	padding: 30px;
}

#login_header  {
    text-align: center;
    border-bottom: 2px solid rgba(81,166,204,0.25);
    color: var(--bp-primary);
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    line-height: 24px;
    padding-top: 16px;
    padding-bottom: 14px;
}

#login_body  {
    background-image: url('../images/bp_logo_login.svg');
    background-size: 60% auto;
    background-position: top 16px center;
    background-repeat: no-repeat;
    padding-top: 24px;
}

.login-form input[type="text"], .login-form input[type="password"]  {
    width: 100%;
    height: auto;
    padding: 12px 14px;
    border: 1px solid rgba(81,166,204,0.35);
    border-radius: 8px;
    margin-bottom: 12px;
    font-family: 'Open Sans', sans-serif;
    font-weight: 500;
    font-size: 15px;
    color: var(--bp-text);
    background-color: var(--bp-surface-strong);
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.login-form input[type="text"]::placeholder, .login-form input[type="password"]::placeholder {
    color: var(--bp-muted);
}

.login-form input[type="text"]:focus, .login-form input[type="password"]:focus {
    outline: none;
    border-color: var(--bp-primary);
    box-shadow: var(--bp-focus);
    background-color: #fff;
}

#uname  {}

#pass  {}

.login_entry_container  {padding-bottom: 8px;}

.login_button_container  {}

.loginbtn  {
    width: 100%;
    height: auto;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: .2px;
    color: #FFF;
    border: 0;
    background: linear-gradient(180deg, var(--bp-primary) 0%, var(--bp-primary-strong) 100%);
    padding: 14px 16px;
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(81,166,204,0.28);
    transition: transform .06s ease, box-shadow .2s ease, filter .2s ease;
}

.loginbtn:hover  { filter: brightness(1.05); box-shadow: 0 8px 20px rgba(81,166,204,0.35); }
.loginbtn:active { transform: translateY(1px); }
.loginbtn:focus { outline: none; box-shadow: var(--bp-focus), 0 6px 16px rgba(81,166,204,0.28); }

.login-form .error  {
    width: 100%;
    height: auto;
    position: relative;
}

.login-form .alert-warning,
.login-form .alert-danger,
.login-form .alert-success  {
    width: 100%;
    min-height: 120px;
    background-color: var(--bp-surface-strong);
    border: 1px solid rgba(81,166,204,0.35);
    border-radius: 10px;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    padding: 24px;
    color: var(--bp-primary);
    box-shadow: var(--bp-shadow);
    z-index: 10;
}

#close_login_error  {
    width: 100%;
    max-width: 240px;
    height: auto;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 14px;
    background-color: var(--bp-primary);
    padding: 12px 14px;
    margin-top: 16px;
    border-radius: 8px;
    color: #FFF;
    box-shadow: 0 4px 12px rgba(81,166,204,0.25);
}

#close_login_error:hover  { background-color: var(--bp-primary-strong); }

.hide_error  {
	display: none;
}

#version {
    text-align: center;
    color: var(--bp-primary);
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    padding-top: 8px;
    padding-bottom: 12px;
}

/* Responsive tweaks */
@media (max-width: 480px) {
    .login_subcontainer { padding: 22px; }
    #login_body { background-size: 70% auto; padding-top: 16px; }
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .loginbtn { transition: none; }
    .login-form input[type="text"], .login-form input[type="password"] { transition: none; }
}

/* Dark mode support (visual only) */
@media (prefers-color-scheme: dark) {
    :root {
        --bp-bg: #0f1a22;
        --bp-surface: rgba(18,26,33,0.78);
        --bp-surface-strong: rgba(18,26,33,0.92);
        --bp-text: #eaf2f7;
        --bp-muted: #9fb1bc;
        --bp-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }
    #login_page { background-color: var(--bp-bg); }
    .loginbtn { box-shadow: 0 6px 16px rgba(81,166,204,0.35); }
}