body {
    margin: 0;
    padding: 0;
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
    background:
        radial-gradient(ellipse 90% 70% at 10% -10%, rgba(37, 99, 235, 0.18), transparent 55%),
        radial-gradient(ellipse 80% 60% at 100% 0%, rgba(22, 33, 74, 0.16), transparent 50%),
        radial-gradient(ellipse 70% 50% at 50% 110%, rgba(14, 165, 233, 0.1), transparent 55%),
        #eef2f7;
}

.login-page {
    width: 100%;
    max-width: 440px;
    padding: 24px 20px;
    position: relative;
}

.login-toolbar {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2;
}

.login-theme-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: rgba(255, 255, 255, 0.9);
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.12s ease;
}

.login-theme-btn:active {
    transform: scale(0.96);
}

.login-lang {
    display: none;
}

.login-lang-btn {
    border: 1px solid #cbd5e1;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    color: #334155;
    transition: background 0.15s ease, transform 0.12s ease;
}

.login-lang-btn:active {
    transform: scale(0.96);
}

.login-lang-btn.active {
    background: #16214a;
    border-color: #16214a;
    color: #fff;
}

.login-box {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    padding: 44px 36px 32px;
    border-radius: 20px;
    box-shadow: 0 24px 56px rgba(15, 23, 42, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.7);
    transition: box-shadow 0.22s ease, transform 0.22s ease;
    animation: loginBoxIn 0.35s ease;
}

@keyframes loginBoxIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-box:focus-within {
    box-shadow: 0 28px 64px rgba(22, 33, 74, 0.18);
}

.login-logo {
    text-align: center;
    margin-bottom: 10px;
}

.login-logo img {
    max-height: 72px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(22, 33, 74, 0.12));
}

.login-brand {
    margin: 0 0 6px;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #16214a;
}

.login-box h2 {
    text-align: center;
    color: #475569;
    margin: 0 0 26px;
    font-size: 0.95rem;
    font-weight: 500;
}

.login-box input {
    width: 100%;
    padding: 13px 14px;
    margin-bottom: 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    box-sizing: border-box;
    font-size: 15px;
    background: #fff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.login-box input:focus {
    outline: none;
    border-color: #1e3a8a;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.12);
}

.login-box button[type="submit"] {
    width: 100%;
    padding: 13px;
    background: linear-gradient(180deg, #1c2b5c 0%, #16214a 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    margin-top: 6px;
    transition: background 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
    box-shadow: 0 6px 16px rgba(22, 33, 74, 0.28);
}

.login-box button[type="submit"]:hover {
    background: linear-gradient(180deg, #24356e 0%, #0f1733 100%);
    transform: translateY(-1px);
}

.login-box button[type="submit"]:active {
    transform: translateY(0) scale(0.99);
}

.login-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.45;
    text-align: left;
}

.login-error i {
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 16px;
}

.login-error-session {
    background: #eff6ff;
    color: #1e3a8a;
    border-color: #bfdbfe;
}

.login-timeout-hint {
    margin: 20px 0 0;
    font-size: 12px;
    line-height: 1.45;
    color: #64748b;
    text-align: center;
}

[data-theme="dark"] body {
    background:
        radial-gradient(ellipse 90% 70% at 10% -10%, rgba(59, 130, 246, 0.22), transparent 55%),
        radial-gradient(ellipse 80% 60% at 100% 0%, rgba(30, 58, 138, 0.25), transparent 50%),
        #0b1220;
}

[data-theme="dark"] .login-box {
    background: rgba(30, 41, 59, 0.92);
    border-color: rgba(148, 163, 184, 0.18);
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .login-brand {
    color: #f1f5f9;
}

[data-theme="dark"] .login-box h2 {
    color: #94a3b8;
}

[data-theme="dark"] .login-box input {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .login-theme-btn,
[data-theme="dark"] .login-lang-btn {
    background: rgba(30, 41, 59, 0.9);
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .login-lang-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

[data-theme="dark"] .login-error {
    background: color-mix(in srgb, #991b1b 22%, #1e293b);
    color: #fecaca;
    border-color: color-mix(in srgb, #fecaca 35%, transparent);
}

[data-theme="dark"] .login-error-session {
    background: color-mix(in srgb, #1e3a8a 28%, #1e293b);
    color: #bfdbfe;
    border-color: color-mix(in srgb, #93c5fd 35%, transparent);
}

[data-theme="dark"] .login-timeout-hint {
    color: #94a3b8;
}

@media (max-width: 480px) {
    .login-box {
        padding: 36px 22px 26px;
        border-radius: 16px;
    }

    .login-logo img {
        max-height: 64px;
    }
}
