:root {
    --brand-blue: #2A3C90;
    --brand-blue-hover: #21316F;
    --brand-red: #BC202E;
    --page: #F7F8FC;
    --text: #172033;
    --muted: #475569;
    --border: #8A94A8;
    --danger: #B42318;
}

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

body {
    min-height: 100vh;
    margin: 0;
    padding: 32px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--text);
    background: radial-gradient(circle at 12% 12%, #E9ECFA 0, transparent 32%), var(--page);
}

.login-container { width: 100%; max-width: 470px; }

.login-card {
    position: relative;
    overflow: hidden;
    padding: 36px 40px 40px;
    border: 1px solid #DCE2EC;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 22px 55px rgba(23, 32, 51, 0.09);
}

.login-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: var(--brand-red);
}

.login-header { text-align: center; margin-bottom: 30px; }

.login-logo {
    width: 100%;
    max-width: 360px;
    height: 116px;
    margin: 0 auto 18px;
    overflow: hidden;
}

.login-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.login-header h1 {
    margin: 0 0 7px;
    color: var(--text);
    font-size: clamp(1.45rem, 4vw, 1.75rem);
    line-height: 1.25;
    font-weight: 700;
}

.login-header p { margin: 0; color: var(--muted); font-size: 0.94rem; }
.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 8px; color: var(--text); font-size: 0.9rem; font-weight: 600; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group > i { position: absolute; left: 15px; color: var(--muted); pointer-events: none; }

.input-group input {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 11px 47px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: 0;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 0.94rem;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.input-group input::placeholder { color: #5B6475; opacity: 1; }
.input-group input:focus { border-color: var(--brand-blue); box-shadow: 0 0 0 3px rgba(42, 60, 144, 0.16); }

.toggle-password {
    position: absolute;
    right: 3px;
    display: flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}
.toggle-password:hover { color: var(--brand-blue); background: #E9ECFA; }
.form-options { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 24px; }
.remember-me { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: 0.9rem; cursor: pointer; }
.remember-me input { width: 17px; height: 17px; margin: 0; accent-color: var(--brand-blue); }

.btn-login {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 10px;
    background: var(--brand-blue);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background 180ms ease, box-shadow 180ms ease;
}
.btn-login:hover { background: var(--brand-blue-hover); box-shadow: 0 6px 16px rgba(42, 60, 144, 0.22); }
.btn-login:focus-visible, .toggle-password:focus-visible, .remember-me input:focus-visible {
    outline: 3px solid var(--brand-blue);
    outline-offset: 2px;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 22px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
}
.alert-danger { border: 1px solid #EFC1BE; background: #FDEDEC; color: var(--danger); }

@media (max-width: 520px) {
    body { padding: 18px 14px; }
    .login-card { padding: 26px 22px 30px; }
    .login-logo { max-width: 320px; height: 103px; }
}

@media (prefers-reduced-motion: reduce) {
    .input-group input, .btn-login { transition-duration: 0.01ms; }
}
