:root {
    --login-bg: #1a2b45;
    --login-input-bg: #e8eef5;
    --login-input-text: #1a2b45;
    --login-red: #b91c2c;
    --login-red-hover: #991b1b;
    --login-white: #ffffff;
    --login-muted: rgba(255, 255, 255, 0.85);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.login-page {
    margin: 0;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--login-bg);
    color: var(--login-white);
}

.login-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.login-brand {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 2rem;
    max-width: 50%;
}

.login-brand img {
    width: auto;
    max-width: min(360px, 82%);
    max-height: min(300px, 52vh);
    height: auto;
    object-fit: contain;
}

.login-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 3rem;
}

.login-form-wrap {
    width: 100%;
    max-width: 380px;
    text-align: center;
}

.login-form-wrap h1 {
    margin: 0 0 2rem;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.login-alert {
    margin: 0 0 1.25rem;
    padding: 0.65rem 0.85rem;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.login-alert--error {
    background: rgba(185, 28, 44, 0.25);
    border: 1px solid rgba(255, 120, 120, 0.5);
    color: #ffe4e6;
}

.login-alert--success {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(134, 239, 172, 0.45);
    color: #dcfce7;
}

.input-group {
    margin-bottom: 1.35rem;
    text-align: center;
}

.input-group label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--login-muted);
}

.input-group input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: none;
    border-radius: 6px;
    background: var(--login-input-bg);
    color: var(--login-input-text);
    font-size: 0.95rem;
}

.input-group input::placeholder {
    color: #6b7c93;
}

.input-group input:focus {
    outline: 2px solid rgba(255, 255, 255, 0.35);
    outline-offset: 1px;
}

.password-input-wrap {
    position: relative;
}

.password-input-wrap input {
    padding-right: 2.75rem;
}

.btn-toggle-password {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #5a6b82;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-toggle-password:hover,
.btn-toggle-password:focus-visible {
    color: var(--login-bg);
    outline: none;
}

.btn-toggle-password i {
    font-size: 1rem;
    pointer-events: none;
}

.login-forgot {
    display: inline-block;
    margin: 0.25rem 0 1.75rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--login-white);
    text-decoration: none;
    opacity: 0.9;
}

.login-forgot:hover {
    opacity: 1;
    text-decoration: underline;
}

.btn-login {
    width: 100%;
    padding: 0.9rem 1rem;
    border: none;
    border-radius: 6px;
    background: var(--login-red);
    color: var(--login-white);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-login:hover {
    background: var(--login-red-hover);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: wait;
}

.login-back {
    display: inline-block;
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--login-muted);
    text-decoration: none;
}

.login-back:hover {
    color: var(--login-white);
    text-decoration: underline;
}

.login-hint {
    margin: 0 0 1.5rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--login-muted);
}

#loading-area {
    margin-top: 1rem;
}

#loading-area img {
    width: 40px;
}

@media (max-width: 900px) {
    .login-shell {
        flex-direction: column;
    }

    .login-brand {
        flex: 0;
        max-width: 100%;
        padding: 1.25rem 1rem 0.75rem;
    }

    .login-brand img {
        max-width: min(280px, 78vw);
        max-height: 200px;
    }

    .login-panel {
        flex: 1;
        padding: 1.5rem 1.25rem 2.5rem;
    }
}
